Commit 59b6e576 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Support relative paths in DataView.aadl

parent e9e0631b
......@@ -552,6 +552,8 @@ package body TASTE.AADL_Parser is
if Part.Has_Value and then Part.Unsafe_Just.Name
/= Partition.Deployment_Partition.Name
then
-- CHECKME: if the key is already present,
-- this will fail (test-tsp1).
Partition.Out_Ports.Insert
(Key => To_String (Out_Port.RI.Name),
New_Item => (Port_Name => Out_Port.RI.Name,
......
......@@ -90,12 +90,16 @@ package body TASTE.Data_View is
begin
if File_Ref = ASN1_File_Maps.No_Element then
declare
New_File : ASN1_File;
New_Module : ASN1_Module;
New_File : ASN1_File;
New_Module : ASN1_Module;
Relative_Path : Unbounded_String := US (Filename);
begin
New_Module.Name := US (Module);
New_Module.Types := (Empty_Vector & Sort);
New_File.Path := US (Filename);
if Filename (Filename'First) /= '/' then
Relative_Path := "../" & Relative_Path;
end if;
New_File.Path := Relative_Path;
New_File.Modules.Insert (Module, New_Module);
Files.Insert (Filename, New_File);
end;
......@@ -128,9 +132,11 @@ package body TASTE.Data_View is
procedure Check_Files (DV : Taste_Data_View) is
Success : Boolean := True;
begin
for Each of DV.ASN1_Files loop
if not Ada.Directories.Exists (To_String (Each.Path)) then
Put_Error ("ASN.1 File not found: " & To_String (Each.Path));
for Idx in DV.ASN1_Files.Iterate loop
-- The Key of the map contains the path as found in the dataview
if not Ada.Directories.Exists (ASN1_File_Maps.Key (Idx))
then
Put_Error ("ASN.1 File not found: " & ASN1_File_Maps.Key (Idx));
Success := False;
end if;
end loop;
......
Markdown is supported
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