Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 1 | // Copyright 2015 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package java |
| 16 | |
| 17 | import ( |
Colin Cross | 74d73e2 | 2017-08-02 11:05:49 -0700 | [diff] [blame] | 18 | "fmt" |
| 19 | "io" |
| 20 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 21 | "android/soong/android" |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 22 | ) |
| 23 | |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 24 | func (library *Library) AndroidMkEntriesHostDex() android.AndroidMkEntries { |
| 25 | hostDexNeeded := Bool(library.deviceProperties.Hostdex) && !library.Host() |
| 26 | if !library.IsForPlatform() { |
Jiyong Park | b02bb40 | 2019-12-03 00:43:57 +0900 | [diff] [blame] | 27 | // Don't emit hostdex modules from the APEX variants |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 28 | hostDexNeeded = false |
Sundong Ahn | 054b19a | 2018-10-19 13:46:09 +0900 | [diff] [blame] | 29 | } |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 30 | |
| 31 | if hostDexNeeded { |
| 32 | var output android.Path |
| 33 | if library.dexJarFile != nil { |
| 34 | output = library.dexJarFile |
| 35 | } else { |
| 36 | output = library.implementationAndResourcesJar |
| 37 | } |
| 38 | return android.AndroidMkEntries{ |
| 39 | Class: "JAVA_LIBRARIES", |
| 40 | SubName: "-hostdex", |
| 41 | OutputFile: android.OptionalPathForPath(output), |
| 42 | Required: library.deviceProperties.Target.Hostdex.Required, |
| 43 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
| 44 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 45 | func(entries *android.AndroidMkEntries) { |
| 46 | entries.SetBool("LOCAL_IS_HOST_MODULE", true) |
| 47 | entries.SetPath("LOCAL_PREBUILT_MODULE_FILE", output) |
| 48 | if library.dexJarFile != nil { |
| 49 | entries.SetPath("LOCAL_SOONG_DEX_JAR", library.dexJarFile) |
| 50 | } |
| 51 | entries.SetPath("LOCAL_SOONG_HEADER_JAR", library.headerJarFile) |
| 52 | entries.SetPath("LOCAL_SOONG_CLASSES_JAR", library.implementationAndResourcesJar) |
| 53 | entries.SetString("LOCAL_MODULE_STEM", library.Stem()+"-hostdex") |
| 54 | }, |
| 55 | }, |
| 56 | } |
| 57 | } |
| 58 | return android.AndroidMkEntries{Disabled: true} |
Sundong Ahn | 054b19a | 2018-10-19 13:46:09 +0900 | [diff] [blame] | 59 | } |
| 60 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 61 | func (library *Library) AndroidMkEntries() []android.AndroidMkEntries { |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 62 | var entriesList []android.AndroidMkEntries |
| 63 | |
| 64 | mainEntries := android.AndroidMkEntries{Disabled: true} |
Jiyong Park | b02bb40 | 2019-12-03 00:43:57 +0900 | [diff] [blame] | 65 | |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 66 | // For a java library built for an APEX, we don't need Make module |
Jiyong Park | b02bb40 | 2019-12-03 00:43:57 +0900 | [diff] [blame] | 67 | hideFromMake := !library.IsForPlatform() |
| 68 | // If not available for platform, don't emit to make. |
| 69 | if !library.ApexModuleBase.AvailableFor(android.AvailableToPlatform) { |
| 70 | hideFromMake = true |
| 71 | } |
Colin Cross | b549b77 | 2020-06-03 17:14:31 +0000 | [diff] [blame] | 72 | if hideFromMake { |
| 73 | // May still need to add some additional dependencies. This will be called |
| 74 | // once for the platform variant (even if it is not being used) and once each |
| 75 | // for the APEX specific variants. In order to avoid adding the dependency |
| 76 | // multiple times only add it for the platform variant. |
| 77 | checkedModulePaths := library.additionalCheckedModules |
| 78 | if library.IsForPlatform() && len(checkedModulePaths) != 0 { |
| 79 | mainEntries = android.AndroidMkEntries{ |
| 80 | Class: "FAKE", |
| 81 | // Need at least one output file in order for this to take effect. |
| 82 | OutputFile: android.OptionalPathForPath(checkedModulePaths[0]), |
| 83 | Include: "$(BUILD_PHONY_PACKAGE)", |
| 84 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 85 | func(entries *android.AndroidMkEntries) { |
| 86 | entries.AddStrings("LOCAL_ADDITIONAL_CHECKED_MODULE", checkedModulePaths.Strings()...) |
| 87 | }, |
| 88 | }, |
| 89 | } |
| 90 | } |
| 91 | } else { |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 92 | mainEntries = android.AndroidMkEntries{ |
| 93 | Class: "JAVA_LIBRARIES", |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 94 | DistFiles: library.distFiles, |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 95 | OutputFile: android.OptionalPathForPath(library.outputFile), |
| 96 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
| 97 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 98 | func(entries *android.AndroidMkEntries) { |
| 99 | if len(library.logtagsSrcs) > 0 { |
| 100 | var logtags []string |
| 101 | for _, l := range library.logtagsSrcs { |
| 102 | logtags = append(logtags, l.Rel()) |
| 103 | } |
| 104 | entries.AddStrings("LOCAL_LOGTAGS_FILES", logtags...) |
Colin Cross | 5beccee | 2017-12-07 15:28:59 -0800 | [diff] [blame] | 105 | } |
Colin Cross | 5beccee | 2017-12-07 15:28:59 -0800 | [diff] [blame] | 106 | |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 107 | if library.installFile == nil { |
| 108 | entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", true) |
| 109 | } |
| 110 | if library.dexJarFile != nil { |
| 111 | entries.SetPath("LOCAL_SOONG_DEX_JAR", library.dexJarFile) |
| 112 | } |
| 113 | if len(library.dexpreopter.builtInstalled) > 0 { |
| 114 | entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", library.dexpreopter.builtInstalled) |
| 115 | } |
Jiyong Park | 6a927c4 | 2020-01-21 02:03:43 +0900 | [diff] [blame] | 116 | entries.SetString("LOCAL_SDK_VERSION", library.sdkVersion().raw) |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 117 | entries.SetPath("LOCAL_SOONG_CLASSES_JAR", library.implementationAndResourcesJar) |
| 118 | entries.SetPath("LOCAL_SOONG_HEADER_JAR", library.headerJarFile) |
Colin Cross | cb93359 | 2017-11-22 13:49:43 -0800 | [diff] [blame] | 119 | |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 120 | if library.jacocoReportClassesFile != nil { |
| 121 | entries.SetPath("LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR", library.jacocoReportClassesFile) |
| 122 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 123 | |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 124 | entries.AddStrings("LOCAL_EXPORT_SDK_LIBRARIES", library.exportedSdkLibs...) |
Jiyong Park | 1be9691 | 2018-05-28 18:02:19 +0900 | [diff] [blame] | 125 | |
Colin Cross | b549b77 | 2020-06-03 17:14:31 +0000 | [diff] [blame] | 126 | if len(library.additionalCheckedModules) != 0 { |
| 127 | entries.AddStrings("LOCAL_ADDITIONAL_CHECKED_MODULE", library.additionalCheckedModules.Strings()...) |
| 128 | } |
| 129 | |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 130 | if library.proguardDictionary != nil { |
| 131 | entries.SetPath("LOCAL_SOONG_PROGUARD_DICT", library.proguardDictionary) |
| 132 | } |
| 133 | entries.SetString("LOCAL_MODULE_STEM", library.Stem()) |
Colin Cross | c0efd1d | 2020-07-03 11:56:24 -0700 | [diff] [blame^] | 134 | |
| 135 | entries.AddOptionalPath("LOCAL_SOONG_LINT_REPORTS", library.linter.outputs.transitiveHTMLZip) |
| 136 | entries.AddOptionalPath("LOCAL_SOONG_LINT_REPORTS", library.linter.outputs.transitiveTextZip) |
| 137 | entries.AddOptionalPath("LOCAL_SOONG_LINT_REPORTS", library.linter.outputs.transitiveXMLZip) |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 138 | }, |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 139 | }, |
Jiyong Park | 55bd98b | 2019-12-11 17:27:07 +0900 | [diff] [blame] | 140 | } |
| 141 | } |
| 142 | |
| 143 | hostDexEntries := library.AndroidMkEntriesHostDex() |
| 144 | |
| 145 | entriesList = append(entriesList, mainEntries, hostDexEntries) |
| 146 | return entriesList |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 147 | } |
| 148 | |
Paul Duffin | 42df144 | 2019-03-20 12:45:53 +0000 | [diff] [blame] | 149 | // Called for modules that are a component of a test suite. |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 150 | func testSuiteComponent(entries *android.AndroidMkEntries, test_suites []string) { |
Jaewoong Jung | b28eb5f | 2019-08-27 15:01:50 -0700 | [diff] [blame] | 151 | entries.SetString("LOCAL_MODULE_TAGS", "tests") |
| 152 | if len(test_suites) > 0 { |
| 153 | entries.AddStrings("LOCAL_COMPATIBILITY_SUITE", test_suites...) |
| 154 | } else { |
| 155 | entries.SetString("LOCAL_COMPATIBILITY_SUITE", "null-suite") |
| 156 | } |
| 157 | } |
| 158 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 159 | func (j *Test) AndroidMkEntries() []android.AndroidMkEntries { |
| 160 | entriesList := j.Library.AndroidMkEntries() |
| 161 | entries := &entriesList[0] |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 162 | entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { |
| 163 | testSuiteComponent(entries, j.testProperties.Test_suites) |
Colin Cross | 303e21f | 2018-08-07 16:49:25 -0700 | [diff] [blame] | 164 | if j.testConfig != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 165 | entries.SetPath("LOCAL_FULL_TEST_CONFIG", j.testConfig) |
Julien Desprez | e146e39 | 2018-08-02 15:00:46 -0700 | [diff] [blame] | 166 | } |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 167 | androidMkWriteTestData(j.data, entries) |
Dan Shi | 2468d01 | 2020-01-06 15:47:57 -0800 | [diff] [blame] | 168 | if !BoolDefault(j.testProperties.Auto_gen_config, true) { |
| 169 | entries.SetString("LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG", "true") |
| 170 | } |
Colin Cross | 05638fc | 2018-04-09 18:40:24 -0700 | [diff] [blame] | 171 | }) |
| 172 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 173 | return entriesList |
Colin Cross | 05638fc | 2018-04-09 18:40:24 -0700 | [diff] [blame] | 174 | } |
| 175 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 176 | func (j *TestHelperLibrary) AndroidMkEntries() []android.AndroidMkEntries { |
| 177 | entriesList := j.Library.AndroidMkEntries() |
| 178 | entries := &entriesList[0] |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 179 | entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { |
| 180 | testSuiteComponent(entries, j.testHelperLibraryProperties.Test_suites) |
Paul Duffin | 42df144 | 2019-03-20 12:45:53 +0000 | [diff] [blame] | 181 | }) |
| 182 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 183 | return entriesList |
Paul Duffin | 42df144 | 2019-03-20 12:45:53 +0000 | [diff] [blame] | 184 | } |
| 185 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 186 | func (prebuilt *Import) AndroidMkEntries() []android.AndroidMkEntries { |
Jiyong Park | 9b409bc | 2019-10-11 14:59:13 +0900 | [diff] [blame] | 187 | if !prebuilt.IsForPlatform() || !prebuilt.ContainingSdk().Unversioned() { |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 188 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Jiyong Park | 7f7766d | 2019-07-25 22:02:35 +0900 | [diff] [blame] | 189 | Disabled: true, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 190 | }} |
Jiyong Park | 7f7766d | 2019-07-25 22:02:35 +0900 | [diff] [blame] | 191 | } |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 192 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 193 | Class: "JAVA_LIBRARIES", |
| 194 | OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile), |
Colin Cross | 5349941 | 2017-09-07 13:20:25 -0700 | [diff] [blame] | 195 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 196 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 197 | func(entries *android.AndroidMkEntries) { |
| 198 | entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", !Bool(prebuilt.properties.Installable)) |
| 199 | entries.SetPath("LOCAL_SOONG_HEADER_JAR", prebuilt.combinedClasspathFile) |
| 200 | entries.SetPath("LOCAL_SOONG_CLASSES_JAR", prebuilt.combinedClasspathFile) |
Jiyong Park | 6a927c4 | 2020-01-21 02:03:43 +0900 | [diff] [blame] | 201 | entries.SetString("LOCAL_SDK_VERSION", prebuilt.sdkVersion().raw) |
Jiyong Park | 0b23875 | 2019-10-29 11:23:10 +0900 | [diff] [blame] | 202 | entries.SetString("LOCAL_MODULE_STEM", prebuilt.Stem()) |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 203 | }, |
| 204 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 205 | }} |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 206 | } |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 207 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 208 | func (prebuilt *DexImport) AndroidMkEntries() []android.AndroidMkEntries { |
Jiyong Park | 7f7766d | 2019-07-25 22:02:35 +0900 | [diff] [blame] | 209 | if !prebuilt.IsForPlatform() { |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 210 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Jiyong Park | 7f7766d | 2019-07-25 22:02:35 +0900 | [diff] [blame] | 211 | Disabled: true, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 212 | }} |
Jiyong Park | 7f7766d | 2019-07-25 22:02:35 +0900 | [diff] [blame] | 213 | } |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 214 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 215 | Class: "JAVA_LIBRARIES", |
| 216 | OutputFile: android.OptionalPathForPath(prebuilt.maybeStrippedDexJarFile), |
| 217 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 218 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 219 | func(entries *android.AndroidMkEntries) { |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 220 | if prebuilt.dexJarFile != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 221 | entries.SetPath("LOCAL_SOONG_DEX_JAR", prebuilt.dexJarFile) |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 222 | // TODO(b/125517186): export the dex jar as a classes jar to match some mis-uses in Make until |
| 223 | // boot_jars_package_check.mk can check dex jars. |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 224 | entries.SetPath("LOCAL_SOONG_HEADER_JAR", prebuilt.dexJarFile) |
| 225 | entries.SetPath("LOCAL_SOONG_CLASSES_JAR", prebuilt.dexJarFile) |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 226 | } |
| 227 | if len(prebuilt.dexpreopter.builtInstalled) > 0 { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 228 | entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", prebuilt.dexpreopter.builtInstalled) |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 229 | } |
Jiyong Park | 0b23875 | 2019-10-29 11:23:10 +0900 | [diff] [blame] | 230 | entries.SetString("LOCAL_MODULE_STEM", prebuilt.Stem()) |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 231 | }, |
| 232 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 233 | }} |
Colin Cross | 42be761 | 2019-02-21 18:12:14 -0800 | [diff] [blame] | 234 | } |
| 235 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 236 | func (prebuilt *AARImport) AndroidMkEntries() []android.AndroidMkEntries { |
Jooyung Han | acc7bbe | 2020-05-20 09:06:00 +0900 | [diff] [blame] | 237 | if !prebuilt.IsForPlatform() { |
| 238 | return []android.AndroidMkEntries{{ |
| 239 | Disabled: true, |
| 240 | }} |
| 241 | } |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 242 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 243 | Class: "JAVA_LIBRARIES", |
| 244 | OutputFile: android.OptionalPathForPath(prebuilt.classpathFile), |
| 245 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 246 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 247 | func(entries *android.AndroidMkEntries) { |
| 248 | entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true) |
| 249 | entries.SetPath("LOCAL_SOONG_HEADER_JAR", prebuilt.classpathFile) |
| 250 | entries.SetPath("LOCAL_SOONG_CLASSES_JAR", prebuilt.classpathFile) |
| 251 | entries.SetPath("LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE", prebuilt.exportPackage) |
| 252 | entries.SetPath("LOCAL_SOONG_EXPORT_PROGUARD_FLAGS", prebuilt.proguardFlags) |
| 253 | entries.SetPath("LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES", prebuilt.extraAaptPackagesFile) |
| 254 | entries.SetPath("LOCAL_FULL_MANIFEST_FILE", prebuilt.manifest) |
Jiyong Park | 6a927c4 | 2020-01-21 02:03:43 +0900 | [diff] [blame] | 255 | entries.SetString("LOCAL_SDK_VERSION", prebuilt.sdkVersion().raw) |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 256 | }, |
| 257 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 258 | }} |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 259 | } |
| 260 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 261 | func (binary *Binary) AndroidMkEntries() []android.AndroidMkEntries { |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 262 | |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 263 | if !binary.isWrapperVariant { |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 264 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 265 | Class: "JAVA_LIBRARIES", |
Colin Cross | 331a121 | 2018-08-15 20:40:52 -0700 | [diff] [blame] | 266 | OutputFile: android.OptionalPathForPath(binary.outputFile), |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 267 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 268 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 269 | func(entries *android.AndroidMkEntries) { |
| 270 | entries.SetPath("LOCAL_SOONG_HEADER_JAR", binary.headerJarFile) |
| 271 | entries.SetPath("LOCAL_SOONG_CLASSES_JAR", binary.implementationAndResourcesJar) |
Colin Cross | 12fc2af | 2019-01-14 12:35:45 -0800 | [diff] [blame] | 272 | if binary.dexJarFile != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 273 | entries.SetPath("LOCAL_SOONG_DEX_JAR", binary.dexJarFile) |
Colin Cross | 12fc2af | 2019-01-14 12:35:45 -0800 | [diff] [blame] | 274 | } |
| 275 | if len(binary.dexpreopter.builtInstalled) > 0 { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 276 | entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", binary.dexpreopter.builtInstalled) |
Colin Cross | 12fc2af | 2019-01-14 12:35:45 -0800 | [diff] [blame] | 277 | } |
Colin Cross | 331a121 | 2018-08-15 20:40:52 -0700 | [diff] [blame] | 278 | }, |
| 279 | }, |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 280 | ExtraFooters: []android.AndroidMkExtraFootersFunc{ |
| 281 | func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { |
| 282 | fmt.Fprintln(w, "jar_installed_module := $(LOCAL_INSTALLED_MODULE)") |
| 283 | }, |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 284 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 285 | }} |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 286 | } else { |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 287 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 288 | Class: "EXECUTABLES", |
| 289 | OutputFile: android.OptionalPathForPath(binary.wrapperFile), |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 290 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 291 | func(entries *android.AndroidMkEntries) { |
| 292 | entries.SetBool("LOCAL_STRIP_MODULE", false) |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 293 | }, |
| 294 | }, |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 295 | ExtraFooters: []android.AndroidMkExtraFootersFunc{ |
| 296 | func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { |
| 297 | // Ensure that the wrapper script timestamp is always updated when the jar is updated |
| 298 | fmt.Fprintln(w, "$(LOCAL_INSTALLED_MODULE): $(jar_installed_module)") |
| 299 | fmt.Fprintln(w, "jar_installed_module :=") |
| 300 | }, |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 301 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 302 | }} |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 303 | } |
| 304 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 305 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 306 | func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries { |
Jaewoong Jung | 87a33e7 | 2020-03-26 14:01:48 -0700 | [diff] [blame] | 307 | if !app.IsForPlatform() || app.appProperties.HideFromMake { |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 308 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Jiyong Park | 52cd06f | 2019-11-11 10:14:32 +0900 | [diff] [blame] | 309 | Disabled: true, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 310 | }} |
Jiyong Park | 52cd06f | 2019-11-11 10:14:32 +0900 | [diff] [blame] | 311 | } |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 312 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 313 | Class: "APPS", |
| 314 | OutputFile: android.OptionalPathForPath(app.outputFile), |
| 315 | Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 316 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 317 | func(entries *android.AndroidMkEntries) { |
| 318 | // App module names can be overridden. |
| 319 | entries.SetString("LOCAL_MODULE", app.installApkName) |
Jaewoong Jung | 87a33e7 | 2020-03-26 14:01:48 -0700 | [diff] [blame] | 320 | entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", app.appProperties.PreventInstall) |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 321 | entries.SetPath("LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE", app.exportPackage) |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 322 | if app.dexJarFile != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 323 | entries.SetPath("LOCAL_SOONG_DEX_JAR", app.dexJarFile) |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 324 | } |
Colin Cross | 331a121 | 2018-08-15 20:40:52 -0700 | [diff] [blame] | 325 | if app.implementationAndResourcesJar != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 326 | entries.SetPath("LOCAL_SOONG_CLASSES_JAR", app.implementationAndResourcesJar) |
Colin Cross | 5dfabfb | 2017-12-14 13:19:01 -0800 | [diff] [blame] | 327 | } |
| 328 | if app.headerJarFile != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 329 | entries.SetPath("LOCAL_SOONG_HEADER_JAR", app.headerJarFile) |
Colin Cross | 5dfabfb | 2017-12-14 13:19:01 -0800 | [diff] [blame] | 330 | } |
Colin Cross | f623721 | 2018-10-29 23:14:58 -0700 | [diff] [blame] | 331 | if app.bundleFile != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 332 | entries.SetPath("LOCAL_SOONG_BUNDLE", app.bundleFile) |
Colin Cross | f623721 | 2018-10-29 23:14:58 -0700 | [diff] [blame] | 333 | } |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 334 | if app.jacocoReportClassesFile != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 335 | entries.SetPath("LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR", app.jacocoReportClassesFile) |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 336 | } |
Colin Cross | 66dbc0b | 2017-12-28 12:23:20 -0800 | [diff] [blame] | 337 | if app.proguardDictionary != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 338 | entries.SetPath("LOCAL_SOONG_PROGUARD_DICT", app.proguardDictionary) |
Colin Cross | 66dbc0b | 2017-12-28 12:23:20 -0800 | [diff] [blame] | 339 | } |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 340 | |
| 341 | if app.Name() == "framework-res" { |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 342 | entries.SetString("LOCAL_MODULE_PATH", "$(TARGET_OUT_JAVA_LIBRARIES)") |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 343 | // Make base_rules.mk not put framework-res in a subdirectory called |
| 344 | // framework_res. |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 345 | entries.SetBoolIfTrue("LOCAL_NO_STANDARD_LIBRARIES", true) |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 346 | } |
| 347 | |
Anton Hansson | 53c8844 | 2019-03-18 15:53:16 +0000 | [diff] [blame] | 348 | filterRRO := func(filter overlayType) android.Paths { |
| 349 | var paths android.Paths |
| 350 | for _, d := range app.rroDirs { |
| 351 | if d.overlayType == filter { |
| 352 | paths = append(paths, d.path) |
| 353 | } |
| 354 | } |
Colin Cross | a140bb0 | 2018-04-17 10:52:26 -0700 | [diff] [blame] | 355 | // Reverse the order, Soong stores rroDirs in aapt2 order (low to high priority), but Make |
| 356 | // expects it in LOCAL_RESOURCE_DIRS order (high to low priority). |
Anton Hansson | 53c8844 | 2019-03-18 15:53:16 +0000 | [diff] [blame] | 357 | return android.ReversePaths(paths) |
| 358 | } |
| 359 | deviceRRODirs := filterRRO(device) |
| 360 | if len(deviceRRODirs) > 0 { |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 361 | entries.AddStrings("LOCAL_SOONG_DEVICE_RRO_DIRS", deviceRRODirs.Strings()...) |
Anton Hansson | 53c8844 | 2019-03-18 15:53:16 +0000 | [diff] [blame] | 362 | } |
| 363 | productRRODirs := filterRRO(product) |
| 364 | if len(productRRODirs) > 0 { |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 365 | entries.AddStrings("LOCAL_SOONG_PRODUCT_RRO_DIRS", productRRODirs.Strings()...) |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 366 | } |
| 367 | |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 368 | entries.SetBoolIfTrue("LOCAL_EXPORT_PACKAGE_RESOURCES", Bool(app.appProperties.Export_package_resources)) |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 369 | |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 370 | entries.SetPath("LOCAL_FULL_MANIFEST_FILE", app.manifestPath) |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 371 | |
Jiyong Park | f748731 | 2019-10-17 12:54:30 +0900 | [diff] [blame] | 372 | entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", app.Privileged()) |
Colin Cross | e1731a5 | 2017-12-14 11:22:55 -0800 | [diff] [blame] | 373 | |
Jaewoong Jung | 78ec5d8 | 2020-01-31 10:11:47 -0800 | [diff] [blame] | 374 | entries.SetString("LOCAL_CERTIFICATE", app.certificate.AndroidMkString()) |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 375 | entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", app.getOverriddenPackages()...) |
Colin Cross | a4f0881 | 2018-10-02 22:03:40 -0700 | [diff] [blame] | 376 | |
| 377 | for _, jniLib := range app.installJniLibs { |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 378 | entries.AddStrings("LOCAL_SOONG_JNI_LIBS_"+jniLib.target.Arch.ArchType.String(), jniLib.name) |
Colin Cross | a4f0881 | 2018-10-02 22:03:40 -0700 | [diff] [blame] | 379 | } |
Jaewoong Jung | 87a33e7 | 2020-03-26 14:01:48 -0700 | [diff] [blame] | 380 | if len(app.jniCoverageOutputs) > 0 { |
| 381 | entries.AddStrings("LOCAL_PREBUILT_COVERAGE_ARCHIVE", app.jniCoverageOutputs.Strings()...) |
| 382 | } |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 383 | if len(app.dexpreopter.builtInstalled) > 0 { |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 384 | entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", app.dexpreopter.builtInstalled) |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 385 | } |
Jaewoong Jung | 5a49881 | 2019-11-07 14:14:38 -0800 | [diff] [blame] | 386 | for _, extra := range app.extraOutputFiles { |
| 387 | install := app.onDeviceDir + "/" + extra.Base() |
| 388 | entries.AddStrings("LOCAL_SOONG_BUILT_INSTALLED", extra.String()+":"+install) |
Colin Cross | e560c4a | 2019-03-19 16:03:11 -0700 | [diff] [blame] | 389 | } |
Colin Cross | c0efd1d | 2020-07-03 11:56:24 -0700 | [diff] [blame^] | 390 | |
| 391 | entries.AddOptionalPath("LOCAL_SOONG_LINT_REPORTS", app.linter.outputs.transitiveHTMLZip) |
| 392 | entries.AddOptionalPath("LOCAL_SOONG_LINT_REPORTS", app.linter.outputs.transitiveTextZip) |
| 393 | entries.AddOptionalPath("LOCAL_SOONG_LINT_REPORTS", app.linter.outputs.transitiveXMLZip) |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 394 | }, |
| 395 | }, |
| 396 | ExtraFooters: []android.AndroidMkExtraFootersFunc{ |
| 397 | func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { |
Jaewoong Jung | 9877279 | 2019-07-01 17:15:13 -0700 | [diff] [blame] | 398 | if app.noticeOutputs.Merged.Valid() { |
| 399 | fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", |
| 400 | app.installApkName, app.noticeOutputs.Merged.String(), app.installApkName+"_NOTICE") |
| 401 | } |
| 402 | if app.noticeOutputs.TxtOutput.Valid() { |
| 403 | fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", |
| 404 | app.installApkName, app.noticeOutputs.TxtOutput.String(), app.installApkName+"_NOTICE.txt") |
| 405 | } |
| 406 | if app.noticeOutputs.HtmlOutput.Valid() { |
| 407 | fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", |
| 408 | app.installApkName, app.noticeOutputs.HtmlOutput.String(), app.installApkName+"_NOTICE.html") |
| 409 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 410 | }, |
| 411 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 412 | }} |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 413 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 414 | |
Jaewoong Jung | 9109d72 | 2019-01-30 13:13:52 -0800 | [diff] [blame] | 415 | func (a *AndroidApp) getOverriddenPackages() []string { |
| 416 | var overridden []string |
| 417 | if len(a.appProperties.Overrides) > 0 { |
| 418 | overridden = append(overridden, a.appProperties.Overrides...) |
| 419 | } |
| 420 | if a.Name() != a.installApkName { |
| 421 | overridden = append(overridden, a.Name()) |
| 422 | } |
| 423 | return overridden |
| 424 | } |
| 425 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 426 | func (a *AndroidTest) AndroidMkEntries() []android.AndroidMkEntries { |
| 427 | entriesList := a.AndroidApp.AndroidMkEntries() |
| 428 | entries := &entriesList[0] |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 429 | entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { |
| 430 | testSuiteComponent(entries, a.testProperties.Test_suites) |
Colin Cross | 303e21f | 2018-08-07 16:49:25 -0700 | [diff] [blame] | 431 | if a.testConfig != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 432 | entries.SetPath("LOCAL_FULL_TEST_CONFIG", a.testConfig) |
Julien Desprez | e146e39 | 2018-08-02 15:00:46 -0700 | [diff] [blame] | 433 | } |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 434 | androidMkWriteTestData(a.data, entries) |
Colin Cross | 252fc6f | 2018-10-04 15:22:03 -0700 | [diff] [blame] | 435 | }) |
| 436 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 437 | return entriesList |
Colin Cross | 252fc6f | 2018-10-04 15:22:03 -0700 | [diff] [blame] | 438 | } |
| 439 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 440 | func (a *AndroidTestHelperApp) AndroidMkEntries() []android.AndroidMkEntries { |
| 441 | entriesList := a.AndroidApp.AndroidMkEntries() |
| 442 | entries := &entriesList[0] |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 443 | entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { |
| 444 | testSuiteComponent(entries, a.appTestHelperAppProperties.Test_suites) |
| 445 | }) |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 446 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 447 | return entriesList |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 448 | } |
| 449 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 450 | func (a *AndroidLibrary) AndroidMkEntries() []android.AndroidMkEntries { |
Jooyung Han | acc7bbe | 2020-05-20 09:06:00 +0900 | [diff] [blame] | 451 | if !a.IsForPlatform() { |
| 452 | return []android.AndroidMkEntries{{ |
| 453 | Disabled: true, |
| 454 | }} |
| 455 | } |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 456 | entriesList := a.Library.AndroidMkEntries() |
| 457 | entries := &entriesList[0] |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 458 | |
| 459 | entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { |
Colin Cross | a54974c | 2018-10-29 23:15:37 -0700 | [diff] [blame] | 460 | if a.aarFile != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 461 | entries.SetPath("LOCAL_SOONG_AAR", a.aarFile) |
Colin Cross | a54974c | 2018-10-29 23:15:37 -0700 | [diff] [blame] | 462 | } |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 463 | |
| 464 | if a.Name() == "framework-res" { |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 465 | entries.SetString("LOCAL_MODULE_PATH", "$(TARGET_OUT_JAVA_LIBRARIES)") |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 466 | // Make base_rules.mk not put framework-res in a subdirectory called |
| 467 | // framework_res. |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 468 | entries.SetBoolIfTrue("LOCAL_NO_STANDARD_LIBRARIES", true) |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 469 | } |
| 470 | |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 471 | entries.SetPath("LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE", a.exportPackage) |
| 472 | entries.SetPath("LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES", a.extraAaptPackagesFile) |
| 473 | entries.SetPath("LOCAL_FULL_MANIFEST_FILE", a.mergedManifestFile) |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 474 | entries.AddStrings("LOCAL_SOONG_EXPORT_PROGUARD_FLAGS", a.exportedProguardFlagFiles.Strings()...) |
| 475 | entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", true) |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 476 | }) |
| 477 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 478 | return entriesList |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 479 | } |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 480 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 481 | func (jd *Javadoc) AndroidMkEntries() []android.AndroidMkEntries { |
| 482 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 483 | Class: "JAVA_LIBRARIES", |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 484 | OutputFile: android.OptionalPathForPath(jd.stubsSrcJar), |
Colin Cross | 5fa9d6f | 2018-08-08 21:44:48 -0700 | [diff] [blame] | 485 | Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk", |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 486 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 487 | func(entries *android.AndroidMkEntries) { |
Colin Cross | 38b40df | 2018-04-10 16:14:46 -0700 | [diff] [blame] | 488 | if BoolDefault(jd.properties.Installable, true) { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 489 | entries.SetPath("LOCAL_DROIDDOC_DOC_ZIP", jd.docZip) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 490 | } |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 491 | if jd.stubsSrcJar != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 492 | entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", jd.stubsSrcJar) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 493 | } |
| 494 | }, |
| 495 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 496 | }} |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 497 | } |
| 498 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 499 | func (ddoc *Droiddoc) AndroidMkEntries() []android.AndroidMkEntries { |
| 500 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 501 | Class: "JAVA_LIBRARIES", |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 502 | OutputFile: android.OptionalPathForPath(ddoc.stubsSrcJar), |
Colin Cross | 5fa9d6f | 2018-08-08 21:44:48 -0700 | [diff] [blame] | 503 | Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk", |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 504 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 505 | func(entries *android.AndroidMkEntries) { |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 506 | if BoolDefault(ddoc.Javadoc.properties.Installable, true) && ddoc.Javadoc.docZip != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 507 | entries.SetPath("LOCAL_DROIDDOC_DOC_ZIP", ddoc.Javadoc.docZip) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 508 | } |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 509 | if ddoc.Javadoc.stubsSrcJar != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 510 | entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", ddoc.Javadoc.stubsSrcJar) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 511 | } |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 512 | }, |
| 513 | }, |
| 514 | ExtraFooters: []android.AndroidMkExtraFootersFunc{ |
| 515 | func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 516 | if ddoc.checkCurrentApiTimestamp != nil { |
| 517 | fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-check-current-api") |
| 518 | fmt.Fprintln(w, ddoc.Name()+"-check-current-api:", |
| 519 | ddoc.checkCurrentApiTimestamp.String()) |
| 520 | |
| 521 | fmt.Fprintln(w, ".PHONY: checkapi") |
Jiyong Park | eeb8a64 | 2018-05-12 22:21:20 +0900 | [diff] [blame] | 522 | fmt.Fprintln(w, "checkapi:", |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 523 | ddoc.checkCurrentApiTimestamp.String()) |
| 524 | |
| 525 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 526 | fmt.Fprintln(w, "droidcore: checkapi") |
| 527 | } |
| 528 | if ddoc.updateCurrentApiTimestamp != nil { |
Dan Willemsen | a03c43a | 2018-07-24 13:00:52 -0700 | [diff] [blame] | 529 | fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-update-current-api") |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 530 | fmt.Fprintln(w, ddoc.Name()+"-update-current-api:", |
| 531 | ddoc.updateCurrentApiTimestamp.String()) |
| 532 | |
| 533 | fmt.Fprintln(w, ".PHONY: update-api") |
| 534 | fmt.Fprintln(w, "update-api:", |
| 535 | ddoc.updateCurrentApiTimestamp.String()) |
| 536 | } |
| 537 | if ddoc.checkLastReleasedApiTimestamp != nil { |
| 538 | fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-check-last-released-api") |
| 539 | fmt.Fprintln(w, ddoc.Name()+"-check-last-released-api:", |
| 540 | ddoc.checkLastReleasedApiTimestamp.String()) |
Adrian Roos | e3fe481 | 2019-01-23 14:51:55 +0100 | [diff] [blame] | 541 | |
Anton Hansson | 668b8a2 | 2020-05-26 18:07:10 +0100 | [diff] [blame] | 542 | fmt.Fprintln(w, ".PHONY: checkapi") |
| 543 | fmt.Fprintln(w, "checkapi:", |
| 544 | ddoc.checkLastReleasedApiTimestamp.String()) |
Adrian Roos | e3fe481 | 2019-01-23 14:51:55 +0100 | [diff] [blame] | 545 | |
Anton Hansson | 668b8a2 | 2020-05-26 18:07:10 +0100 | [diff] [blame] | 546 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 547 | fmt.Fprintln(w, "droidcore: checkapi") |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 548 | } |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 549 | }, |
| 550 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 551 | }} |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 552 | } |
Colin Cross | d96ca35 | 2018-08-10 16:06:24 -0700 | [diff] [blame] | 553 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 554 | func (dstubs *Droidstubs) AndroidMkEntries() []android.AndroidMkEntries { |
Paul Duffin | 3ae2951 | 2020-04-08 18:18:03 +0100 | [diff] [blame] | 555 | // If the stubsSrcJar is not generated (because generate_stubs is false) then |
| 556 | // use the api file as the output file to ensure the relevant phony targets |
| 557 | // are created in make if only the api txt file is being generated. This is |
| 558 | // needed because an invalid output file would prevent the make entries from |
| 559 | // being written. |
| 560 | // TODO(b/146727827): Revert when we do not need to generate stubs and API separately. |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 561 | distFile := dstubs.apiFile |
Paul Duffin | 3ae2951 | 2020-04-08 18:18:03 +0100 | [diff] [blame] | 562 | outputFile := android.OptionalPathForPath(dstubs.stubsSrcJar) |
| 563 | if !outputFile.Valid() { |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 564 | outputFile = android.OptionalPathForPath(distFile) |
Paul Duffin | 3ae2951 | 2020-04-08 18:18:03 +0100 | [diff] [blame] | 565 | } |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 566 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 567 | Class: "JAVA_LIBRARIES", |
Jingwen Chen | 40fd90a | 2020-06-15 05:24:19 +0000 | [diff] [blame] | 568 | DistFiles: android.MakeDefaultDistFiles(distFile), |
Paul Duffin | 3ae2951 | 2020-04-08 18:18:03 +0100 | [diff] [blame] | 569 | OutputFile: outputFile, |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 570 | Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk", |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 571 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 572 | func(entries *android.AndroidMkEntries) { |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 573 | if dstubs.Javadoc.stubsSrcJar != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 574 | entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", dstubs.Javadoc.stubsSrcJar) |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 575 | } |
Nan Zhang | d23ac69 | 2018-09-18 10:41:33 -0700 | [diff] [blame] | 576 | if dstubs.apiVersionsXml != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 577 | entries.SetPath("LOCAL_DROIDDOC_API_VERSIONS_XML", dstubs.apiVersionsXml) |
Nan Zhang | d23ac69 | 2018-09-18 10:41:33 -0700 | [diff] [blame] | 578 | } |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 579 | if dstubs.annotationsZip != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 580 | entries.SetPath("LOCAL_DROIDDOC_ANNOTATIONS_ZIP", dstubs.annotationsZip) |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 581 | } |
Nan Zhang | 71bbe63 | 2018-09-17 14:32:21 -0700 | [diff] [blame] | 582 | if dstubs.jdiffDocZip != nil { |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 583 | entries.SetPath("LOCAL_DROIDDOC_JDIFF_DOC_ZIP", dstubs.jdiffDocZip) |
Nan Zhang | 71bbe63 | 2018-09-17 14:32:21 -0700 | [diff] [blame] | 584 | } |
Jerome Gaillard | 0f59903 | 2019-10-10 19:29:11 +0100 | [diff] [blame] | 585 | if dstubs.metadataZip != nil { |
| 586 | entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.metadataZip) |
| 587 | } |
Jaewoong Jung | 9a1e8bd | 2019-09-04 20:17:54 -0700 | [diff] [blame] | 588 | }, |
| 589 | }, |
| 590 | ExtraFooters: []android.AndroidMkExtraFootersFunc{ |
| 591 | func(w io.Writer, name, prefix, moduleDir string, entries *android.AndroidMkEntries) { |
Anton Hansson | 27d9ec1 | 2020-04-17 11:48:24 +0100 | [diff] [blame] | 592 | if dstubs.apiFile != nil { |
| 593 | fmt.Fprintf(w, ".PHONY: %s %s.txt\n", dstubs.Name(), dstubs.Name()) |
| 594 | fmt.Fprintf(w, "%s %s.txt: %s\n", dstubs.Name(), dstubs.Name(), dstubs.apiFile) |
| 595 | } |
| 596 | if dstubs.removedApiFile != nil { |
| 597 | fmt.Fprintf(w, ".PHONY: %s %s.txt\n", dstubs.Name(), dstubs.Name()) |
| 598 | fmt.Fprintf(w, "%s %s.txt: %s\n", dstubs.Name(), dstubs.Name(), dstubs.removedApiFile) |
| 599 | } |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 600 | if dstubs.checkCurrentApiTimestamp != nil { |
| 601 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-current-api") |
| 602 | fmt.Fprintln(w, dstubs.Name()+"-check-current-api:", |
| 603 | dstubs.checkCurrentApiTimestamp.String()) |
| 604 | |
| 605 | fmt.Fprintln(w, ".PHONY: checkapi") |
| 606 | fmt.Fprintln(w, "checkapi:", |
| 607 | dstubs.checkCurrentApiTimestamp.String()) |
| 608 | |
| 609 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 610 | fmt.Fprintln(w, "droidcore: checkapi") |
| 611 | } |
| 612 | if dstubs.updateCurrentApiTimestamp != nil { |
| 613 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-update-current-api") |
| 614 | fmt.Fprintln(w, dstubs.Name()+"-update-current-api:", |
| 615 | dstubs.updateCurrentApiTimestamp.String()) |
| 616 | |
| 617 | fmt.Fprintln(w, ".PHONY: update-api") |
| 618 | fmt.Fprintln(w, "update-api:", |
| 619 | dstubs.updateCurrentApiTimestamp.String()) |
| 620 | } |
| 621 | if dstubs.checkLastReleasedApiTimestamp != nil { |
| 622 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-last-released-api") |
| 623 | fmt.Fprintln(w, dstubs.Name()+"-check-last-released-api:", |
| 624 | dstubs.checkLastReleasedApiTimestamp.String()) |
Adrian Roos | e3fe481 | 2019-01-23 14:51:55 +0100 | [diff] [blame] | 625 | |
Makoto Onuki | a573f19 | 2020-04-21 11:52:39 -0700 | [diff] [blame] | 626 | fmt.Fprintln(w, ".PHONY: checkapi") |
| 627 | fmt.Fprintln(w, "checkapi:", |
| 628 | dstubs.checkLastReleasedApiTimestamp.String()) |
Adrian Roos | e3fe481 | 2019-01-23 14:51:55 +0100 | [diff] [blame] | 629 | |
Makoto Onuki | a573f19 | 2020-04-21 11:52:39 -0700 | [diff] [blame] | 630 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 631 | fmt.Fprintln(w, "droidcore: checkapi") |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 632 | } |
Adrian Roos | 075eedc | 2019-10-10 12:07:03 +0200 | [diff] [blame] | 633 | if dstubs.apiLintTimestamp != nil { |
| 634 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-api-lint") |
| 635 | fmt.Fprintln(w, dstubs.Name()+"-api-lint:", |
| 636 | dstubs.apiLintTimestamp.String()) |
| 637 | |
| 638 | fmt.Fprintln(w, ".PHONY: checkapi") |
| 639 | fmt.Fprintln(w, "checkapi:", |
Adrian Roos | 3b8f1cd | 2019-11-01 13:42:39 +0100 | [diff] [blame] | 640 | dstubs.Name()+"-api-lint") |
Adrian Roos | 075eedc | 2019-10-10 12:07:03 +0200 | [diff] [blame] | 641 | |
| 642 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 643 | fmt.Fprintln(w, "droidcore: checkapi") |
Adrian Roos | 3b8f1cd | 2019-11-01 13:42:39 +0100 | [diff] [blame] | 644 | |
| 645 | if dstubs.apiLintReport != nil { |
| 646 | fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", dstubs.Name()+"-api-lint", |
| 647 | dstubs.apiLintReport.String(), "apilint/"+dstubs.Name()+"-lint-report.txt") |
| 648 | } |
Adrian Roos | 075eedc | 2019-10-10 12:07:03 +0200 | [diff] [blame] | 649 | } |
Pete Gillin | 581d608 | 2018-10-22 15:55:04 +0100 | [diff] [blame] | 650 | if dstubs.checkNullabilityWarningsTimestamp != nil { |
| 651 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-nullability-warnings") |
| 652 | fmt.Fprintln(w, dstubs.Name()+"-check-nullability-warnings:", |
| 653 | dstubs.checkNullabilityWarningsTimestamp.String()) |
| 654 | |
| 655 | fmt.Fprintln(w, ".PHONY:", "droidcore") |
| 656 | fmt.Fprintln(w, "droidcore: ", dstubs.Name()+"-check-nullability-warnings") |
| 657 | } |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 658 | }, |
| 659 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 660 | }} |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 661 | } |
| 662 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 663 | func (a *AndroidAppImport) AndroidMkEntries() []android.AndroidMkEntries { |
Jiyong Park | 592a6a4 | 2020-04-21 22:34:28 +0900 | [diff] [blame] | 664 | if !a.IsForPlatform() { |
| 665 | // The non-platform variant is placed inside APEX. No reason to |
| 666 | // make it available to Make. |
| 667 | return nil |
| 668 | } |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 669 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
Jaewoong Jung | ccbb393 | 2019-04-15 09:48:31 -0700 | [diff] [blame] | 670 | Class: "APPS", |
Jaewoong Jung | 8aae22e | 2019-07-17 10:21:49 -0700 | [diff] [blame] | 671 | OutputFile: android.OptionalPathForPath(a.outputFile), |
Jaewoong Jung | ccbb393 | 2019-04-15 09:48:31 -0700 | [diff] [blame] | 672 | Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", |
Jaewoong Jung | e0dc8df | 2019-08-27 17:33:16 -0700 | [diff] [blame] | 673 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 674 | func(entries *android.AndroidMkEntries) { |
Jiyong Park | f748731 | 2019-10-17 12:54:30 +0900 | [diff] [blame] | 675 | entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", a.Privileged()) |
Colin Cross | 503c1d0 | 2020-01-28 14:00:53 -0800 | [diff] [blame] | 676 | entries.SetString("LOCAL_CERTIFICATE", a.certificate.AndroidMkString()) |
Jaewoong Jung | e0dc8df | 2019-08-27 17:33:16 -0700 | [diff] [blame] | 677 | entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", a.properties.Overrides...) |
| 678 | if len(a.dexpreopter.builtInstalled) > 0 { |
| 679 | entries.SetString("LOCAL_SOONG_BUILT_INSTALLED", a.dexpreopter.builtInstalled) |
| 680 | } |
| 681 | entries.AddStrings("LOCAL_INSTALLED_MODULE_STEM", a.installPath.Rel()) |
| 682 | }, |
Jaewoong Jung | ccbb393 | 2019-04-15 09:48:31 -0700 | [diff] [blame] | 683 | }, |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 684 | }} |
Jaewoong Jung | ccbb393 | 2019-04-15 09:48:31 -0700 | [diff] [blame] | 685 | } |
| 686 | |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 687 | func (a *AndroidTestImport) AndroidMkEntries() []android.AndroidMkEntries { |
| 688 | entriesList := a.AndroidAppImport.AndroidMkEntries() |
| 689 | entries := &entriesList[0] |
Jaewoong Jung | b28eb5f | 2019-08-27 15:01:50 -0700 | [diff] [blame] | 690 | entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) { |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 691 | testSuiteComponent(entries, a.testProperties.Test_suites) |
| 692 | androidMkWriteTestData(a.data, entries) |
Jaewoong Jung | b28eb5f | 2019-08-27 15:01:50 -0700 | [diff] [blame] | 693 | }) |
Jiyong Park | 0b0e1b9 | 2019-12-03 13:24:29 +0900 | [diff] [blame] | 694 | return entriesList |
Jaewoong Jung | b28eb5f | 2019-08-27 15:01:50 -0700 | [diff] [blame] | 695 | } |
| 696 | |
Jaewoong Jung | b0c127c | 2019-08-29 14:56:03 -0700 | [diff] [blame] | 697 | func androidMkWriteTestData(data android.Paths, entries *android.AndroidMkEntries) { |
Jaewoong Jung | b28eb5f | 2019-08-27 15:01:50 -0700 | [diff] [blame] | 698 | var testFiles []string |
| 699 | for _, d := range data { |
| 700 | testFiles = append(testFiles, d.String()+":"+d.Rel()) |
| 701 | } |
| 702 | entries.AddStrings("LOCAL_COMPATIBILITY_SUPPORT_FILES", testFiles...) |
| 703 | } |
Jaewoong Jung | 9befb0c | 2020-01-18 10:33:43 -0800 | [diff] [blame] | 704 | |
| 705 | func (r *RuntimeResourceOverlay) AndroidMkEntries() []android.AndroidMkEntries { |
| 706 | return []android.AndroidMkEntries{android.AndroidMkEntries{ |
| 707 | Class: "ETC", |
| 708 | OutputFile: android.OptionalPathForPath(r.outputFile), |
| 709 | Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", |
| 710 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 711 | func(entries *android.AndroidMkEntries) { |
Jaewoong Jung | 78ec5d8 | 2020-01-31 10:11:47 -0800 | [diff] [blame] | 712 | entries.SetString("LOCAL_CERTIFICATE", r.certificate.AndroidMkString()) |
Jaewoong Jung | 9befb0c | 2020-01-18 10:33:43 -0800 | [diff] [blame] | 713 | entries.SetPath("LOCAL_MODULE_PATH", r.installDir.ToMakePath()) |
Jaewoong Jung | ad0177b | 2020-04-24 15:22:40 -0700 | [diff] [blame] | 714 | entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", r.properties.Overrides...) |
Jaewoong Jung | 9befb0c | 2020-01-18 10:33:43 -0800 | [diff] [blame] | 715 | }, |
| 716 | }, |
| 717 | }} |
| 718 | } |
Sasha Smundak | a7856c0 | 2020-04-23 09:49:59 -0700 | [diff] [blame] | 719 | |
| 720 | func (apkSet *AndroidAppSet) AndroidMkEntries() []android.AndroidMkEntries { |
| 721 | return []android.AndroidMkEntries{ |
| 722 | android.AndroidMkEntries{ |
| 723 | Class: "APPS", |
| 724 | OutputFile: android.OptionalPathForPath(apkSet.packedOutput), |
| 725 | Include: "$(BUILD_SYSTEM)/soong_android_app_set.mk", |
| 726 | ExtraEntries: []android.AndroidMkExtraEntriesFunc{ |
| 727 | func(entries *android.AndroidMkEntries) { |
| 728 | entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", apkSet.Privileged()) |
| 729 | entries.SetString("LOCAL_APK_SET_MASTER_FILE", apkSet.masterFile) |
Jaewoong Jung | 11c1e0f | 2020-06-29 19:18:44 -0700 | [diff] [blame] | 730 | entries.SetPath("LOCAL_APKCERTS_FILE", apkSet.apkcertsFile) |
Sasha Smundak | a7856c0 | 2020-04-23 09:49:59 -0700 | [diff] [blame] | 731 | entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", apkSet.properties.Overrides...) |
| 732 | }, |
| 733 | }, |
| 734 | }, |
| 735 | } |
| 736 | } |