Commit 93887324 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

initiate generation process

parent 725980e1
...@@ -128,9 +128,7 @@ package body TASTE.Concurrency_View is ...@@ -128,9 +128,7 @@ package body TASTE.Concurrency_View is
Filter : constant Filter_Type := (Directory => True, Filter : constant Filter_Type := (Directory => True,
others => False); others => False);
Output_File : File_Type; Output_File : File_Type;
Output_Dir : constant String := Base_Output_Path & "/concurrency_view"; Output_Dir : constant String := Base_Output_Path & "/concurrency_view/";
Content : constant String := "Hello";
File_Name : constant String := "Concurrency_View.aadl";
begin begin
Put_Info ("Generating Concurrency View"); Put_Info ("Generating Concurrency View");
-- All files are created in the same folder - create it -- All files are created in the same folder - create it
...@@ -158,16 +156,36 @@ package body TASTE.Concurrency_View is ...@@ -158,16 +156,36 @@ package body TASTE.Concurrency_View is
goto continue; goto continue;
end if; end if;
Put_Info ("Generating from " & Full_Name (Current)); declare
Path : constant String := Full_Name (Current);
Create (File => Output_File, Do_It : constant Boolean := Exists (Path & "/filename.tmplt");
Mode => Out_File, -- Get output file name from template
Name => Output_Dir & File_Name); File_Name : constant String :=
Put_Line (Output_File, Content); (if Do_It then
Strip_String (Parse (Path & "/filename.tmplt"))
Close (Output_File); else "");
-- Check if file already exists
Present : constant Boolean :=
(File_Name /= "" and Exists (Output_Dir & File_Name));
Trig_Tmpl : constant Translate_Set :=
+Assoc ("Filename_Is_Present", Present);
Trigger : constant Boolean :=
(Exists (Path & "/trigger.tmplt") and then
Strip_String
(Parse (Path & "/trigger.tmplt", Trig_Tmpl)) = "TRUE");
begin
if Trigger then
Put_Info ("Generating from " & Path);
Create (File => Output_File,
Mode => Out_File,
Name => Output_Dir & File_Name);
Put_Line (Output_File, "Hello");
Close (Output_File);
end if;
end;
<<continue>> <<continue>>
end loop; end loop;
End_Search (ST);
exception exception
when Error : Concurrency_View_Error | Ada.IO_Exceptions.Name_Error => when Error : Concurrency_View_Error | Ada.IO_Exceptions.Name_Error =>
Put_Error ("Concurrency View : " Put_Error ("Concurrency View : "
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment