diff options
author | Liz Kammer <eakammer@google.com> | 2022-02-01 23:42:42 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-02-01 23:42:42 +0000 |
commit | 0828389bd82ff19169d87593a32a03f538e80271 (patch) | |
tree | 733ec036b57d20f451f68c05fc01fb2e6a129898 | |
parent | 883438b5aac44d48e77a91a6a5b0c6834325bdb3 (diff) | |
parent | f403f96c3a4867dc68d0aef75bba3fb1ce9d6733 (diff) | |
download | libxml2-0828389bd82ff19169d87593a32a03f538e80271.tar.gz |
Merge "Refactor genrules to explicitly list inputs" am: 63686df8cf am: 9ee29ca3ec am: 23a1a39530 am: f403f96c3a
Original change: https://android-review.googlesource.com/c/platform/external/libxml2/+/1966646
Change-Id: Ie9016981a488213de8ce9fdbab8e1fea36f5181b
-rw-r--r-- | Android.bp | 74 |
1 files changed, 28 insertions, 46 deletions
@@ -243,18 +243,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", @@ -438,34 +434,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", @@ -735,18 +719,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", |