Get NDK python script tests running.
Imports weren't working in tests because the package had been created.
The Python "binaries" built by Soong don't seem to take their own
pkg_path into account, so I split the separate pieces of code here out
into their own packages.
Note that the ndk_api_coverage_parser tests do not actually pass
before or after this change (seems like it might be a
non-deterministic ordering issue in the attributes of the generated
output?), but they can at least be run now.
Test: pytest ndkstubgen
Test: pytest symbolfile
Test: pytest ndk_api_coverage_parser
Test: out/host/linux-x86/nativetest64/test_ndkstubgen/test_ndkstubgen
Test: out/host/linux-x86/nativetest64/test_symbolfile/test_symbolfile
Test: out/host/linux-x86/nativetest64/test_ndk_api_coverage_parser/test_ndk_api_coverage_parser
Bug: None
Change-Id: I2ac22f7ced7566e4808070f2f72fd04355846e0b
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index 6299b00..4578fd3 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -26,17 +26,16 @@
)
func init() {
+ pctx.HostBinToolVariable("ndkStubGenerator", "ndkstubgen")
pctx.HostBinToolVariable("ndk_api_coverage_parser", "ndk_api_coverage_parser")
}
var (
- toolPath = pctx.SourcePathVariable("toolPath", "build/soong/cc/scriptlib/gen_stub_libs.py")
-
genStubSrc = pctx.AndroidStaticRule("genStubSrc",
blueprint.RuleParams{
- Command: "$toolPath --arch $arch --api $apiLevel --api-map " +
- "$apiMap $flags $in $out",
- CommandDeps: []string{"$toolPath"},
+ Command: "$ndkStubGenerator --arch $arch --api $apiLevel " +
+ "--api-map $apiMap $flags $in $out",
+ CommandDeps: []string{"$ndkStubGenerator"},
}, "arch", "apiLevel", "apiMap", "flags")
parseNdkApiRule = pctx.AndroidStaticRule("parseNdkApiRule",
@@ -78,9 +77,9 @@
// https://github.com/android-ndk/ndk/issues/265.
Unversioned_until *string
- // Private property for use by the mutator that splits per-API level.
- // can be one of <number:sdk_version> or <codename> or "current"
- // passed to "gen_stub_libs.py" as it is
+ // Private property for use by the mutator that splits per-API level. Can be
+ // one of <number:sdk_version> or <codename> or "current" passed to
+ // "ndkstubgen.py" as it is
ApiLevel string `blueprint:"mutated"`
// True if this API is not yet ready to be shipped in the NDK. It will be