2015-07-09 09:13:11 +08:00
|
|
|
// Copyright 2015 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package java
|
|
|
|
|
|
|
|
import (
|
2017-08-03 02:05:49 +08:00
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
|
2016-05-19 06:37:25 +08:00
|
|
|
"android/soong/android"
|
2015-07-09 09:13:11 +08:00
|
|
|
)
|
|
|
|
|
2019-12-11 16:27:07 +08:00
|
|
|
func (library *Library) AndroidMkEntriesHostDex() android.AndroidMkEntries {
|
|
|
|
hostDexNeeded := Bool(library.deviceProperties.Hostdex) && !library.Host()
|
|
|
|
if !library.IsForPlatform() {
|
2019-12-02 23:43:57 +08:00
|
|
|
// Don't emit hostdex modules from the APEX variants
|
2019-12-11 16:27:07 +08:00
|
|
|
hostDexNeeded = false
|
|
|
|
}
|
|
|
|
|
|
|
|
if hostDexNeeded {
|
|
|
|
var output android.Path
|
2019-01-15 06:13:51 +08:00
|
|
|
if library.dexJarFile != nil {
|
2019-12-11 16:27:07 +08:00
|
|
|
output = library.dexJarFile
|
2019-01-15 06:13:51 +08:00
|
|
|
} else {
|
2019-12-11 16:27:07 +08:00
|
|
|
output = library.implementationAndResourcesJar
|
2019-04-04 06:47:29 +08:00
|
|
|
}
|
2019-12-11 16:27:07 +08:00
|
|
|
return android.AndroidMkEntries{
|
|
|
|
Class: "JAVA_LIBRARIES",
|
|
|
|
SubName: "-hostdex",
|
|
|
|
OutputFile: android.OptionalPathForPath(output),
|
|
|
|
Required: library.deviceProperties.Target.Hostdex.Required,
|
|
|
|
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
|
|
|
entries.SetBool("LOCAL_IS_HOST_MODULE", true)
|
|
|
|
entries.SetPath("LOCAL_PREBUILT_MODULE_FILE", output)
|
|
|
|
if library.dexJarFile != nil {
|
|
|
|
entries.SetPath("LOCAL_SOONG_DEX_JAR", library.dexJarFile)
|
|
|
|
}
|
|
|
|
entries.SetPath("LOCAL_SOONG_HEADER_JAR", library.headerJarFile)
|
|
|
|
entries.SetPath("LOCAL_SOONG_CLASSES_JAR", library.implementationAndResourcesJar)
|
|
|
|
entries.SetString("LOCAL_MODULE_STEM", library.Stem()+"-hostdex")
|
|
|
|
},
|
|
|
|
},
|
2019-04-25 04:41:45 +08:00
|
|
|
}
|
2018-10-19 12:46:09 +08:00
|
|
|
}
|
2019-12-11 16:27:07 +08:00
|
|
|
return android.AndroidMkEntries{Disabled: true}
|
2018-10-19 12:46:09 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (library *Library) AndroidMkEntries() []android.AndroidMkEntries {
|
2019-12-11 16:27:07 +08:00
|
|
|
var entriesList []android.AndroidMkEntries
|
|
|
|
|
|
|
|
mainEntries := android.AndroidMkEntries{Disabled: true}
|
2019-12-02 23:43:57 +08:00
|
|
|
|
2019-12-11 16:27:07 +08:00
|
|
|
// For a java library built for an APEX, we don't need Make module
|
2019-12-02 23:43:57 +08:00
|
|
|
hideFromMake := !library.IsForPlatform()
|
|
|
|
// If not available for platform, don't emit to make.
|
|
|
|
if !library.ApexModuleBase.AvailableFor(android.AvailableToPlatform) {
|
|
|
|
hideFromMake = true
|
|
|
|
}
|
|
|
|
if !hideFromMake {
|
2019-12-11 16:27:07 +08:00
|
|
|
mainEntries = android.AndroidMkEntries{
|
|
|
|
Class: "JAVA_LIBRARIES",
|
2020-03-28 03:39:48 +08:00
|
|
|
DistFile: android.OptionalPathForPath(library.distFile),
|
2019-12-11 16:27:07 +08:00
|
|
|
OutputFile: android.OptionalPathForPath(library.outputFile),
|
|
|
|
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
|
|
|
if len(library.logtagsSrcs) > 0 {
|
|
|
|
var logtags []string
|
|
|
|
for _, l := range library.logtagsSrcs {
|
|
|
|
logtags = append(logtags, l.Rel())
|
|
|
|
}
|
|
|
|
entries.AddStrings("LOCAL_LOGTAGS_FILES", logtags...)
|
2017-12-08 07:28:59 +08:00
|
|
|
}
|
2019-12-11 16:27:07 +08:00
|
|
|
|
|
|
|
if library.installFile == nil {
|
|
|
|
entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", true)
|
|
|
|
}
|
|
|
|
if library.dexJarFile != nil {
|
|
|
|
entries.SetPath("LOCAL_SOONG_DEX_JAR", library.dexJarFile)
|
|
|
|
}
|
|
|
|
if len(library.dexpreopter.builtInstalled) > 0 {
|
|
|
|
entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", library.dexpreopter.builtInstalled)
|
|
|
|
}
|
Abstract sdk_version string using sdkSpec type
The value format that sdk_version (and min_sdk_version, etc.) can have
has consistently evolved and is quite complicated. Furthermore, with the
Mainline module effort, we are expected to have more sdk_versions like
'module-app-current', 'module-lib-current', etc.
The goal of this change is to abstract the various sdk versions, which
are currently represented in string and is parsed in various places,
into a type called sdkSpec, so that adding new sdk veresions becomes
easier than before.
The sdk_version string is now parsed in only one place 'SdkSpecFrom', in
which it is converted into the sdkSpec struct. The struct type provides
several methods that again converts sdkSpec into context-specific
information such as the effective version number, etc.
Bug: 146757305
Bug: 147879031
Test: m
Change-Id: I252f3706544f00ea71c61c23460f07561dd28ab0
2020-01-21 01:03:43 +08:00
|
|
|
entries.SetString("LOCAL_SDK_VERSION", library.sdkVersion().raw)
|
2019-12-11 16:27:07 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_CLASSES_JAR", library.implementationAndResourcesJar)
|
|
|
|
entries.SetPath("LOCAL_SOONG_HEADER_JAR", library.headerJarFile)
|
|
|
|
|
|
|
|
if library.jacocoReportClassesFile != nil {
|
|
|
|
entries.SetPath("LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR", library.jacocoReportClassesFile)
|
|
|
|
}
|
|
|
|
|
|
|
|
entries.AddStrings("LOCAL_EXPORT_SDK_LIBRARIES", library.exportedSdkLibs...)
|
|
|
|
|
|
|
|
if len(library.additionalCheckedModules) != 0 {
|
|
|
|
entries.AddStrings("LOCAL_ADDITIONAL_CHECKED_MODULE", library.additionalCheckedModules.Strings()...)
|
|
|
|
}
|
|
|
|
|
|
|
|
if library.proguardDictionary != nil {
|
|
|
|
entries.SetPath("LOCAL_SOONG_PROGUARD_DICT", library.proguardDictionary)
|
|
|
|
}
|
|
|
|
entries.SetString("LOCAL_MODULE_STEM", library.Stem())
|
|
|
|
},
|
2019-08-30 05:56:03 +08:00
|
|
|
},
|
2019-12-11 16:27:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
hostDexEntries := library.AndroidMkEntriesHostDex()
|
|
|
|
|
|
|
|
entriesList = append(entriesList, mainEntries, hostDexEntries)
|
|
|
|
return entriesList
|
2015-07-09 09:13:11 +08:00
|
|
|
}
|
|
|
|
|
2019-03-20 20:45:53 +08:00
|
|
|
// Called for modules that are a component of a test suite.
|
2019-08-30 05:56:03 +08:00
|
|
|
func testSuiteComponent(entries *android.AndroidMkEntries, test_suites []string) {
|
2019-08-28 06:01:50 +08:00
|
|
|
entries.SetString("LOCAL_MODULE_TAGS", "tests")
|
|
|
|
if len(test_suites) > 0 {
|
|
|
|
entries.AddStrings("LOCAL_COMPATIBILITY_SUITE", test_suites...)
|
|
|
|
} else {
|
|
|
|
entries.SetString("LOCAL_COMPATIBILITY_SUITE", "null-suite")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (j *Test) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
entriesList := j.Library.AndroidMkEntries()
|
|
|
|
entries := &entriesList[0]
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
|
|
|
|
testSuiteComponent(entries, j.testProperties.Test_suites)
|
2018-08-08 07:49:25 +08:00
|
|
|
if j.testConfig != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_FULL_TEST_CONFIG", j.testConfig)
|
2018-08-03 06:00:46 +08:00
|
|
|
}
|
2019-08-30 05:56:03 +08:00
|
|
|
androidMkWriteTestData(j.data, entries)
|
2020-01-07 07:47:57 +08:00
|
|
|
if !BoolDefault(j.testProperties.Auto_gen_config, true) {
|
|
|
|
entries.SetString("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", "true")
|
|
|
|
}
|
2018-04-10 09:40:24 +08:00
|
|
|
})
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
return entriesList
|
2018-04-10 09:40:24 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (j *TestHelperLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
entriesList := j.Library.AndroidMkEntries()
|
|
|
|
entries := &entriesList[0]
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
|
|
|
|
testSuiteComponent(entries, j.testHelperLibraryProperties.Test_suites)
|
2019-03-20 20:45:53 +08:00
|
|
|
})
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
return entriesList
|
2019-03-20 20:45:53 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (prebuilt *Import) AndroidMkEntries() []android.AndroidMkEntries {
|
2019-10-11 13:59:13 +08:00
|
|
|
if !prebuilt.IsForPlatform() || !prebuilt.ContainingSdk().Unversioned() {
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2019-07-25 21:02:35 +08:00
|
|
|
Disabled: true,
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2019-07-25 21:02:35 +08:00
|
|
|
}
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2017-08-11 08:00:19 +08:00
|
|
|
Class: "JAVA_LIBRARIES",
|
|
|
|
OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile),
|
2017-09-08 04:20:25 +08:00
|
|
|
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *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)
|
Abstract sdk_version string using sdkSpec type
The value format that sdk_version (and min_sdk_version, etc.) can have
has consistently evolved and is quite complicated. Furthermore, with the
Mainline module effort, we are expected to have more sdk_versions like
'module-app-current', 'module-lib-current', etc.
The goal of this change is to abstract the various sdk versions, which
are currently represented in string and is parsed in various places,
into a type called sdkSpec, so that adding new sdk veresions becomes
easier than before.
The sdk_version string is now parsed in only one place 'SdkSpecFrom', in
which it is converted into the sdkSpec struct. The struct type provides
several methods that again converts sdkSpec into context-specific
information such as the effective version number, etc.
Bug: 146757305
Bug: 147879031
Test: m
Change-Id: I252f3706544f00ea71c61c23460f07561dd28ab0
2020-01-21 01:03:43 +08:00
|
|
|
entries.SetString("LOCAL_SDK_VERSION", prebuilt.sdkVersion().raw)
|
2019-10-29 10:23:10 +08:00
|
|
|
entries.SetString("LOCAL_MODULE_STEM", prebuilt.Stem())
|
2017-08-11 08:00:19 +08:00
|
|
|
},
|
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2015-07-09 09:13:11 +08:00
|
|
|
}
|
2017-08-11 08:09:43 +08:00
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (prebuilt *DexImport) AndroidMkEntries() []android.AndroidMkEntries {
|
2019-07-25 21:02:35 +08:00
|
|
|
if !prebuilt.IsForPlatform() {
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2019-07-25 21:02:35 +08:00
|
|
|
Disabled: true,
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2019-07-25 21:02:35 +08:00
|
|
|
}
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2019-02-22 10:12:14 +08:00
|
|
|
Class: "JAVA_LIBRARIES",
|
|
|
|
OutputFile: android.OptionalPathForPath(prebuilt.maybeStrippedDexJarFile),
|
|
|
|
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
2019-02-22 10:12:14 +08:00
|
|
|
if prebuilt.dexJarFile != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_DEX_JAR", prebuilt.dexJarFile)
|
2019-02-22 10:12:14 +08:00
|
|
|
// TODO(b/125517186): export the dex jar as a classes jar to match some mis-uses in Make until
|
|
|
|
// boot_jars_package_check.mk can check dex jars.
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_HEADER_JAR", prebuilt.dexJarFile)
|
|
|
|
entries.SetPath("LOCAL_SOONG_CLASSES_JAR", prebuilt.dexJarFile)
|
2019-02-22 10:12:14 +08:00
|
|
|
}
|
|
|
|
if len(prebuilt.dexpreopter.builtInstalled) > 0 {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", prebuilt.dexpreopter.builtInstalled)
|
2019-02-22 10:12:14 +08:00
|
|
|
}
|
2019-10-29 10:23:10 +08:00
|
|
|
entries.SetString("LOCAL_MODULE_STEM", prebuilt.Stem())
|
2019-02-22 10:12:14 +08:00
|
|
|
},
|
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2019-02-22 10:12:14 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (prebuilt *AARImport) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2018-02-21 09:22:23 +08:00
|
|
|
Class: "JAVA_LIBRARIES",
|
|
|
|
OutputFile: android.OptionalPathForPath(prebuilt.classpathFile),
|
|
|
|
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
|
|
|
entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true)
|
|
|
|
entries.SetPath("LOCAL_SOONG_HEADER_JAR", prebuilt.classpathFile)
|
|
|
|
entries.SetPath("LOCAL_SOONG_CLASSES_JAR", prebuilt.classpathFile)
|
|
|
|
entries.SetPath("LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE", prebuilt.exportPackage)
|
|
|
|
entries.SetPath("LOCAL_SOONG_EXPORT_PROGUARD_FLAGS", prebuilt.proguardFlags)
|
|
|
|
entries.SetPath("LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES", prebuilt.extraAaptPackagesFile)
|
|
|
|
entries.SetPath("LOCAL_FULL_MANIFEST_FILE", prebuilt.manifest)
|
Abstract sdk_version string using sdkSpec type
The value format that sdk_version (and min_sdk_version, etc.) can have
has consistently evolved and is quite complicated. Furthermore, with the
Mainline module effort, we are expected to have more sdk_versions like
'module-app-current', 'module-lib-current', etc.
The goal of this change is to abstract the various sdk versions, which
are currently represented in string and is parsed in various places,
into a type called sdkSpec, so that adding new sdk veresions becomes
easier than before.
The sdk_version string is now parsed in only one place 'SdkSpecFrom', in
which it is converted into the sdkSpec struct. The struct type provides
several methods that again converts sdkSpec into context-specific
information such as the effective version number, etc.
Bug: 146757305
Bug: 147879031
Test: m
Change-Id: I252f3706544f00ea71c61c23460f07561dd28ab0
2020-01-21 01:03:43 +08:00
|
|
|
entries.SetString("LOCAL_SDK_VERSION", prebuilt.sdkVersion().raw)
|
2018-02-21 09:22:23 +08:00
|
|
|
},
|
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2018-02-21 09:22:23 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (binary *Binary) AndroidMkEntries() []android.AndroidMkEntries {
|
2017-08-11 08:09:43 +08:00
|
|
|
|
2017-12-06 05:42:45 +08:00
|
|
|
if !binary.isWrapperVariant {
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2017-12-06 05:42:45 +08:00
|
|
|
Class: "JAVA_LIBRARIES",
|
2018-08-16 11:40:52 +08:00
|
|
|
OutputFile: android.OptionalPathForPath(binary.outputFile),
|
2017-12-06 05:42:45 +08:00
|
|
|
Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk",
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
|
|
|
entries.SetPath("LOCAL_SOONG_HEADER_JAR", binary.headerJarFile)
|
|
|
|
entries.SetPath("LOCAL_SOONG_CLASSES_JAR", binary.implementationAndResourcesJar)
|
2019-01-15 04:35:45 +08:00
|
|
|
if binary.dexJarFile != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_DEX_JAR", binary.dexJarFile)
|
2019-01-15 04:35:45 +08:00
|
|
|
}
|
|
|
|
if len(binary.dexpreopter.builtInstalled) > 0 {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", binary.dexpreopter.builtInstalled)
|
2019-01-15 04:35:45 +08:00
|
|
|
}
|
2018-08-16 11:40:52 +08:00
|
|
|
},
|
|
|
|
},
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
|
|
|
func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) {
|
|
|
|
fmt.Fprintln(w, "jar_installed_module := $(LOCAL_INSTALLED_MODULE)")
|
|
|
|
},
|
2017-12-06 05:42:45 +08:00
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2017-12-06 05:42:45 +08:00
|
|
|
} else {
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2017-12-06 05:42:45 +08:00
|
|
|
Class: "EXECUTABLES",
|
|
|
|
OutputFile: android.OptionalPathForPath(binary.wrapperFile),
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
|
|
|
entries.SetBool("LOCAL_STRIP_MODULE", false)
|
2017-12-06 05:42:45 +08:00
|
|
|
},
|
|
|
|
},
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
|
|
|
func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) {
|
|
|
|
// Ensure that the wrapper script timestamp is always updated when the jar is updated
|
|
|
|
fmt.Fprintln(w, "$(LOCAL_INSTALLED_MODULE): $(jar_installed_module)")
|
|
|
|
fmt.Fprintln(w, "jar_installed_module :=")
|
|
|
|
},
|
2017-12-06 05:42:45 +08:00
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2017-08-11 08:09:43 +08:00
|
|
|
}
|
|
|
|
}
|
2017-11-23 08:20:45 +08:00
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries {
|
2020-03-27 05:01:48 +08:00
|
|
|
if !app.IsForPlatform() || app.appProperties.HideFromMake {
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2019-11-11 09:14:32 +08:00
|
|
|
Disabled: true,
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2019-11-11 09:14:32 +08:00
|
|
|
}
|
2019-12-03 12:24:29 +08:00
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2017-11-23 08:20:45 +08:00
|
|
|
Class: "APPS",
|
|
|
|
OutputFile: android.OptionalPathForPath(app.outputFile),
|
|
|
|
Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk",
|
2019-08-30 05:56:03 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
|
|
|
// App module names can be overridden.
|
|
|
|
entries.SetString("LOCAL_MODULE", app.installApkName)
|
2020-03-27 05:01:48 +08:00
|
|
|
entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", app.appProperties.PreventInstall)
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE", app.exportPackage)
|
2017-12-14 14:42:59 +08:00
|
|
|
if app.dexJarFile != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_DEX_JAR", app.dexJarFile)
|
2017-12-14 14:42:59 +08:00
|
|
|
}
|
2018-08-16 11:40:52 +08:00
|
|
|
if app.implementationAndResourcesJar != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_CLASSES_JAR", app.implementationAndResourcesJar)
|
2017-12-15 05:19:01 +08:00
|
|
|
}
|
|
|
|
if app.headerJarFile != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_HEADER_JAR", app.headerJarFile)
|
2017-12-15 05:19:01 +08:00
|
|
|
}
|
2018-10-30 14:14:58 +08:00
|
|
|
if app.bundleFile != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_BUNDLE", app.bundleFile)
|
2018-10-30 14:14:58 +08:00
|
|
|
}
|
2017-12-14 14:42:59 +08:00
|
|
|
if app.jacocoReportClassesFile != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR", app.jacocoReportClassesFile)
|
2017-12-14 14:42:59 +08:00
|
|
|
}
|
2017-12-29 04:23:20 +08:00
|
|
|
if app.proguardDictionary != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_PROGUARD_DICT", app.proguardDictionary)
|
2017-12-29 04:23:20 +08:00
|
|
|
}
|
2017-11-23 08:20:45 +08:00
|
|
|
|
2017-12-14 14:42:59 +08:00
|
|
|
if app.Name() == "framework-res" {
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.SetString("LOCAL_MODULE_PATH", "$(TARGET_OUT_JAVA_LIBRARIES)")
|
2017-12-14 14:42:59 +08:00
|
|
|
// Make base_rules.mk not put framework-res in a subdirectory called
|
|
|
|
// framework_res.
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.SetBoolIfTrue("LOCAL_NO_STANDARD_LIBRARIES", true)
|
2017-12-14 14:42:59 +08:00
|
|
|
}
|
2017-11-23 08:20:45 +08:00
|
|
|
|
2019-03-18 23:53:16 +08:00
|
|
|
filterRRO := func(filter overlayType) android.Paths {
|
|
|
|
var paths android.Paths
|
|
|
|
for _, d := range app.rroDirs {
|
|
|
|
if d.overlayType == filter {
|
|
|
|
paths = append(paths, d.path)
|
|
|
|
}
|
|
|
|
}
|
2018-04-18 01:52:26 +08:00
|
|
|
// Reverse the order, Soong stores rroDirs in aapt2 order (low to high priority), but Make
|
|
|
|
// expects it in LOCAL_RESOURCE_DIRS order (high to low priority).
|
2019-03-18 23:53:16 +08:00
|
|
|
return android.ReversePaths(paths)
|
|
|
|
}
|
|
|
|
deviceRRODirs := filterRRO(device)
|
|
|
|
if len(deviceRRODirs) > 0 {
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.AddStrings("LOCAL_SOONG_DEVICE_RRO_DIRS", deviceRRODirs.Strings()...)
|
2019-03-18 23:53:16 +08:00
|
|
|
}
|
|
|
|
productRRODirs := filterRRO(product)
|
|
|
|
if len(productRRODirs) > 0 {
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.AddStrings("LOCAL_SOONG_PRODUCT_RRO_DIRS", productRRODirs.Strings()...)
|
2017-12-14 14:42:59 +08:00
|
|
|
}
|
2017-12-01 12:13:19 +08:00
|
|
|
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.SetBoolIfTrue("LOCAL_EXPORT_PACKAGE_RESOURCES", Bool(app.appProperties.Export_package_resources))
|
2017-12-14 14:42:59 +08:00
|
|
|
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_FULL_MANIFEST_FILE", app.manifestPath)
|
2017-12-14 14:42:59 +08:00
|
|
|
|
2019-10-17 11:54:30 +08:00
|
|
|
entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", app.Privileged())
|
2017-12-15 03:22:55 +08:00
|
|
|
|
2020-02-01 02:11:47 +08:00
|
|
|
entries.SetString("LOCAL_CERTIFICATE", app.certificate.AndroidMkString())
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", app.getOverriddenPackages()...)
|
2018-10-03 13:03:40 +08:00
|
|
|
|
|
|
|
for _, jniLib := range app.installJniLibs {
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.AddStrings("LOCAL_SOONG_JNI_LIBS_"+jniLib.target.Arch.ArchType.String(), jniLib.name)
|
2018-10-03 13:03:40 +08:00
|
|
|
}
|
2020-03-27 05:01:48 +08:00
|
|
|
if len(app.jniCoverageOutputs) > 0 {
|
|
|
|
entries.AddStrings("LOCAL_PREBUILT_COVERAGE_ARCHIVE", app.jniCoverageOutputs.Strings()...)
|
|
|
|
}
|
2018-11-13 02:13:39 +08:00
|
|
|
if len(app.dexpreopter.builtInstalled) > 0 {
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", app.dexpreopter.builtInstalled)
|
2018-11-13 02:13:39 +08:00
|
|
|
}
|
2019-11-08 06:14:38 +08:00
|
|
|
for _, extra := range app.extraOutputFiles {
|
|
|
|
install := app.onDeviceDir + "/" + extra.Base()
|
|
|
|
entries.AddStrings("LOCAL_SOONG_BUILT_INSTALLED", extra.String()+":"+install)
|
2019-03-20 07:03:11 +08:00
|
|
|
}
|
2019-08-30 05:56:03 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
|
|
|
func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) {
|
2019-07-02 08:15:13 +08:00
|
|
|
if app.noticeOutputs.Merged.Valid() {
|
|
|
|
fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n",
|
|
|
|
app.installApkName, app.noticeOutputs.Merged.String(), app.installApkName+"_NOTICE")
|
|
|
|
}
|
|
|
|
if app.noticeOutputs.TxtOutput.Valid() {
|
|
|
|
fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n",
|
|
|
|
app.installApkName, app.noticeOutputs.TxtOutput.String(), app.installApkName+"_NOTICE.txt")
|
|
|
|
}
|
|
|
|
if app.noticeOutputs.HtmlOutput.Valid() {
|
|
|
|
fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n",
|
|
|
|
app.installApkName, app.noticeOutputs.HtmlOutput.String(), app.installApkName+"_NOTICE.html")
|
|
|
|
}
|
2017-11-23 08:20:45 +08:00
|
|
|
},
|
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2018-03-29 05:58:31 +08:00
|
|
|
}
|
|
|
|
|
2019-01-31 05:13:52 +08:00
|
|
|
func (a *AndroidApp) getOverriddenPackages() []string {
|
|
|
|
var overridden []string
|
|
|
|
if len(a.appProperties.Overrides) > 0 {
|
|
|
|
overridden = append(overridden, a.appProperties.Overrides...)
|
|
|
|
}
|
|
|
|
if a.Name() != a.installApkName {
|
|
|
|
overridden = append(overridden, a.Name())
|
|
|
|
}
|
|
|
|
return overridden
|
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (a *AndroidTest) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
entriesList := a.AndroidApp.AndroidMkEntries()
|
|
|
|
entries := &entriesList[0]
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
|
|
|
|
testSuiteComponent(entries, a.testProperties.Test_suites)
|
2018-08-08 07:49:25 +08:00
|
|
|
if a.testConfig != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_FULL_TEST_CONFIG", a.testConfig)
|
2018-08-03 06:00:46 +08:00
|
|
|
}
|
2019-08-30 05:56:03 +08:00
|
|
|
androidMkWriteTestData(a.data, entries)
|
2018-05-23 02:11:52 +08:00
|
|
|
})
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
return entriesList
|
2018-05-23 02:11:52 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (a *AndroidTestHelperApp) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
entriesList := a.AndroidApp.AndroidMkEntries()
|
|
|
|
entries := &entriesList[0]
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
|
|
|
|
testSuiteComponent(entries, a.appTestHelperAppProperties.Test_suites)
|
2018-10-05 06:22:03 +08:00
|
|
|
})
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
return entriesList
|
2018-10-05 06:22:03 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (a *AndroidLibrary) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
entriesList := a.Library.AndroidMkEntries()
|
|
|
|
entries := &entriesList[0]
|
2018-03-29 05:58:31 +08:00
|
|
|
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
|
2018-10-30 14:15:37 +08:00
|
|
|
if a.aarFile != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_AAR", a.aarFile)
|
2018-10-30 14:15:37 +08:00
|
|
|
}
|
2017-11-23 08:20:45 +08:00
|
|
|
|
2018-03-29 05:58:31 +08:00
|
|
|
if a.Name() == "framework-res" {
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.SetString("LOCAL_MODULE_PATH", "$(TARGET_OUT_JAVA_LIBRARIES)")
|
2018-03-29 05:58:31 +08:00
|
|
|
// Make base_rules.mk not put framework-res in a subdirectory called
|
|
|
|
// framework_res.
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.SetBoolIfTrue("LOCAL_NO_STANDARD_LIBRARIES", true)
|
2018-03-29 05:58:31 +08:00
|
|
|
}
|
|
|
|
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE", a.exportPackage)
|
|
|
|
entries.SetPath("LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES", a.extraAaptPackagesFile)
|
|
|
|
entries.SetPath("LOCAL_FULL_MANIFEST_FILE", a.mergedManifestFile)
|
2019-08-30 05:56:03 +08:00
|
|
|
entries.AddStrings("LOCAL_SOONG_EXPORT_PROGUARD_FLAGS", a.exportedProguardFlagFiles.Strings()...)
|
|
|
|
entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", true)
|
2018-03-29 05:58:31 +08:00
|
|
|
})
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
return entriesList
|
2017-11-23 08:20:45 +08:00
|
|
|
}
|
2018-01-11 08:06:12 +08:00
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (jd *Javadoc) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2018-01-11 08:06:12 +08:00
|
|
|
Class: "JAVA_LIBRARIES",
|
2018-03-09 09:26:16 +08:00
|
|
|
OutputFile: android.OptionalPathForPath(jd.stubsSrcJar),
|
2018-08-09 12:44:48 +08:00
|
|
|
Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk",
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
2018-04-11 07:14:46 +08:00
|
|
|
if BoolDefault(jd.properties.Installable, true) {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_DOC_ZIP", jd.docZip)
|
2018-01-11 08:06:12 +08:00
|
|
|
}
|
2018-03-09 09:26:16 +08:00
|
|
|
if jd.stubsSrcJar != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", jd.stubsSrcJar)
|
2018-01-11 08:06:12 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2018-01-11 08:06:12 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (ddoc *Droiddoc) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2018-01-11 08:06:12 +08:00
|
|
|
Class: "JAVA_LIBRARIES",
|
2018-03-09 09:26:16 +08:00
|
|
|
OutputFile: android.OptionalPathForPath(ddoc.stubsSrcJar),
|
2018-08-09 12:44:48 +08:00
|
|
|
Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk",
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
2018-09-05 08:14:32 +08:00
|
|
|
if BoolDefault(ddoc.Javadoc.properties.Installable, true) && ddoc.Javadoc.docZip != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_DOC_ZIP", ddoc.Javadoc.docZip)
|
2018-01-11 08:06:12 +08:00
|
|
|
}
|
2018-03-09 09:26:16 +08:00
|
|
|
if ddoc.Javadoc.stubsSrcJar != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", ddoc.Javadoc.stubsSrcJar)
|
2018-01-11 08:06:12 +08:00
|
|
|
}
|
2019-09-05 11:17:54 +08:00
|
|
|
apiFilePrefix := "INTERNAL_PLATFORM_"
|
|
|
|
if String(ddoc.properties.Api_tag_name) != "" {
|
|
|
|
apiFilePrefix += String(ddoc.properties.Api_tag_name) + "_"
|
|
|
|
}
|
|
|
|
if ddoc.apiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"API_FILE", ddoc.apiFile)
|
|
|
|
}
|
|
|
|
if ddoc.dexApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"DEX_API_FILE", ddoc.dexApiFile)
|
|
|
|
}
|
|
|
|
if ddoc.privateApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"PRIVATE_API_FILE", ddoc.privateApiFile)
|
|
|
|
}
|
|
|
|
if ddoc.privateDexApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"PRIVATE_DEX_API_FILE", ddoc.privateDexApiFile)
|
|
|
|
}
|
|
|
|
if ddoc.removedApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"REMOVED_API_FILE", ddoc.removedApiFile)
|
|
|
|
}
|
|
|
|
if ddoc.removedDexApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"REMOVED_DEX_API_FILE", ddoc.removedDexApiFile)
|
|
|
|
}
|
|
|
|
if ddoc.exactApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"EXACT_API_FILE", ddoc.exactApiFile)
|
|
|
|
}
|
|
|
|
if ddoc.proguardFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"PROGUARD_FILE", ddoc.proguardFile)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
|
|
|
func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) {
|
2018-05-05 09:49:16 +08:00
|
|
|
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")
|
2018-05-12 21:21:20 +08:00
|
|
|
fmt.Fprintln(w, "checkapi:",
|
2018-05-05 09:49:16 +08:00
|
|
|
ddoc.checkCurrentApiTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: droidcore")
|
|
|
|
fmt.Fprintln(w, "droidcore: checkapi")
|
|
|
|
}
|
|
|
|
if ddoc.updateCurrentApiTimestamp != nil {
|
2018-07-25 04:00:52 +08:00
|
|
|
fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-update-current-api")
|
2018-05-05 09:49:16 +08:00
|
|
|
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())
|
2019-01-23 21:51:55 +08:00
|
|
|
|
2019-01-31 02:51:39 +08:00
|
|
|
if ddoc.Name() == "api-stubs-docs" || ddoc.Name() == "system-api-stubs-docs" {
|
2019-01-23 21:51:55 +08:00
|
|
|
fmt.Fprintln(w, ".PHONY: checkapi")
|
|
|
|
fmt.Fprintln(w, "checkapi:",
|
|
|
|
ddoc.checkLastReleasedApiTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: droidcore")
|
|
|
|
fmt.Fprintln(w, "droidcore: checkapi")
|
|
|
|
}
|
2018-05-05 09:49:16 +08:00
|
|
|
}
|
2018-01-11 08:06:12 +08:00
|
|
|
},
|
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2018-01-11 08:06:12 +08:00
|
|
|
}
|
2018-08-11 07:06:24 +08:00
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (dstubs *Droidstubs) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2018-09-05 08:14:32 +08:00
|
|
|
Class: "JAVA_LIBRARIES",
|
2020-03-24 00:40:27 +08:00
|
|
|
DistFile: android.OptionalPathForPath(dstubs.apiFile),
|
2018-09-05 08:14:32 +08:00
|
|
|
OutputFile: android.OptionalPathForPath(dstubs.stubsSrcJar),
|
|
|
|
Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk",
|
2019-09-05 11:17:54 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
2018-09-05 08:14:32 +08:00
|
|
|
if dstubs.Javadoc.stubsSrcJar != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", dstubs.Javadoc.stubsSrcJar)
|
2018-09-05 08:14:32 +08:00
|
|
|
}
|
2018-09-19 01:41:33 +08:00
|
|
|
if dstubs.apiVersionsXml != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_API_VERSIONS_XML", dstubs.apiVersionsXml)
|
2018-09-19 01:41:33 +08:00
|
|
|
}
|
2018-09-05 08:14:32 +08:00
|
|
|
if dstubs.annotationsZip != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_ANNOTATIONS_ZIP", dstubs.annotationsZip)
|
2018-09-05 08:14:32 +08:00
|
|
|
}
|
2018-09-18 05:32:21 +08:00
|
|
|
if dstubs.jdiffDocZip != nil {
|
2019-09-05 11:17:54 +08:00
|
|
|
entries.SetPath("LOCAL_DROIDDOC_JDIFF_DOC_ZIP", dstubs.jdiffDocZip)
|
|
|
|
}
|
2019-10-11 02:29:11 +08:00
|
|
|
if dstubs.metadataZip != nil {
|
|
|
|
entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.metadataZip)
|
|
|
|
}
|
2019-09-05 11:17:54 +08:00
|
|
|
apiFilePrefix := "INTERNAL_PLATFORM_"
|
|
|
|
if String(dstubs.properties.Api_tag_name) != "" {
|
|
|
|
apiFilePrefix += String(dstubs.properties.Api_tag_name) + "_"
|
|
|
|
}
|
|
|
|
if dstubs.apiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"API_FILE", dstubs.apiFile)
|
2018-09-18 05:32:21 +08:00
|
|
|
}
|
2019-09-05 11:17:54 +08:00
|
|
|
if dstubs.dexApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"DEX_API_FILE", dstubs.dexApiFile)
|
|
|
|
}
|
|
|
|
if dstubs.privateApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"PRIVATE_API_FILE", dstubs.privateApiFile)
|
|
|
|
}
|
|
|
|
if dstubs.privateDexApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"PRIVATE_DEX_API_FILE", dstubs.privateDexApiFile)
|
|
|
|
}
|
|
|
|
if dstubs.removedApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"REMOVED_API_FILE", dstubs.removedApiFile)
|
|
|
|
}
|
|
|
|
if dstubs.removedDexApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"REMOVED_DEX_API_FILE", dstubs.removedDexApiFile)
|
|
|
|
}
|
|
|
|
if dstubs.exactApiFile != nil {
|
|
|
|
entries.SetPath(apiFilePrefix+"EXACT_API_FILE", dstubs.exactApiFile)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ExtraFooters: []android.AndroidMkExtraFootersFunc{
|
|
|
|
func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) {
|
2018-09-05 08:14:32 +08:00
|
|
|
if dstubs.checkCurrentApiTimestamp != nil {
|
|
|
|
fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-current-api")
|
|
|
|
fmt.Fprintln(w, dstubs.Name()+"-check-current-api:",
|
|
|
|
dstubs.checkCurrentApiTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: checkapi")
|
|
|
|
fmt.Fprintln(w, "checkapi:",
|
|
|
|
dstubs.checkCurrentApiTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: droidcore")
|
|
|
|
fmt.Fprintln(w, "droidcore: checkapi")
|
|
|
|
}
|
|
|
|
if dstubs.updateCurrentApiTimestamp != nil {
|
|
|
|
fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-update-current-api")
|
|
|
|
fmt.Fprintln(w, dstubs.Name()+"-update-current-api:",
|
|
|
|
dstubs.updateCurrentApiTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: update-api")
|
|
|
|
fmt.Fprintln(w, "update-api:",
|
|
|
|
dstubs.updateCurrentApiTimestamp.String())
|
|
|
|
}
|
|
|
|
if dstubs.checkLastReleasedApiTimestamp != nil {
|
|
|
|
fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-last-released-api")
|
|
|
|
fmt.Fprintln(w, dstubs.Name()+"-check-last-released-api:",
|
|
|
|
dstubs.checkLastReleasedApiTimestamp.String())
|
2019-01-23 21:51:55 +08:00
|
|
|
|
2020-01-06 23:11:48 +08:00
|
|
|
if dstubs.Name() != "android.car-system-stubs-docs" {
|
2019-01-23 21:51:55 +08:00
|
|
|
fmt.Fprintln(w, ".PHONY: checkapi")
|
|
|
|
fmt.Fprintln(w, "checkapi:",
|
|
|
|
dstubs.checkLastReleasedApiTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: droidcore")
|
|
|
|
fmt.Fprintln(w, "droidcore: checkapi")
|
|
|
|
}
|
2018-09-05 08:14:32 +08:00
|
|
|
}
|
2019-10-10 18:07:03 +08:00
|
|
|
if dstubs.apiLintTimestamp != nil {
|
|
|
|
fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-api-lint")
|
|
|
|
fmt.Fprintln(w, dstubs.Name()+"-api-lint:",
|
|
|
|
dstubs.apiLintTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: checkapi")
|
|
|
|
fmt.Fprintln(w, "checkapi:",
|
2019-11-01 20:42:39 +08:00
|
|
|
dstubs.Name()+"-api-lint")
|
2019-10-10 18:07:03 +08:00
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY: droidcore")
|
|
|
|
fmt.Fprintln(w, "droidcore: checkapi")
|
2019-11-01 20:42:39 +08:00
|
|
|
|
|
|
|
if dstubs.apiLintReport != nil {
|
|
|
|
fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", dstubs.Name()+"-api-lint",
|
|
|
|
dstubs.apiLintReport.String(), "apilint/"+dstubs.Name()+"-lint-report.txt")
|
|
|
|
}
|
2019-10-10 18:07:03 +08:00
|
|
|
}
|
2018-10-22 22:55:04 +08:00
|
|
|
if dstubs.checkNullabilityWarningsTimestamp != nil {
|
|
|
|
fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-nullability-warnings")
|
|
|
|
fmt.Fprintln(w, dstubs.Name()+"-check-nullability-warnings:",
|
|
|
|
dstubs.checkNullabilityWarningsTimestamp.String())
|
|
|
|
|
|
|
|
fmt.Fprintln(w, ".PHONY:", "droidcore")
|
|
|
|
fmt.Fprintln(w, "droidcore: ", dstubs.Name()+"-check-nullability-warnings")
|
|
|
|
}
|
2018-09-05 08:14:32 +08:00
|
|
|
},
|
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2018-09-05 08:14:32 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (a *AndroidAppImport) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
2019-04-16 00:48:31 +08:00
|
|
|
Class: "APPS",
|
2019-07-18 01:21:49 +08:00
|
|
|
OutputFile: android.OptionalPathForPath(a.outputFile),
|
2019-04-16 00:48:31 +08:00
|
|
|
Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk",
|
2019-08-28 08:33:16 +08:00
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
2019-10-17 11:54:30 +08:00
|
|
|
entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", a.Privileged())
|
2020-01-29 06:00:53 +08:00
|
|
|
entries.SetString("LOCAL_CERTIFICATE", a.certificate.AndroidMkString())
|
2019-08-28 08:33:16 +08:00
|
|
|
entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", a.properties.Overrides...)
|
|
|
|
if len(a.dexpreopter.builtInstalled) > 0 {
|
|
|
|
entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", a.dexpreopter.builtInstalled)
|
|
|
|
}
|
|
|
|
entries.AddStrings("LOCAL_INSTALLED_MODULE_STEM", a.installPath.Rel())
|
|
|
|
},
|
2019-04-16 00:48:31 +08:00
|
|
|
},
|
2019-12-03 12:24:29 +08:00
|
|
|
}}
|
2019-04-16 00:48:31 +08:00
|
|
|
}
|
|
|
|
|
2019-12-03 12:24:29 +08:00
|
|
|
func (a *AndroidTestImport) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
entriesList := a.AndroidAppImport.AndroidMkEntries()
|
|
|
|
entries := &entriesList[0]
|
2019-08-28 06:01:50 +08:00
|
|
|
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
|
2019-08-30 05:56:03 +08:00
|
|
|
testSuiteComponent(entries, a.testProperties.Test_suites)
|
|
|
|
androidMkWriteTestData(a.data, entries)
|
2019-08-28 06:01:50 +08:00
|
|
|
})
|
2019-12-03 12:24:29 +08:00
|
|
|
return entriesList
|
2019-08-28 06:01:50 +08:00
|
|
|
}
|
|
|
|
|
2019-08-30 05:56:03 +08:00
|
|
|
func androidMkWriteTestData(data android.Paths, entries *android.AndroidMkEntries) {
|
2019-08-28 06:01:50 +08:00
|
|
|
var testFiles []string
|
|
|
|
for _, d := range data {
|
|
|
|
testFiles = append(testFiles, d.String()+":"+d.Rel())
|
|
|
|
}
|
|
|
|
entries.AddStrings("LOCAL_COMPATIBILITY_SUPPORT_FILES", testFiles...)
|
|
|
|
}
|
2020-01-19 02:33:43 +08:00
|
|
|
|
|
|
|
func (r *RuntimeResourceOverlay) AndroidMkEntries() []android.AndroidMkEntries {
|
|
|
|
return []android.AndroidMkEntries{android.AndroidMkEntries{
|
|
|
|
Class: "ETC",
|
|
|
|
OutputFile: android.OptionalPathForPath(r.outputFile),
|
|
|
|
Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk",
|
|
|
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
|
|
|
func(entries *android.AndroidMkEntries) {
|
2020-02-01 02:11:47 +08:00
|
|
|
entries.SetString("LOCAL_CERTIFICATE", r.certificate.AndroidMkString())
|
2020-01-19 02:33:43 +08:00
|
|
|
entries.SetPath("LOCAL_MODULE_PATH", r.installDir.ToMakePath())
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
}
|