From b9b6c8e237b1786d8590b35b721c6b9be89ca8fd Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 11 Dec 2022 18:40:30 -0600 Subject: [PATCH] Feature: Add 'import' Object to fakefile and settings specifications. This is important for building complex project structures and reducing the code redundancy. To keep the logic and design simple, recursion is not allowed. One can now create a base settings file that is imported by other settings files. The same is true for fakefile files. --- level_3/fake/documents/fakefile.txt | 9 +++++++++ level_3/fake/documents/settings.txt | 10 ++++++++++ level_3/fake/specifications/fakefile.txt | 1 + level_3/fake/specifications/settings.txt | 1 + 4 files changed, 21 insertions(+) diff --git a/level_3/fake/documents/fakefile.txt b/level_3/fake/documents/fakefile.txt index 6f8a343..b9f1265 100644 --- a/level_3/fake/documents/fakefile.txt +++ b/level_3/fake/documents/fakefile.txt @@ -54,6 +54,15 @@ Fakefile Documentation: The return code for programs can still be retrieved through using the reserved IKI variable code:"return". + - code:"import"\: + Load this bold:"fakefile". + The code:"settings" section data from the imported bold:"fakefile" is treated as if it were appended to the end of the current bold:"fakefile" code:"setting" section. + Each section in the imported bole:"fakefile" is treated as if it were appended to either the end of a matching section, if found, or appended at the end of the bold:"fakefile", if no matches are found. + This a non-recursive operation and the imported file itself cannot perform an import. + Relative paths are relative to the importing file. + Absolute paths that start with "./" are relative to the project root rather than the importing file. + Absolute paths that start with "/" are treated normally. + - code:"indexer"\: This represents the name of the indexer program to use, such as code:"ar". An indexer is often called a linker. diff --git a/level_3/fake/documents/settings.txt b/level_3/fake/documents/settings.txt index c3e94ec..6c2cdde 100644 --- a/level_3/fake/documents/settings.txt +++ b/level_3/fake/documents/settings.txt @@ -346,6 +346,16 @@ Settings Documentation: This defaults to code:"yes". + - code:"import"\: + Load this bold:"settings" file at this point in the bold:"settings" file. + This can be an absolute or a relative path. + This is intended to reduce repition and likely should be placed at the top of the bold:"settings" file. + This a non-recursive operation and the imported file itself cannot perform an import. + Loaded values are processed as if they are in the file at the spot where the import setting is specified. + Relative paths are relative to the importing file. + Absolute paths that start with "./" are relative to the project root rather than the importing file. + Absolute paths that start with "/" are treated normally. + - code:"modes"\: A collection of available build modes. Build modes provide custom variants of the build process where certain bold:"settings" are appended onto others. diff --git a/level_3/fake/specifications/fakefile.txt b/level_3/fake/specifications/fakefile.txt index fee2cec..b62b843 100644 --- a/level_3/fake/specifications/fakefile.txt +++ b/level_3/fake/specifications/fakefile.txt @@ -40,6 +40,7 @@ Fakefile Specification: - code:"define": First Content represents variable name (case-sensitive), remaining Content represents the value. - code:"environment": Zero or more Content representing valid environment variable names (alpha-numeric with underscore, but cannot begin with a number). - code:"fail": Only one Content, which must be either code:"exit", code:"warn" or code:"ignore" (quotes not required) (case-sensitive). + - code:"import": Only one Content, which must only be a valid filename. - code:"indexer": Only one Content, which must only be a valid filename. - code:"indexer_arguments: Zero or more arguments supported by the indexer specified in code:"build_indexer". - code:"load_build": Only one Content, which must be either code:"yes" or code:"no" (quotes not required) (case-sensitive). diff --git a/level_3/fake/specifications/settings.txt b/level_3/fake/specifications/settings.txt index a74d075..32f57d5 100644 --- a/level_3/fake/specifications/settings.txt +++ b/level_3/fake/specifications/settings.txt @@ -76,6 +76,7 @@ Settings Specification: - code:"flags_shared": Must only contain any number of parameters supported by the compiler specified in code:"build_compiler". - code:"flags_static": Must only contain any number of parameters supported by the compiler specified in code:"build_compiler". - code:"has_path_standard": Must only one of: code:"yes" or code:"no". + - code:"import": Only one Content, which must only be a valid filename. - code:"modes": Any valid word character, character:'-', or character:'+'. - code:"modes_default": May only be a single complete Content word defined in code:"modes" Object. - code:"path_headers": Must be a single valid path. -- 1.8.3.1