diff options
-rw-r--r-- | doc/tutorial/third-party-software.org | 8 | ||||
-rw-r--r-- | etc/import.prebuilt/TARGETS.gsl | 6 | ||||
-rw-r--r-- | etc/import.prebuilt/TARGETS.json | 5 | ||||
-rw-r--r-- | etc/import/TARGETS.gsl | 6 | ||||
-rw-r--r-- | etc/import/TARGETS.json | 4 | ||||
-rw-r--r-- | etc/import/include/CLI/TARGETS.cli11 | 6 | ||||
-rw-r--r-- | etc/import/include/fmt/TARGETS.fmt | 4 | ||||
-rw-r--r-- | etc/import/include/git2/TARGETS.git2 | 6 | ||||
-rw-r--r-- | rules/CC/RULES | 59 | ||||
-rw-r--r-- | test/end-to-end/target-cache/test-data-artifacts-sync/greetlib/greet/include/TARGETS | 4 |
10 files changed, 23 insertions, 85 deletions
diff --git a/doc/tutorial/third-party-software.org b/doc/tutorial/third-party-software.org index e088bc4b..7bce1c48 100644 --- a/doc/tutorial/third-party-software.org +++ b/doc/tutorial/third-party-software.org @@ -55,7 +55,7 @@ $ mkdir -p fmt-layer/src #+END_SRC The directory ~include/fmt~ contains only header files. As we want all files in -this directory to be included in the ~"header directory"~ target, we can safely +this directory to be included in the ~"hdrs"~ target, we can safely use the explicit ~TREE~ reference[fn:1], which collects, in a single artifact (describing a directory) /all/ directory contents from ~"."~ of the workspace root. Note that the ~TARGETS~ file is only part of @@ -74,15 +74,15 @@ references from the current module. #+SRCNAME: fmt-layer/include/fmt/TARGETS #+BEGIN_SRC js { "hdrs": - { "type": ["@", "rules", "CC", "header directory"] - , "hdrs": [["TREE", null, "."]] + { "type": ["@", "rules", "data", "staged"] + , "srcs": [["TREE", null, "."]] , "stage": ["fmt"] } } #+END_SRC The actual library target is defined in the directory ~src~. For the public -headers, it refers to the previously created header directory via its +headers, it refers to the previously created ~"hdrs"~ target via its fully-qualified target name (~["include/fmt", "hdrs"]~). Source files are the two local files ~format.cc~, and ~os.cc~. The final target description in ~src/TARGETS~ will look like this: diff --git a/etc/import.prebuilt/TARGETS.gsl b/etc/import.prebuilt/TARGETS.gsl index df06ea7e..b8b6798f 100644 --- a/etc/import.prebuilt/TARGETS.gsl +++ b/etc/import.prebuilt/TARGETS.gsl @@ -1,8 +1,8 @@ { "gsl-lite": {"type": ["@", "rules", "CC", "library"], "hdrs": ["gsl-lite hdrs"]} , "gsl-lite hdrs": - { "type": ["@", "rules", "CC", "header directory"] - , "hdrs": ["gsl", "gsl-lite.h", "gsl-lite.hpp", "gsl-lite-vc6.hpp"] - , "stage": ["gsl-lite"] + { "type": "tree" + , "name": "gsl-lite" + , "deps": ["gsl", "gsl-lite.h", "gsl-lite.hpp", "gsl-lite-vc6.hpp"] } } diff --git a/etc/import.prebuilt/TARGETS.json b/etc/import.prebuilt/TARGETS.json index df94fa83..fcb2936b 100644 --- a/etc/import.prebuilt/TARGETS.json +++ b/etc/import.prebuilt/TARGETS.json @@ -1,7 +1,4 @@ { "json": {"type": ["@", "rules", "CC", "library"], "hdrs": ["json headers"]} , "json headers": - { "type": ["@", "rules", "CC", "header directory"] - , "stage": ["nlohmann"] - , "hdrs": [["TREE", null, "."]] - } + {"type": "tree", "name": "nlohmann", "deps": [["TREE", null, "."]]} } diff --git a/etc/import/TARGETS.gsl b/etc/import/TARGETS.gsl index df06ea7e..b8b6798f 100644 --- a/etc/import/TARGETS.gsl +++ b/etc/import/TARGETS.gsl @@ -1,8 +1,8 @@ { "gsl-lite": {"type": ["@", "rules", "CC", "library"], "hdrs": ["gsl-lite hdrs"]} , "gsl-lite hdrs": - { "type": ["@", "rules", "CC", "header directory"] - , "hdrs": ["gsl", "gsl-lite.h", "gsl-lite.hpp", "gsl-lite-vc6.hpp"] - , "stage": ["gsl-lite"] + { "type": "tree" + , "name": "gsl-lite" + , "deps": ["gsl", "gsl-lite.h", "gsl-lite.hpp", "gsl-lite-vc6.hpp"] } } diff --git a/etc/import/TARGETS.json b/etc/import/TARGETS.json index df94fa83..f1aea866 100644 --- a/etc/import/TARGETS.json +++ b/etc/import/TARGETS.json @@ -1,7 +1,7 @@ { "json": {"type": ["@", "rules", "CC", "library"], "hdrs": ["json headers"]} , "json headers": - { "type": ["@", "rules", "CC", "header directory"] + { "type": ["@", "rules", "data", "staged"] , "stage": ["nlohmann"] - , "hdrs": [["TREE", null, "."]] + , "srcs": [["TREE", null, "."]] } } diff --git a/etc/import/include/CLI/TARGETS.cli11 b/etc/import/include/CLI/TARGETS.cli11 index d9764847..b769de60 100644 --- a/etc/import/include/CLI/TARGETS.cli11 +++ b/etc/import/include/CLI/TARGETS.cli11 @@ -1,7 +1,7 @@ { "cli11_headers": - { "type": ["@", "rules", "CC", "header directory"] - , "stage": ["CLI"] - , "hdrs": + { "type": "tree" + , "name": "CLI" + , "deps": [ "Option.hpp" , "Split.hpp" , "Formatter.hpp" diff --git a/etc/import/include/fmt/TARGETS.fmt b/etc/import/include/fmt/TARGETS.fmt index 72ea6d52..37f21a15 100644 --- a/etc/import/include/fmt/TARGETS.fmt +++ b/etc/import/include/fmt/TARGETS.fmt @@ -1,6 +1,6 @@ { "hdrs": - { "type": ["@", "rules", "CC", "header directory"] + { "type": ["@", "rules", "data", "staged"] , "stage": ["fmt"] - , "hdrs": [["TREE", null, "."]] + , "srcs": [["TREE", null, "."]] } } diff --git a/etc/import/include/git2/TARGETS.git2 b/etc/import/include/git2/TARGETS.git2 index 84eb50c3..a9dad131 100644 --- a/etc/import/include/git2/TARGETS.git2 +++ b/etc/import/include/git2/TARGETS.git2 @@ -150,9 +150,9 @@ , "patch-part": ["a", "include", "git2", "sys", "repository.h"] } , "TREE": - { "type": ["@", "rules", "CC", "header directory"] - , "stage": ["git2"] - , "hdrs": + { "type": "tree" + , "name": "git2" + , "deps": [ "annotated_commit.h" , "apply.h" , "attr.h" diff --git a/rules/CC/RULES b/rules/CC/RULES index ab01a50f..9e599e19 100644 --- a/rules/CC/RULES +++ b/rules/CC/RULES @@ -109,65 +109,6 @@ } } } -, "header directory": - { "doc": - [ "A directory of header files." - , "" - , "Define a directory of header files that belong together and are staged" - , "in such a way that no other target (used together with this target) will" - , "have to put files in this directory. The typical use case is a library" - , "libfoo that expects all headers to be included as #include \"foo/bar.h\"." - , "In this case, one would define a header direcotry for \"foo\"." - , "" - , "Technically, a tree is created from the given files and staged to the" - , "specified location. Since trees are opaque, the directory name becomes" - , "essentially owned by target. In this way, staging conflicts can be" - , "avoided by detecting them early and not only once a file with the same" - , "name is added to the staging location. Also, as only a tree identifier" - , "has to be passed around, such a directory can be handled more" - , "efficiently by the tool." - ] - , "target_fields": ["hdrs"] - , "string_fields": ["stage"] - , "field_doc": - { "hdrs": ["The header files to be put into the header directory."] - , "stage": - [ "The location of the header directory." - , "Path segments are joined with \"/\"." - ] - } - , "artifacts_doc": ["The single tree artifact staged to the given location"] - , "runfiles_doc": ["Same as artifacts"] - , "imports": {"runfiles": ["./", "..", "field_runfiles"]} - , "expression": - { "type": "let*" - , "bindings": - [ [ "hdrs" - , { "type": "let*" - , "bindings": [["fieldname", "hdrs"]] - , "body": {"type": "CALL_EXPRESSION", "name": "runfiles"} - } - ] - , [ "stage" - , { "type": "join" - , "separator": "/" - , "$1": {"type": "FIELD", "name": "stage"} - } - ] - , [ "dir" - , { "type": "singleton_map" - , "key": {"type": "var", "name": "stage"} - , "value": {"type": "TREE", "$1": {"type": "var", "name": "hdrs"}} - } - ] - ] - , "body": - { "type": "RESULT" - , "artifacts": {"type": "var", "name": "dir"} - , "runfiles": {"type": "var", "name": "dir"} - } - } - } , "library": { "doc": ["A C++ libaray"] , "target_fields": diff --git a/test/end-to-end/target-cache/test-data-artifacts-sync/greetlib/greet/include/TARGETS b/test/end-to-end/target-cache/test-data-artifacts-sync/greetlib/greet/include/TARGETS index 6093f6f4..1574e83c 100644 --- a/test/end-to-end/target-cache/test-data-artifacts-sync/greetlib/greet/include/TARGETS +++ b/test/end-to-end/target-cache/test-data-artifacts-sync/greetlib/greet/include/TARGETS @@ -1,6 +1,6 @@ { "hdrs": - { "type": ["@", "rules", "CC", "header directory"] - , "hdrs": [["TREE", null, "."]] + { "type": ["@", "rules", "data", "staged"] + , "srcs": [["TREE", null, "."]] , "stage": ["greet"] } } |