diff options
Diffstat (limited to 'java/androidmk.go')
| -rw-r--r-- | java/androidmk.go | 69 |
1 files changed, 19 insertions, 50 deletions
diff --git a/java/androidmk.go b/java/androidmk.go index bc327cf68..65c44a329 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -121,15 +121,14 @@ func (library *Library) AndroidMkEntries() []android.AndroidMkEntries { entries.SetPath("LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR", library.jacocoReportClassesFile) } - entries.AddStrings("LOCAL_EXPORT_SDK_LIBRARIES", library.exportedSdkLibs...) + entries.AddStrings("LOCAL_EXPORT_SDK_LIBRARIES", android.SortedStringKeys(library.exportedSdkLibs)...) if len(library.additionalCheckedModules) != 0 { entries.AddStrings("LOCAL_ADDITIONAL_CHECKED_MODULE", library.additionalCheckedModules.Strings()...) } - if library.dexer.proguardDictionary.Valid() { - entries.SetPath("LOCAL_SOONG_PROGUARD_DICT", library.dexer.proguardDictionary.Path()) - } + entries.SetOptionalPath("LOCAL_SOONG_PROGUARD_DICT", library.dexer.proguardDictionary) + entries.SetOptionalPath("LOCAL_SOONG_PROGUARD_USAGE_ZIP", library.dexer.proguardUsageZip) entries.SetString("LOCAL_MODULE_STEM", library.Stem()) entries.SetOptionalPaths("LOCAL_SOONG_LINT_REPORTS", library.linter.reports) @@ -162,15 +161,23 @@ func (j *Test) AndroidMkEntries() []android.AndroidMkEntries { if j.testConfig != nil { entries.SetPath("LOCAL_FULL_TEST_CONFIG", j.testConfig) } + androidMkWriteExtraTestConfigs(j.extraTestConfigs, entries) androidMkWriteTestData(j.data, entries) if !BoolDefault(j.testProperties.Auto_gen_config, true) { entries.SetString("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", "true") } + entries.AddStrings("LOCAL_TEST_MAINLINE_MODULES", j.testProperties.Test_mainline_modules...) }) return entriesList } +func androidMkWriteExtraTestConfigs(extraTestConfigs android.Paths, entries *android.AndroidMkEntries) { + if len(extraTestConfigs) > 0 { + entries.AddStrings("LOCAL_EXTRA_FULL_TEST_CONFIGS", extraTestConfigs.Strings()...) + } +} + func (j *TestHelperLibrary) AndroidMkEntries() []android.AndroidMkEntries { entriesList := j.Library.AndroidMkEntries() entries := &entriesList[0] @@ -196,7 +203,7 @@ func (prebuilt *Import) AndroidMkEntries() []android.AndroidMkEntries { entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", !Bool(prebuilt.properties.Installable)) entries.SetPath("LOCAL_SOONG_HEADER_JAR", prebuilt.combinedClasspathFile) entries.SetPath("LOCAL_SOONG_CLASSES_JAR", prebuilt.combinedClasspathFile) - entries.SetString("LOCAL_SDK_VERSION", prebuilt.sdkVersion().raw) + entries.SetString("LOCAL_SDK_VERSION", prebuilt.makeSdkVersion()) entries.SetString("LOCAL_MODULE_STEM", prebuilt.Stem()) }, }, @@ -332,9 +339,8 @@ func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries { if app.jacocoReportClassesFile != nil { entries.SetPath("LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR", app.jacocoReportClassesFile) } - if app.dexer.proguardDictionary.Valid() { - entries.SetPath("LOCAL_SOONG_PROGUARD_DICT", app.dexer.proguardDictionary.Path()) - } + entries.SetOptionalPath("LOCAL_SOONG_PROGUARD_DICT", app.dexer.proguardDictionary) + entries.SetOptionalPath("LOCAL_SOONG_PROGUARD_USAGE_ZIP", app.dexer.proguardUsageZip) if app.Name() == "framework-res" { entries.SetString("LOCAL_MODULE_PATH", "$(TARGET_OUT_JAVA_LIBRARIES)") @@ -433,7 +439,9 @@ func (a *AndroidTest) AndroidMkEntries() []android.AndroidMkEntries { if a.testConfig != nil { entries.SetPath("LOCAL_FULL_TEST_CONFIG", a.testConfig) } + androidMkWriteExtraTestConfigs(a.extraTestConfigs, entries) androidMkWriteTestData(a.data, entries) + entries.AddStrings("LOCAL_TEST_MAINLINE_MODULES", a.testProperties.Test_mainline_modules...) }) return entriesList @@ -501,53 +509,14 @@ func (jd *Javadoc) AndroidMkEntries() []android.AndroidMkEntries { func (ddoc *Droiddoc) AndroidMkEntries() []android.AndroidMkEntries { return []android.AndroidMkEntries{android.AndroidMkEntries{ Class: "JAVA_LIBRARIES", - OutputFile: android.OptionalPathForPath(ddoc.stubsSrcJar), + OutputFile: android.OptionalPathForPath(ddoc.Javadoc.docZip), Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk", ExtraEntries: []android.AndroidMkExtraEntriesFunc{ func(entries *android.AndroidMkEntries) { - if BoolDefault(ddoc.Javadoc.properties.Installable, true) && ddoc.Javadoc.docZip != nil { + if ddoc.Javadoc.docZip != nil { entries.SetPath("LOCAL_DROIDDOC_DOC_ZIP", ddoc.Javadoc.docZip) } - if ddoc.Javadoc.stubsSrcJar != nil { - entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", ddoc.Javadoc.stubsSrcJar) - } - }, - }, - ExtraFooters: []android.AndroidMkExtraFootersFunc{ - func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { - if ddoc.checkCurrentApiTimestamp != nil { - fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-check-current-api") - fmt.Fprintln(w, ddoc.Name()+"-check-current-api:", - ddoc.checkCurrentApiTimestamp.String()) - - fmt.Fprintln(w, ".PHONY: checkapi") - fmt.Fprintln(w, "checkapi:", - ddoc.checkCurrentApiTimestamp.String()) - - fmt.Fprintln(w, ".PHONY: droidcore") - fmt.Fprintln(w, "droidcore: checkapi") - } - if ddoc.updateCurrentApiTimestamp != nil { - fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-update-current-api") - fmt.Fprintln(w, ddoc.Name()+"-update-current-api:", - ddoc.updateCurrentApiTimestamp.String()) - - fmt.Fprintln(w, ".PHONY: update-api") - fmt.Fprintln(w, "update-api:", - ddoc.updateCurrentApiTimestamp.String()) - } - if ddoc.checkLastReleasedApiTimestamp != nil { - fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-check-last-released-api") - fmt.Fprintln(w, ddoc.Name()+"-check-last-released-api:", - ddoc.checkLastReleasedApiTimestamp.String()) - - fmt.Fprintln(w, ".PHONY: checkapi") - fmt.Fprintln(w, "checkapi:", - ddoc.checkLastReleasedApiTimestamp.String()) - - fmt.Fprintln(w, ".PHONY: droidcore") - fmt.Fprintln(w, "droidcore: checkapi") - } + entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", !BoolDefault(ddoc.Javadoc.properties.Installable, true)) }, }, }} |