diff options
author | Colin Cross <ccross@android.com> | 2017-08-31 16:45:16 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-09-05 13:48:23 -0700 |
commit | 2c429dc7d4d4e8efdff4dadcd27c1c540276cf41 (patch) | |
tree | fb14cc5f6a13fc4aca388daa54c40798ade58ac6 /androidmk | |
parent | 5aac3629493e4df7a1e7d2b594021c380d25141f (diff) | |
download | build_soong-2c429dc7d4d4e8efdff4dadcd27c1c540276cf41.tar.gz build_soong-2c429dc7d4d4e8efdff4dadcd27c1c540276cf41.tar.bz2 build_soong-2c429dc7d4d4e8efdff4dadcd27c1c540276cf41.zip |
Support non-installable java libraries
Some java libraries will never be installed, support an
installable: false property and export it back to make as
LOCAL_UNINSTALLABLE_MODULE := true.
Test: m -j checkbuild, manually inspect out/soong/Android*.mk
Change-Id: I825ec897648c82fb7323da7df3539c9aaa6bcfce
Diffstat (limited to 'androidmk')
-rw-r--r-- | androidmk/cmd/androidmk/android.go | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go index 50ba91ba..caf594af 100644 --- a/androidmk/cmd/androidmk/android.go +++ b/androidmk/cmd/androidmk/android.go @@ -37,6 +37,7 @@ var rewriteProperties = map[string](func(variableAssignmentContext) error){ "LOCAL_SANITIZE": sanitize(""), "LOCAL_SANITIZE_DIAG": sanitize("diag."), "LOCAL_CFLAGS": cflags, + "LOCAL_UNINSTALLABLE_MODULE": invert("installable"), // composite functions "LOCAL_MODULE_TAGS": includeVariableIf(bpVariable{"tags", bpparser.ListType}, not(valueDumpEquals("optional"))), @@ -117,19 +118,18 @@ func init() { addStandardProperties(bpparser.BoolType, map[string]string{ // Bool properties - "LOCAL_IS_HOST_MODULE": "host", - "LOCAL_CLANG": "clang", - "LOCAL_FORCE_STATIC_EXECUTABLE": "static_executable", - "LOCAL_NATIVE_COVERAGE": "native_coverage", - "LOCAL_NO_CRT": "nocrt", - "LOCAL_ALLOW_UNDEFINED_SYMBOLS": "allow_undefined_symbols", - "LOCAL_RTTI_FLAG": "rtti", - "LOCAL_NO_STANDARD_LIBRARIES": "no_standard_libs", - "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations", - "LOCAL_TIDY": "tidy", - "LOCAL_PROPRIETARY_MODULE": "proprietary", - "LOCAL_VENDOR_MODULE": "vendor", - + "LOCAL_IS_HOST_MODULE": "host", + "LOCAL_CLANG": "clang", + "LOCAL_FORCE_STATIC_EXECUTABLE": "static_executable", + "LOCAL_NATIVE_COVERAGE": "native_coverage", + "LOCAL_NO_CRT": "nocrt", + "LOCAL_ALLOW_UNDEFINED_SYMBOLS": "allow_undefined_symbols", + "LOCAL_RTTI_FLAG": "rtti", + "LOCAL_NO_STANDARD_LIBRARIES": "no_standard_libs", + "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations", + "LOCAL_TIDY": "tidy", + "LOCAL_PROPRIETARY_MODULE": "proprietary", + "LOCAL_VENDOR_MODULE": "vendor", "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources", }) } @@ -528,6 +528,19 @@ func cflags(ctx variableAssignmentContext) error { return includeVariableNow(bpVariable{"cflags", bpparser.ListType}, ctx) } +func invert(name string) func(ctx variableAssignmentContext) error { + return func(ctx variableAssignmentContext) error { + val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.BoolType) + if err != nil { + return err + } + + val.(*bpparser.Bool).Value = !val.(*bpparser.Bool).Value + + return setVariable(ctx.file, ctx.append, ctx.prefix, name, val, true) + } +} + // given a conditional, returns a function that will insert a variable assignment or not, based on the conditional func includeVariableIf(bpVar bpVariable, conditional func(ctx variableAssignmentContext) bool) func(ctx variableAssignmentContext) error { return func(ctx variableAssignmentContext) error { |