diff options
author | Liz Kammer <eakammer@google.com> | 2022-02-01 23:06:40 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-02-01 23:06:40 +0000 |
commit | 23a1a395300c33e8bb1855b5c305f332924fd71d (patch) | |
tree | 18bac194ca18614e98db4344514ad50c66a3a9de | |
parent | ea460af1cdee8a20b045297cc784ecde6f926565 (diff) | |
parent | 9ee29ca3eced004b7edabb2b5f8ad1b18cd5ca8f (diff) | |
download | libxml2-23a1a395300c33e8bb1855b5c305f332924fd71d.tar.gz |
Merge "Refactor genrules to explicitly list inputs" am: 63686df8cf am: 9ee29ca3ec
Original change: https://android-review.googlesource.com/c/platform/external/libxml2/+/1966646
Change-Id: I31a72049bfe798fccb11530ef79d19fe8636f653
-rw-r--r-- | Android.bp | 74 |
1 files changed, 28 insertions, 46 deletions
@@ -242,18 +242,14 @@ genrule { name: "libxml2_schema_fuzz_corpus", tools: ["libxml2_genseed"], srcs: [ - "test/schemas", + "test/schemas/*.xsd", ], // The genseed tool only writes under its current directory. - // Soong does not run the tool from within the jail, so - // the shell must first 'cd' to the right path. However, - // then the location of the tool is lost, as $(location) gives - // a relative path. - cmd: "mkdir -p $(genDir)/fuzz/seed/schema && " + - "TOP_DIR=$$(pwd) && " + - "cd $(genDir)/fuzz && " + - "$${TOP_DIR}/$(location libxml2_genseed) schema " + - "$${TOP_DIR}/$(location test/schemas)/*.xsd", + // We move outputs to the correct location after generation.. + cmd: "mkdir -p seed/schema && " + + "$(location libxml2_genseed) schema $(in) && " + + "mkdir -p $(genDir)/fuzz/seed/schema && " + + "mv -f seed/schema/* $(genDir)/fuzz/seed/schema", out: [ "fuzz/seed/schema/570702_0.xsd", "fuzz/seed/schema/579746_0.xsd", @@ -437,34 +433,22 @@ genrule { name: "libxml2_xml_fuzz_corpus", tools: ["libxml2_genseed"], srcs: [ - "test", - "test/errors", - "test/errors10", - "test/namespaces", - "test/valid", - "test/VC", - "test/VCM", - "test/XInclude/docs", - "test/xmlid", + "test/*", + "test/errors/*.xml", + "test/errors10/*.xml", + "test/namespaces/*", + "test/valid/*.xml", + "test/VC/*", + "test/VCM/*", + "test/XInclude/docs/*", + "test/xmlid/*", ], // The genseed tool only writes under its current directory. - // Soong does not run the tool from within the jail, so - // the shell must first 'cd' to the right path. However, - // then the location of the tool is lost, as $(location) gives - // a relative path. - cmd: "mkdir -p $(genDir)/fuzz/seed/xml && " + - "TOP_DIR=$$(pwd) && " + - "cd $(genDir)/fuzz && " + - "$${TOP_DIR}/$(location libxml2_genseed) xml " + - "$${TOP_DIR}/$(location test)/* " + - "$${TOP_DIR}/$(location test/errors)/*.xml " + - "$${TOP_DIR}/$(location test/errors10)/*.xml " + - "$${TOP_DIR}/$(location test/namespaces)/* " + - "$${TOP_DIR}/$(location test/valid)/*.xml " + - "$${TOP_DIR}/$(location test/VC)/* " + - "$${TOP_DIR}/$(location test/VCM)/* " + - "$${TOP_DIR}/$(location test/XInclude/docs)/* " + - "$${TOP_DIR}/$(location test/xmlid)/*", + // We move outputs to the correct location after generation.. + cmd: "mkdir -p seed/xml && " + + "$(location libxml2_genseed) xml $(in) &&" + + "mkdir -p $(genDir)/fuzz/seed/xml && " + + "mv seed/xml/* $(genDir)/fuzz/seed/xml", out: [ "fuzz/seed/xml/127772.xml", "fuzz/seed/xml/21.xml", @@ -734,18 +718,16 @@ genrule { name: "libxml2_xpath_fuzz_corpus", tools: ["libxml2_genseed"], srcs: [ - "test/XPath", + "test/XPath/*/*", ], // The genseed tool only writes under its current directory. - // Soong does not run the tool from within the jail, so - // the shell must first 'cd' to the right path. However, - // then the location of the tool is lost, as $(location) gives - // a relative path. - cmd: "mkdir -p $(genDir)/fuzz/seed/xpath && " + - "TOP_DIR=$$(pwd) && " + - "cd $(genDir)/fuzz && " + - "$${TOP_DIR}/$(location libxml2_genseed) xpath " + - "$${TOP_DIR}/$(location test/XPath)", + // We move outputs to the correct location after generation.. + cmd: "inputs=( $(in) ) && " + + "inputDir=$$(dirname $$(dirname $${inputs})) && " + + "mkdir -p seed/xpath && " + + "$(location libxml2_genseed) xpath $${inputDir} && " + + "mkdir -p $(genDir)/fuzz/seed/xpath && " + + "mv seed/xpath/* $(genDir)/fuzz/seed/xpath", out: [ "fuzz/seed/xpath/chapters-1", "fuzz/seed/xpath/chapters-10", |