+2013-10-14 Vincent Celier <celier@adacore.com>
+
+ * prj-attr.adb: New attributes in package Clean:
+ Artifacts_In_Exec_Dir, Artifacts_In_Object_Dir.
+ * prj-nmsc.adb (Process_Clean (Attributes)): New
+ procedure to process attributes Artifacts_In_Exec_Dir and
+ Artifacts_In_Object_Dir in package Clean.
+ * prj.ads (Project_Configuration): New components
+ Artifacts_In_Exec_Dir and Artifacts_In_Object_Dir.
+ * snames.ads-tmpl: New standard names Artifacts_In_Exec_Dir and
+ Artifacts_In_Object_Dir used only by gprclean.
+
2013-10-14 Robert Dewar <dewar@adacore.com>
* exp_attr.adb (Expand_N_Attribute_Reference): Add error
"LVswitches#" &
"Lasource_artifact_extensions#" &
"Laobject_artifact_extensions#" &
+ "LVartifacts_in_exec_dir#" &
+ "LVartifacts_in_object_dir#" &
-- package Cross_Reference
procedure Process_Builder (Attributes : Variable_Id);
-- Process the simple attributes of package Builder
+ procedure Process_Clean (Attributes : Variable_Id);
+ -- Process the simple attributes of package Clean
+
procedure Process_Clean (Arrays : Array_Id);
-- Process the associated array attributes of package Clean
-- Process_Clean --
-------------------
+ procedure Process_Clean (Attributes : Variable_Id) is
+ Attribute_Id : Variable_Id;
+ Attribute : Variable;
+ List : String_List_Id;
+
+ begin
+ -- Process non associated array attributes from package Clean
+
+ Attribute_Id := Attributes;
+ while Attribute_Id /= No_Variable loop
+ Attribute := Shared.Variable_Elements.Table (Attribute_Id);
+
+ if not Attribute.Value.Default then
+ if Attribute.Name = Name_Artifacts_In_Exec_Dir then
+
+ -- Attribute Artifacts_In_Exec_Dir: the list of file
+ -- names to be cleaned in the exec dir of the main
+ -- project.
+
+ List := Attribute.Value.Values;
+
+ if List /= Nil_String then
+ Put (Into_List =>
+ Project.Config.Artifacts_In_Exec_Dir,
+ From_List => List,
+ In_Tree => Data.Tree);
+ end if;
+
+ elsif Attribute.Name = Name_Artifacts_In_Object_Dir then
+
+ -- Attribute Artifacts_In_Exec_Dir: the list of file
+ -- names to be cleaned in the object dir of every
+ -- project.
+
+ List := Attribute.Value.Values;
+
+ if List /= Nil_String then
+ Put (Into_List =>
+ Project.Config.Artifacts_In_Object_Dir,
+ From_List => List,
+ In_Tree => Data.Tree);
+ end if;
+ end if;
+ end if;
+
+ Attribute_Id := Attribute.Next;
+ end loop;
+ end Process_Clean;
+
procedure Process_Clean (Arrays : Array_Id) is
Current_Array_Id : Array_Id;
Current_Array : Array_Data;
-- Process attributes of package Clean
+ Process_Clean (Element.Decl.Attributes);
Process_Clean (Element.Decl.Arrays);
when Name_Compiler =>
Auto_Init_Supported : Boolean := False;
-- True if automatic initialisation is supported for shared stand-alone
-- libraries.
+
+ -- Cleaning
+
+ Artifacts_In_Exec_Dir : Name_List_Index := No_Name_List;
+ -- List of regexp file names to be cleaned in the exec directory of the
+ -- main project.
+
+ Artifacts_In_Object_Dir : Name_List_Index := No_Name_List;
+ -- List of regexp file names to be cleaned in the object directory of
+ -- all projects.
+
end record;
Default_Project_Config : constant Project_Configuration :=
Lib_Version_Options => No_Name_List,
Symbolic_Link_Supported => False,
Lib_Maj_Min_Id_Supported => False,
- Auto_Init_Supported => False);
+ Auto_Init_Supported => False,
+ Artifacts_In_Exec_Dir => No_Name_List,
+ Artifacts_In_Object_Dir => No_Name_List);
-------------------------
-- Aggregated projects --
-- Additional reserved words and identifiers used in GNAT Project Files
-- Note that Name_External is already previously declared.
- -- The names with the -- GB annotation are only used in gprbuild.
+ -- Names with a -- GB annotation are only used in gprbuild or gprclean
Name_Active : constant Name_Id := N + $;
Name_Aggregate : constant Name_Id := N + $;
Name_Archive_Builder_Append_Option : constant Name_Id := N + $;
Name_Archive_Indexer : constant Name_Id := N + $;
Name_Archive_Suffix : constant Name_Id := N + $;
+ Name_Artifacts_In_Exec_Dir : constant Name_Id := N + $; -- GB
+ Name_Artifacts_In_Object_Dir : constant Name_Id := N + $; -- GB
Name_Binder : constant Name_Id := N + $;
Name_Body_Suffix : constant Name_Id := N + $;
Name_Builder : constant Name_Id := N + $;