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
This commit is contained in:
Colin Cross
2017-08-31 16:45:16 -07:00
parent 5aac362949
commit 2c429dc7d4
3 changed files with 37 additions and 17 deletions

View File

@@ -29,6 +29,9 @@ func (library *Library) AndroidMk() android.AndroidMkData {
Extra: []android.AndroidMkExtraFunc{
func(w io.Writer, outputFile android.Path) {
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
if library.properties.Installable != nil && *library.properties.Installable == false {
fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true")
}
},
},
}
@@ -41,6 +44,7 @@ func (prebuilt *Import) AndroidMk() android.AndroidMkData {
Extra: []android.AndroidMkExtraFunc{
func(w io.Writer, outputFile android.Path) {
fmt.Fprintln(w, "LOCAL_MODULE_SUFFIX := .jar")
fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true")
},
},
}