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" |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 20 | "strings" |
Colin Cross | 74d73e2 | 2017-08-02 11:05:49 -0700 | [diff] [blame] | 21 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 22 | "android/soong/android" |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 23 | ) |
| 24 | |
Sundong Ahn | 054b19a | 2018-10-19 13:46:09 +0900 | [diff] [blame] | 25 | func (library *Library) AndroidMkHostDex(w io.Writer, name string, data android.AndroidMkData) { |
| 26 | if Bool(library.deviceProperties.Hostdex) && !library.Host() { |
| 27 | fmt.Fprintln(w, "include $(CLEAR_VARS)") |
| 28 | fmt.Fprintln(w, "LOCAL_MODULE := "+name+"-hostdex") |
| 29 | fmt.Fprintln(w, "LOCAL_IS_HOST_MODULE := true") |
| 30 | fmt.Fprintln(w, "LOCAL_MODULE_CLASS := JAVA_LIBRARIES") |
Colin Cross | 56abb83 | 2019-01-14 14:13:51 -0800 | [diff] [blame] | 31 | if library.dexJarFile != nil { |
| 32 | fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", library.dexJarFile.String()) |
| 33 | } else { |
| 34 | fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", library.implementationAndResourcesJar.String()) |
| 35 | } |
Sundong Ahn | 054b19a | 2018-10-19 13:46:09 +0900 | [diff] [blame] | 36 | if library.dexJarFile != nil { |
| 37 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", library.dexJarFile.String()) |
| 38 | } |
| 39 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", library.headerJarFile.String()) |
| 40 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", library.implementationAndResourcesJar.String()) |
| 41 | fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+strings.Join(data.Required, " ")) |
| 42 | fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_java_prebuilt.mk") |
| 43 | } |
| 44 | } |
| 45 | |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 46 | func (library *Library) AndroidMk() android.AndroidMkData { |
| 47 | return android.AndroidMkData{ |
| 48 | Class: "JAVA_LIBRARIES", |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 49 | OutputFile: android.OptionalPathForPath(library.outputFile), |
Colin Cross | 5349941 | 2017-09-07 13:20:25 -0700 | [diff] [blame] | 50 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 51 | Extra: []android.AndroidMkExtraFunc{ |
| 52 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | 5beccee | 2017-12-07 15:28:59 -0800 | [diff] [blame] | 53 | if len(library.logtagsSrcs) > 0 { |
| 54 | var logtags []string |
| 55 | for _, l := range library.logtagsSrcs { |
| 56 | logtags = append(logtags, l.Rel()) |
| 57 | } |
| 58 | fmt.Fprintln(w, "LOCAL_LOGTAGS_FILES :=", strings.Join(logtags, " ")) |
| 59 | } |
| 60 | |
Colin Cross | 9ae1b92 | 2018-06-26 17:59:05 -0700 | [diff] [blame] | 61 | if library.installFile == nil { |
Colin Cross | 2c429dc | 2017-08-31 16:45:16 -0700 | [diff] [blame] | 62 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true") |
| 63 | } |
Colin Cross | 6ade34f | 2017-09-15 13:00:47 -0700 | [diff] [blame] | 64 | if library.dexJarFile != nil { |
| 65 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", library.dexJarFile.String()) |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 66 | } |
| 67 | if len(library.dexpreopter.builtInstalled) > 0 { |
| 68 | fmt.Fprintln(w, "LOCAL_SOONG_BUILT_INSTALLED :=", strings.Join(library.dexpreopter.builtInstalled, " ")) |
Colin Cross | 6ade34f | 2017-09-15 13:00:47 -0700 | [diff] [blame] | 69 | } |
Colin Cross | 83bb316 | 2018-06-25 15:48:06 -0700 | [diff] [blame] | 70 | fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", library.sdkVersion()) |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 71 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", library.implementationAndResourcesJar.String()) |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 72 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", library.headerJarFile.String()) |
Colin Cross | cb93359 | 2017-11-22 13:49:43 -0800 | [diff] [blame] | 73 | |
| 74 | if library.jacocoReportClassesFile != nil { |
| 75 | fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", library.jacocoReportClassesFile.String()) |
| 76 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 77 | |
Jiyong Park | 1be9691 | 2018-05-28 18:02:19 +0900 | [diff] [blame] | 78 | if len(library.exportedSdkLibs) != 0 { |
| 79 | fmt.Fprintln(w, "LOCAL_EXPORT_SDK_LIBRARIES :=", strings.Join(library.exportedSdkLibs, " ")) |
| 80 | } |
| 81 | |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 82 | // Temporary hack: export sources used to compile framework.jar to Make |
| 83 | // to be used for droiddoc |
| 84 | // TODO(ccross): remove this once droiddoc is in soong |
Mathew Inwood | ebe29ce | 2018-09-04 14:26:19 +0100 | [diff] [blame] | 85 | if (library.Name() == "framework") || (library.Name() == "framework-annotation-proc") { |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 86 | fmt.Fprintln(w, "SOONG_FRAMEWORK_SRCS :=", strings.Join(library.compiledJavaSrcs.Strings(), " ")) |
| 87 | fmt.Fprintln(w, "SOONG_FRAMEWORK_SRCJARS :=", strings.Join(library.compiledSrcJars.Strings(), " ")) |
| 88 | } |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 89 | }, |
| 90 | }, |
Colin Cross | 9243010 | 2017-10-09 14:59:32 -0700 | [diff] [blame] | 91 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 92 | android.WriteAndroidMkData(w, data) |
Sundong Ahn | 054b19a | 2018-10-19 13:46:09 +0900 | [diff] [blame] | 93 | library.AndroidMkHostDex(w, name, data) |
Colin Cross | 9243010 | 2017-10-09 14:59:32 -0700 | [diff] [blame] | 94 | }, |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 95 | } |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 96 | } |
| 97 | |
Colin Cross | 05638fc | 2018-04-09 18:40:24 -0700 | [diff] [blame] | 98 | func (j *Test) AndroidMk() android.AndroidMkData { |
| 99 | data := j.Library.AndroidMk() |
| 100 | data.Extra = append(data.Extra, func(w io.Writer, outputFile android.Path) { |
| 101 | fmt.Fprintln(w, "LOCAL_MODULE_TAGS := tests") |
| 102 | if len(j.testProperties.Test_suites) > 0 { |
| 103 | fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=", |
| 104 | strings.Join(j.testProperties.Test_suites, " ")) |
Colin Cross | 303e21f | 2018-08-07 16:49:25 -0700 | [diff] [blame] | 105 | } else { |
| 106 | fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE := null-suite") |
Colin Cross | 05638fc | 2018-04-09 18:40:24 -0700 | [diff] [blame] | 107 | } |
Colin Cross | 303e21f | 2018-08-07 16:49:25 -0700 | [diff] [blame] | 108 | if j.testConfig != nil { |
| 109 | fmt.Fprintln(w, "LOCAL_FULL_TEST_CONFIG :=", j.testConfig.String()) |
Julien Desprez | e146e39 | 2018-08-02 15:00:46 -0700 | [diff] [blame] | 110 | } |
Colin Cross | 05638fc | 2018-04-09 18:40:24 -0700 | [diff] [blame] | 111 | }) |
| 112 | |
Colin Cross | d96ca35 | 2018-08-10 16:06:24 -0700 | [diff] [blame] | 113 | androidMkWriteTestData(j.data, &data) |
| 114 | |
Colin Cross | 05638fc | 2018-04-09 18:40:24 -0700 | [diff] [blame] | 115 | return data |
| 116 | } |
| 117 | |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 118 | func (prebuilt *Import) AndroidMk() android.AndroidMkData { |
| 119 | return android.AndroidMkData{ |
| 120 | Class: "JAVA_LIBRARIES", |
| 121 | OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile), |
Colin Cross | 5349941 | 2017-09-07 13:20:25 -0700 | [diff] [blame] | 122 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 123 | Extra: []android.AndroidMkExtraFunc{ |
| 124 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | ff3ae9d | 2018-04-10 16:15:18 -0700 | [diff] [blame] | 125 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := ", !Bool(prebuilt.properties.Installable)) |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 126 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", prebuilt.combinedClasspathFile.String()) |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 127 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", prebuilt.combinedClasspathFile.String()) |
Colin Cross | 83bb316 | 2018-06-25 15:48:06 -0700 | [diff] [blame] | 128 | fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", prebuilt.sdkVersion()) |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 129 | }, |
| 130 | }, |
| 131 | } |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 132 | } |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 133 | |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 134 | func (prebuilt *AARImport) AndroidMk() android.AndroidMkData { |
| 135 | return android.AndroidMkData{ |
| 136 | Class: "JAVA_LIBRARIES", |
| 137 | OutputFile: android.OptionalPathForPath(prebuilt.classpathFile), |
| 138 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
| 139 | Extra: []android.AndroidMkExtraFunc{ |
| 140 | func(w io.Writer, outputFile android.Path) { |
| 141 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true") |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 142 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", prebuilt.classpathFile.String()) |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 143 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", prebuilt.classpathFile.String()) |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 144 | fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", prebuilt.exportPackage.String()) |
| 145 | fmt.Fprintln(w, "LOCAL_SOONG_EXPORT_PROGUARD_FLAGS :=", prebuilt.proguardFlags.String()) |
Colin Cross | 66f7882 | 2018-05-02 12:58:28 -0700 | [diff] [blame] | 146 | fmt.Fprintln(w, "LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES :=", prebuilt.extraAaptPackagesFile.String()) |
Colin Cross | 10f7c4a | 2018-05-23 10:59:28 -0700 | [diff] [blame] | 147 | fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", prebuilt.manifest.String()) |
Colin Cross | 83bb316 | 2018-06-25 15:48:06 -0700 | [diff] [blame] | 148 | fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", prebuilt.sdkVersion()) |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 149 | }, |
| 150 | }, |
| 151 | } |
| 152 | } |
| 153 | |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 154 | func (binary *Binary) AndroidMk() android.AndroidMkData { |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 155 | |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 156 | if !binary.isWrapperVariant { |
| 157 | return android.AndroidMkData{ |
| 158 | Class: "JAVA_LIBRARIES", |
Colin Cross | 331a121 | 2018-08-15 20:40:52 -0700 | [diff] [blame] | 159 | OutputFile: android.OptionalPathForPath(binary.outputFile), |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 160 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Colin Cross | 331a121 | 2018-08-15 20:40:52 -0700 | [diff] [blame] | 161 | Extra: []android.AndroidMkExtraFunc{ |
| 162 | func(w io.Writer, outputFile android.Path) { |
| 163 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", binary.headerJarFile.String()) |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 164 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", binary.implementationAndResourcesJar.String()) |
Colin Cross | 12fc2af | 2019-01-14 12:35:45 -0800 | [diff] [blame] | 165 | if binary.dexJarFile != nil { |
| 166 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", binary.dexJarFile.String()) |
| 167 | } |
| 168 | if len(binary.dexpreopter.builtInstalled) > 0 { |
| 169 | fmt.Fprintln(w, "LOCAL_SOONG_BUILT_INSTALLED :=", strings.Join(binary.dexpreopter.builtInstalled, " ")) |
| 170 | } |
Colin Cross | 331a121 | 2018-08-15 20:40:52 -0700 | [diff] [blame] | 171 | }, |
| 172 | }, |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 173 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 174 | android.WriteAndroidMkData(w, data) |
Colin Cross | 1965568 | 2017-09-07 17:00:22 -0700 | [diff] [blame] | 175 | |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 176 | fmt.Fprintln(w, "jar_installed_module := $(LOCAL_INSTALLED_MODULE)") |
| 177 | }, |
| 178 | } |
| 179 | } else { |
| 180 | return android.AndroidMkData{ |
| 181 | Class: "EXECUTABLES", |
| 182 | OutputFile: android.OptionalPathForPath(binary.wrapperFile), |
| 183 | Extra: []android.AndroidMkExtraFunc{ |
| 184 | func(w io.Writer, outputFile android.Path) { |
| 185 | fmt.Fprintln(w, "LOCAL_STRIP_MODULE := false") |
| 186 | }, |
| 187 | }, |
| 188 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 189 | android.WriteAndroidMkData(w, data) |
| 190 | |
| 191 | // Ensure that the wrapper script timestamp is always updated when the jar is updated |
| 192 | fmt.Fprintln(w, "$(LOCAL_INSTALLED_MODULE): $(jar_installed_module)") |
| 193 | fmt.Fprintln(w, "jar_installed_module :=") |
| 194 | }, |
| 195 | } |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 196 | } |
| 197 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 198 | |
| 199 | func (app *AndroidApp) AndroidMk() android.AndroidMkData { |
| 200 | return android.AndroidMkData{ |
| 201 | Class: "APPS", |
| 202 | OutputFile: android.OptionalPathForPath(app.outputFile), |
| 203 | Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", |
| 204 | Extra: []android.AndroidMkExtraFunc{ |
| 205 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 206 | fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", app.exportPackage.String()) |
| 207 | if app.dexJarFile != nil { |
| 208 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", app.dexJarFile.String()) |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 209 | } |
Colin Cross | 331a121 | 2018-08-15 20:40:52 -0700 | [diff] [blame] | 210 | if app.implementationAndResourcesJar != nil { |
| 211 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", app.implementationAndResourcesJar.String()) |
Colin Cross | 5dfabfb | 2017-12-14 13:19:01 -0800 | [diff] [blame] | 212 | } |
| 213 | if app.headerJarFile != nil { |
| 214 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", app.headerJarFile.String()) |
| 215 | } |
Colin Cross | f623721 | 2018-10-29 23:14:58 -0700 | [diff] [blame] | 216 | if app.bundleFile != nil { |
| 217 | fmt.Fprintln(w, "LOCAL_SOONG_BUNDLE :=", app.bundleFile.String()) |
| 218 | } |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 219 | if app.jacocoReportClassesFile != nil { |
| 220 | fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", app.jacocoReportClassesFile.String()) |
| 221 | } |
Colin Cross | 66dbc0b | 2017-12-28 12:23:20 -0800 | [diff] [blame] | 222 | if app.proguardDictionary != nil { |
| 223 | fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", app.proguardDictionary.String()) |
| 224 | } |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 225 | |
| 226 | if app.Name() == "framework-res" { |
| 227 | fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") |
| 228 | // Make base_rules.mk not put framework-res in a subdirectory called |
| 229 | // framework_res. |
| 230 | fmt.Fprintln(w, "LOCAL_NO_STANDARD_LIBRARIES := true") |
| 231 | } |
| 232 | |
| 233 | if len(app.rroDirs) > 0 { |
Colin Cross | a140bb0 | 2018-04-17 10:52:26 -0700 | [diff] [blame] | 234 | // Reverse the order, Soong stores rroDirs in aapt2 order (low to high priority), but Make |
| 235 | // expects it in LOCAL_RESOURCE_DIRS order (high to low priority). |
| 236 | fmt.Fprintln(w, "LOCAL_SOONG_RRO_DIRS :=", strings.Join(android.ReversePaths(app.rroDirs).Strings(), " ")) |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | if Bool(app.appProperties.Export_package_resources) { |
| 240 | fmt.Fprintln(w, "LOCAL_EXPORT_PACKAGE_RESOURCES := true") |
| 241 | } |
| 242 | |
| 243 | fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", app.manifestPath.String()) |
| 244 | |
Colin Cross | 1605606 | 2017-12-13 22:46:28 -0800 | [diff] [blame] | 245 | if Bool(app.appProperties.Privileged) { |
| 246 | fmt.Fprintln(w, "LOCAL_PRIVILEGED_MODULE := true") |
| 247 | } |
Colin Cross | e1731a5 | 2017-12-14 11:22:55 -0800 | [diff] [blame] | 248 | |
Jiyong Park | c00cbd9 | 2018-10-30 21:20:05 +0900 | [diff] [blame] | 249 | fmt.Fprintln(w, "LOCAL_CERTIFICATE :=", app.certificate.Pem.String()) |
Jason Monk | d4122be | 2018-08-10 09:33:36 -0400 | [diff] [blame] | 250 | if len(app.appProperties.Overrides) > 0 { |
| 251 | fmt.Fprintln(w, "LOCAL_OVERRIDES_PACKAGES := "+strings.Join(app.appProperties.Overrides, " ")) |
| 252 | } |
Colin Cross | a4f0881 | 2018-10-02 22:03:40 -0700 | [diff] [blame] | 253 | |
| 254 | for _, jniLib := range app.installJniLibs { |
| 255 | fmt.Fprintln(w, "LOCAL_SOONG_JNI_LIBS_"+jniLib.target.Arch.ArchType.String(), "+=", jniLib.name) |
| 256 | } |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 257 | if len(app.dexpreopter.builtInstalled) > 0 { |
| 258 | fmt.Fprintln(w, "LOCAL_SOONG_BUILT_INSTALLED :=", strings.Join(app.dexpreopter.builtInstalled, " ")) |
| 259 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 260 | }, |
| 261 | }, |
| 262 | } |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 263 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 264 | |
Colin Cross | ae5caf5 | 2018-05-22 11:11:52 -0700 | [diff] [blame] | 265 | func (a *AndroidTest) AndroidMk() android.AndroidMkData { |
| 266 | data := a.AndroidApp.AndroidMk() |
| 267 | data.Extra = append(data.Extra, func(w io.Writer, outputFile android.Path) { |
| 268 | fmt.Fprintln(w, "LOCAL_MODULE_TAGS := tests") |
| 269 | if len(a.testProperties.Test_suites) > 0 { |
| 270 | fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=", |
| 271 | strings.Join(a.testProperties.Test_suites, " ")) |
Colin Cross | 303e21f | 2018-08-07 16:49:25 -0700 | [diff] [blame] | 272 | } else { |
| 273 | fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE := null-suite") |
Colin Cross | ae5caf5 | 2018-05-22 11:11:52 -0700 | [diff] [blame] | 274 | } |
Colin Cross | 303e21f | 2018-08-07 16:49:25 -0700 | [diff] [blame] | 275 | if a.testConfig != nil { |
| 276 | fmt.Fprintln(w, "LOCAL_FULL_TEST_CONFIG :=", a.testConfig.String()) |
Julien Desprez | e146e39 | 2018-08-02 15:00:46 -0700 | [diff] [blame] | 277 | } |
Colin Cross | ae5caf5 | 2018-05-22 11:11:52 -0700 | [diff] [blame] | 278 | }) |
Colin Cross | d96ca35 | 2018-08-10 16:06:24 -0700 | [diff] [blame] | 279 | androidMkWriteTestData(a.data, &data) |
Colin Cross | ae5caf5 | 2018-05-22 11:11:52 -0700 | [diff] [blame] | 280 | |
| 281 | return data |
| 282 | } |
| 283 | |
Colin Cross | 252fc6f | 2018-10-04 15:22:03 -0700 | [diff] [blame] | 284 | func (a *AndroidTestHelperApp) AndroidMk() android.AndroidMkData { |
| 285 | data := a.AndroidApp.AndroidMk() |
| 286 | data.Extra = append(data.Extra, func(w io.Writer, outputFile android.Path) { |
| 287 | fmt.Fprintln(w, "LOCAL_MODULE_TAGS := tests") |
| 288 | if len(a.appTestHelperAppProperties.Test_suites) > 0 { |
| 289 | fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=", |
| 290 | strings.Join(a.appTestHelperAppProperties.Test_suites, " ")) |
| 291 | } else { |
| 292 | fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE := null-suite") |
| 293 | } |
| 294 | }) |
| 295 | |
| 296 | return data |
| 297 | } |
| 298 | |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 299 | func (a *AndroidLibrary) AndroidMk() android.AndroidMkData { |
| 300 | data := a.Library.AndroidMk() |
| 301 | |
| 302 | data.Extra = append(data.Extra, func(w io.Writer, outputFile android.Path) { |
Colin Cross | a54974c | 2018-10-29 23:15:37 -0700 | [diff] [blame] | 303 | if a.aarFile != nil { |
| 304 | fmt.Fprintln(w, "LOCAL_SOONG_AAR :=", a.aarFile.String()) |
| 305 | } |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 306 | if a.proguardDictionary != nil { |
| 307 | fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", a.proguardDictionary.String()) |
| 308 | } |
| 309 | |
| 310 | if a.Name() == "framework-res" { |
| 311 | fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") |
| 312 | // Make base_rules.mk not put framework-res in a subdirectory called |
| 313 | // framework_res. |
| 314 | fmt.Fprintln(w, "LOCAL_NO_STANDARD_LIBRARIES := true") |
| 315 | } |
| 316 | |
| 317 | fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", a.exportPackage.String()) |
Colin Cross | 66f7882 | 2018-05-02 12:58:28 -0700 | [diff] [blame] | 318 | fmt.Fprintln(w, "LOCAL_SOONG_STATIC_LIBRARY_EXTRA_PACKAGES :=", a.extraAaptPackagesFile.String()) |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 319 | fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", a.manifestPath.String()) |
Colin Cross | 89c3158 | 2018-04-30 15:55:11 -0700 | [diff] [blame] | 320 | fmt.Fprintln(w, "LOCAL_SOONG_EXPORT_PROGUARD_FLAGS :=", |
| 321 | strings.Join(a.exportedProguardFlagFiles.Strings(), " ")) |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 322 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true") |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame] | 323 | }) |
| 324 | |
| 325 | return data |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 326 | } |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 327 | |
| 328 | func (jd *Javadoc) AndroidMk() android.AndroidMkData { |
| 329 | return android.AndroidMkData{ |
| 330 | Class: "JAVA_LIBRARIES", |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 331 | OutputFile: android.OptionalPathForPath(jd.stubsSrcJar), |
Colin Cross | 5fa9d6f | 2018-08-08 21:44:48 -0700 | [diff] [blame] | 332 | Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk", |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 333 | Extra: []android.AndroidMkExtraFunc{ |
| 334 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | 38b40df | 2018-04-10 16:14:46 -0700 | [diff] [blame] | 335 | if BoolDefault(jd.properties.Installable, true) { |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 336 | fmt.Fprintln(w, "LOCAL_DROIDDOC_DOC_ZIP := ", jd.docZip.String()) |
| 337 | } |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 338 | if jd.stubsSrcJar != nil { |
| 339 | fmt.Fprintln(w, "LOCAL_DROIDDOC_STUBS_SRCJAR := ", jd.stubsSrcJar.String()) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 340 | } |
| 341 | }, |
| 342 | }, |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | func (ddoc *Droiddoc) AndroidMk() android.AndroidMkData { |
| 347 | return android.AndroidMkData{ |
| 348 | Class: "JAVA_LIBRARIES", |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 349 | OutputFile: android.OptionalPathForPath(ddoc.stubsSrcJar), |
Colin Cross | 5fa9d6f | 2018-08-08 21:44:48 -0700 | [diff] [blame] | 350 | Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk", |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 351 | Extra: []android.AndroidMkExtraFunc{ |
| 352 | func(w io.Writer, outputFile android.Path) { |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 353 | if BoolDefault(ddoc.Javadoc.properties.Installable, true) && ddoc.Javadoc.docZip != nil { |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 354 | fmt.Fprintln(w, "LOCAL_DROIDDOC_DOC_ZIP := ", ddoc.Javadoc.docZip.String()) |
| 355 | } |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 356 | if ddoc.Javadoc.stubsSrcJar != nil { |
| 357 | fmt.Fprintln(w, "LOCAL_DROIDDOC_STUBS_SRCJAR := ", ddoc.Javadoc.stubsSrcJar.String()) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 358 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 359 | if ddoc.checkCurrentApiTimestamp != nil { |
| 360 | fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-check-current-api") |
| 361 | fmt.Fprintln(w, ddoc.Name()+"-check-current-api:", |
| 362 | ddoc.checkCurrentApiTimestamp.String()) |
| 363 | |
| 364 | fmt.Fprintln(w, ".PHONY: checkapi") |
Jiyong Park | eeb8a64 | 2018-05-12 22:21:20 +0900 | [diff] [blame] | 365 | fmt.Fprintln(w, "checkapi:", |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 366 | ddoc.checkCurrentApiTimestamp.String()) |
| 367 | |
| 368 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 369 | fmt.Fprintln(w, "droidcore: checkapi") |
| 370 | } |
| 371 | if ddoc.updateCurrentApiTimestamp != nil { |
Dan Willemsen | a03c43a | 2018-07-24 13:00:52 -0700 | [diff] [blame] | 372 | fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-update-current-api") |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 373 | fmt.Fprintln(w, ddoc.Name()+"-update-current-api:", |
| 374 | ddoc.updateCurrentApiTimestamp.String()) |
| 375 | |
| 376 | fmt.Fprintln(w, ".PHONY: update-api") |
| 377 | fmt.Fprintln(w, "update-api:", |
| 378 | ddoc.updateCurrentApiTimestamp.String()) |
| 379 | } |
| 380 | if ddoc.checkLastReleasedApiTimestamp != nil { |
| 381 | fmt.Fprintln(w, ".PHONY:", ddoc.Name()+"-check-last-released-api") |
| 382 | fmt.Fprintln(w, ddoc.Name()+"-check-last-released-api:", |
| 383 | ddoc.checkLastReleasedApiTimestamp.String()) |
Adrian Roos | e3fe481 | 2019-01-23 14:51:55 +0100 | [diff] [blame] | 384 | |
| 385 | if ddoc.Name() == "api-stubs-docs" { |
| 386 | fmt.Fprintln(w, ".PHONY: checkapi") |
| 387 | fmt.Fprintln(w, "checkapi:", |
| 388 | ddoc.checkLastReleasedApiTimestamp.String()) |
| 389 | |
| 390 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 391 | fmt.Fprintln(w, "droidcore: checkapi") |
| 392 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 393 | } |
Nan Zhang | 28c68b9 | 2018-03-13 16:17:01 -0700 | [diff] [blame] | 394 | apiFilePrefix := "INTERNAL_PLATFORM_" |
| 395 | if String(ddoc.properties.Api_tag_name) != "" { |
| 396 | apiFilePrefix += String(ddoc.properties.Api_tag_name) + "_" |
| 397 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 398 | if ddoc.apiFile != nil { |
Nan Zhang | 28c68b9 | 2018-03-13 16:17:01 -0700 | [diff] [blame] | 399 | fmt.Fprintln(w, apiFilePrefix+"API_FILE := ", ddoc.apiFile.String()) |
| 400 | } |
David Brazdil | fbe4cc3 | 2018-05-31 13:56:46 +0100 | [diff] [blame] | 401 | if ddoc.dexApiFile != nil { |
| 402 | fmt.Fprintln(w, apiFilePrefix+"DEX_API_FILE := ", ddoc.dexApiFile.String()) |
| 403 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 404 | if ddoc.privateApiFile != nil { |
Nan Zhang | 28c68b9 | 2018-03-13 16:17:01 -0700 | [diff] [blame] | 405 | fmt.Fprintln(w, apiFilePrefix+"PRIVATE_API_FILE := ", ddoc.privateApiFile.String()) |
| 406 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 407 | if ddoc.privateDexApiFile != nil { |
Nan Zhang | 28c68b9 | 2018-03-13 16:17:01 -0700 | [diff] [blame] | 408 | fmt.Fprintln(w, apiFilePrefix+"PRIVATE_DEX_API_FILE := ", ddoc.privateDexApiFile.String()) |
| 409 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 410 | if ddoc.removedApiFile != nil { |
Nan Zhang | 28c68b9 | 2018-03-13 16:17:01 -0700 | [diff] [blame] | 411 | fmt.Fprintln(w, apiFilePrefix+"REMOVED_API_FILE := ", ddoc.removedApiFile.String()) |
| 412 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 413 | if ddoc.removedDexApiFile != nil { |
David Brazdil | aac0c3c | 2018-04-24 16:23:29 +0100 | [diff] [blame] | 414 | fmt.Fprintln(w, apiFilePrefix+"REMOVED_DEX_API_FILE := ", ddoc.removedDexApiFile.String()) |
| 415 | } |
Nan Zhang | 61819ce | 2018-05-04 18:49:16 -0700 | [diff] [blame] | 416 | if ddoc.exactApiFile != nil { |
Nan Zhang | 28c68b9 | 2018-03-13 16:17:01 -0700 | [diff] [blame] | 417 | fmt.Fprintln(w, apiFilePrefix+"EXACT_API_FILE := ", ddoc.exactApiFile.String()) |
| 418 | } |
Nan Zhang | 66dc236 | 2018-08-14 20:41:04 -0700 | [diff] [blame] | 419 | if ddoc.proguardFile != nil { |
| 420 | fmt.Fprintln(w, apiFilePrefix+"PROGUARD_FILE := ", ddoc.proguardFile.String()) |
| 421 | } |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 422 | }, |
| 423 | }, |
| 424 | } |
| 425 | } |
Colin Cross | d96ca35 | 2018-08-10 16:06:24 -0700 | [diff] [blame] | 426 | |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 427 | func (dstubs *Droidstubs) AndroidMk() android.AndroidMkData { |
| 428 | return android.AndroidMkData{ |
| 429 | Class: "JAVA_LIBRARIES", |
| 430 | OutputFile: android.OptionalPathForPath(dstubs.stubsSrcJar), |
| 431 | Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk", |
| 432 | Extra: []android.AndroidMkExtraFunc{ |
| 433 | func(w io.Writer, outputFile android.Path) { |
| 434 | if dstubs.Javadoc.stubsSrcJar != nil { |
| 435 | fmt.Fprintln(w, "LOCAL_DROIDDOC_STUBS_SRCJAR := ", dstubs.Javadoc.stubsSrcJar.String()) |
| 436 | } |
Nan Zhang | d23ac69 | 2018-09-18 10:41:33 -0700 | [diff] [blame] | 437 | if dstubs.apiVersionsXml != nil { |
| 438 | fmt.Fprintln(w, "LOCAL_DROIDDOC_API_VERSIONS_XML := ", dstubs.apiVersionsXml.String()) |
| 439 | } |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 440 | if dstubs.annotationsZip != nil { |
| 441 | fmt.Fprintln(w, "LOCAL_DROIDDOC_ANNOTATIONS_ZIP := ", dstubs.annotationsZip.String()) |
| 442 | } |
Nan Zhang | 71bbe63 | 2018-09-17 14:32:21 -0700 | [diff] [blame] | 443 | if dstubs.jdiffDocZip != nil { |
| 444 | fmt.Fprintln(w, "LOCAL_DROIDDOC_JDIFF_DOC_ZIP := ", dstubs.jdiffDocZip.String()) |
| 445 | } |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 446 | if dstubs.checkCurrentApiTimestamp != nil { |
| 447 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-current-api") |
| 448 | fmt.Fprintln(w, dstubs.Name()+"-check-current-api:", |
| 449 | dstubs.checkCurrentApiTimestamp.String()) |
| 450 | |
| 451 | fmt.Fprintln(w, ".PHONY: checkapi") |
| 452 | fmt.Fprintln(w, "checkapi:", |
| 453 | dstubs.checkCurrentApiTimestamp.String()) |
| 454 | |
| 455 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 456 | fmt.Fprintln(w, "droidcore: checkapi") |
| 457 | } |
| 458 | if dstubs.updateCurrentApiTimestamp != nil { |
| 459 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-update-current-api") |
| 460 | fmt.Fprintln(w, dstubs.Name()+"-update-current-api:", |
| 461 | dstubs.updateCurrentApiTimestamp.String()) |
| 462 | |
| 463 | fmt.Fprintln(w, ".PHONY: update-api") |
| 464 | fmt.Fprintln(w, "update-api:", |
| 465 | dstubs.updateCurrentApiTimestamp.String()) |
| 466 | } |
| 467 | if dstubs.checkLastReleasedApiTimestamp != nil { |
| 468 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-last-released-api") |
| 469 | fmt.Fprintln(w, dstubs.Name()+"-check-last-released-api:", |
| 470 | dstubs.checkLastReleasedApiTimestamp.String()) |
Adrian Roos | e3fe481 | 2019-01-23 14:51:55 +0100 | [diff] [blame] | 471 | |
| 472 | if dstubs.Name() == "api-stubs-docs" { |
| 473 | fmt.Fprintln(w, ".PHONY: checkapi") |
| 474 | fmt.Fprintln(w, "checkapi:", |
| 475 | dstubs.checkLastReleasedApiTimestamp.String()) |
| 476 | |
| 477 | fmt.Fprintln(w, ".PHONY: droidcore") |
| 478 | fmt.Fprintln(w, "droidcore: checkapi") |
| 479 | } |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 480 | } |
Pete Gillin | 581d608 | 2018-10-22 15:55:04 +0100 | [diff] [blame] | 481 | if dstubs.checkNullabilityWarningsTimestamp != nil { |
| 482 | fmt.Fprintln(w, ".PHONY:", dstubs.Name()+"-check-nullability-warnings") |
| 483 | fmt.Fprintln(w, dstubs.Name()+"-check-nullability-warnings:", |
| 484 | dstubs.checkNullabilityWarningsTimestamp.String()) |
| 485 | |
| 486 | fmt.Fprintln(w, ".PHONY:", "droidcore") |
| 487 | fmt.Fprintln(w, "droidcore: ", dstubs.Name()+"-check-nullability-warnings") |
| 488 | } |
Nan Zhang | 1598a9e | 2018-09-04 17:14:32 -0700 | [diff] [blame] | 489 | apiFilePrefix := "INTERNAL_PLATFORM_" |
| 490 | if String(dstubs.properties.Api_tag_name) != "" { |
| 491 | apiFilePrefix += String(dstubs.properties.Api_tag_name) + "_" |
| 492 | } |
| 493 | if dstubs.apiFile != nil { |
| 494 | fmt.Fprintln(w, apiFilePrefix+"API_FILE := ", dstubs.apiFile.String()) |
| 495 | } |
| 496 | if dstubs.dexApiFile != nil { |
| 497 | fmt.Fprintln(w, apiFilePrefix+"DEX_API_FILE := ", dstubs.dexApiFile.String()) |
| 498 | } |
| 499 | if dstubs.privateApiFile != nil { |
| 500 | fmt.Fprintln(w, apiFilePrefix+"PRIVATE_API_FILE := ", dstubs.privateApiFile.String()) |
| 501 | } |
| 502 | if dstubs.privateDexApiFile != nil { |
| 503 | fmt.Fprintln(w, apiFilePrefix+"PRIVATE_DEX_API_FILE := ", dstubs.privateDexApiFile.String()) |
| 504 | } |
| 505 | if dstubs.removedApiFile != nil { |
| 506 | fmt.Fprintln(w, apiFilePrefix+"REMOVED_API_FILE := ", dstubs.removedApiFile.String()) |
| 507 | } |
| 508 | if dstubs.removedDexApiFile != nil { |
| 509 | fmt.Fprintln(w, apiFilePrefix+"REMOVED_DEX_API_FILE := ", dstubs.removedDexApiFile.String()) |
| 510 | } |
| 511 | if dstubs.exactApiFile != nil { |
| 512 | fmt.Fprintln(w, apiFilePrefix+"EXACT_API_FILE := ", dstubs.exactApiFile.String()) |
| 513 | } |
| 514 | }, |
| 515 | }, |
| 516 | } |
| 517 | } |
| 518 | |
Colin Cross | d96ca35 | 2018-08-10 16:06:24 -0700 | [diff] [blame] | 519 | func androidMkWriteTestData(data android.Paths, ret *android.AndroidMkData) { |
| 520 | var testFiles []string |
| 521 | for _, d := range data { |
| 522 | testFiles = append(testFiles, d.String()+":"+d.Rel()) |
| 523 | } |
| 524 | if len(testFiles) > 0 { |
| 525 | ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) { |
| 526 | fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUPPORT_FILES := "+strings.Join(testFiles, " ")) |
| 527 | }) |
| 528 | } |
| 529 | } |