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

Allow skeletons templates to specify custom output folder

parent 0db5c1b0
......@@ -3,12 +3,14 @@ with Ada.Characters.Handling,
Ada.Containers.Ordered_Sets,
Ada.Exceptions,
Ada.Directories,
GNAT.Directory_Operations, -- for Dir_Nme
TASTE.Parser_Utils;
use Ada.Characters.Handling,
Ada.Containers,
Ada.Exceptions,
Ada.Directories,
GNAT.Directory_Operations,
TASTE.Parser_Utils;
-- This package covers the generation of code for all supported languages
......@@ -287,7 +289,8 @@ package body TASTE.Backend.Code_Generators is
others => False);
-- File_Tmpl: to get the output filename from user template
File_Tmpl : constant Translate_Set :=
+Assoc ("Name", Each.Name);
+Assoc ("Name", Each.Name)
& Assoc ("Language", Language);
-- Base output folder where code is generated
-- e.g. output/Ada/src/
Output_Lang : constant String := Output_Base
......@@ -374,6 +377,11 @@ package body TASTE.Backend.Code_Generators is
Document_Template
(Templates_Skeletons_Sub_Trigger, Trig_Tmpl);
if Trigger then
-- Possibly create folder to generate the file
if File_Name /= "" then
Create_Path (Output_Dir & Dir_Separator
& Dir_Name (File_Name));
end if;
-- Output code and Makefile from this template folder
Process_Template (F => Each,
File_Name => File_Name,
......
-- *************************** kazoo *********************** --
-- (c) 2019 European Space Agency - maxime.perrotin@esa.int
-- LGPL license, see LICENSE file
-- (c) 2020 European Space Agency - maxime.perrotin@esa.int
with Ada.Directories,
Ada.IO_Exceptions,
Ada.Exceptions,
Ada.Characters.Latin_1,
-- Ada.Strings.Fixed,
GNAT.Directory_Operations, -- Contains Dir_Name
GNAT.Directory_Operations, -- Contains Dir_Name
TASTE.Backend;
use Ada.Directories,
......
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