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 | |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 25 | func (library *Library) AndroidMk() android.AndroidMkData { |
| 26 | return android.AndroidMkData{ |
| 27 | Class: "JAVA_LIBRARIES", |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 28 | OutputFile: android.OptionalPathForPath(library.implementationJarFile), |
Colin Cross | 5349941 | 2017-09-07 13:20:25 -0700 | [diff] [blame] | 29 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 30 | Extra: []android.AndroidMkExtraFunc{ |
| 31 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | 5beccee | 2017-12-07 15:28:59 -0800 | [diff] [blame] | 32 | if len(library.logtagsSrcs) > 0 { |
| 33 | var logtags []string |
| 34 | for _, l := range library.logtagsSrcs { |
| 35 | logtags = append(logtags, l.Rel()) |
| 36 | } |
| 37 | fmt.Fprintln(w, "LOCAL_LOGTAGS_FILES :=", strings.Join(logtags, " ")) |
| 38 | } |
| 39 | |
Colin Cross | 2c429dc | 2017-08-31 16:45:16 -0700 | [diff] [blame] | 40 | if library.properties.Installable != nil && *library.properties.Installable == false { |
| 41 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true") |
| 42 | } |
Colin Cross | 6ade34f | 2017-09-15 13:00:47 -0700 | [diff] [blame] | 43 | if library.dexJarFile != nil { |
| 44 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", library.dexJarFile.String()) |
Colin Cross | 1bd8780 | 2017-12-05 15:31:19 -0800 | [diff] [blame] | 45 | if library.deviceProperties.Dex_preopt.Enabled != nil { |
| 46 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT :=", *library.deviceProperties.Dex_preopt.Enabled) |
| 47 | } |
| 48 | if library.deviceProperties.Dex_preopt.App_image != nil { |
| 49 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT_APP_IMAGE :=", *library.deviceProperties.Dex_preopt.App_image) |
| 50 | } |
| 51 | if library.deviceProperties.Dex_preopt.Profile_guided != nil { |
| 52 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT_GENERATE_PROFILE :=", *library.deviceProperties.Dex_preopt.Profile_guided) |
| 53 | } |
| 54 | if library.deviceProperties.Dex_preopt.Profile != nil { |
| 55 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT_GENERATE_PROFILE := true") |
| 56 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING := $(LOCAL_PATH)/"+*library.deviceProperties.Dex_preopt.Profile) |
Colin Cross | a22116e | 2017-10-19 14:18:58 -0700 | [diff] [blame] | 57 | } |
Colin Cross | 6ade34f | 2017-09-15 13:00:47 -0700 | [diff] [blame] | 58 | } |
Nan Zhang | ea568a4 | 2017-11-08 21:20:04 -0800 | [diff] [blame] | 59 | fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", String(library.deviceProperties.Sdk_version)) |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 60 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", library.headerJarFile.String()) |
Colin Cross | cb93359 | 2017-11-22 13:49:43 -0800 | [diff] [blame] | 61 | |
| 62 | if library.jacocoReportClassesFile != nil { |
| 63 | fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", library.jacocoReportClassesFile.String()) |
| 64 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 65 | |
| 66 | // Temporary hack: export sources used to compile framework.jar to Make |
| 67 | // to be used for droiddoc |
| 68 | // TODO(ccross): remove this once droiddoc is in soong |
| 69 | if library.Name() == "framework" { |
| 70 | fmt.Fprintln(w, "SOONG_FRAMEWORK_SRCS :=", strings.Join(library.compiledJavaSrcs.Strings(), " ")) |
| 71 | fmt.Fprintln(w, "SOONG_FRAMEWORK_SRCJARS :=", strings.Join(library.compiledSrcJars.Strings(), " ")) |
| 72 | } |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 73 | }, |
| 74 | }, |
Colin Cross | 9243010 | 2017-10-09 14:59:32 -0700 | [diff] [blame] | 75 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 76 | android.WriteAndroidMkData(w, data) |
| 77 | |
Colin Cross | ff3ae9d | 2018-04-10 16:15:18 -0700 | [diff] [blame] | 78 | if Bool(library.deviceProperties.Hostdex) && !library.Host() { |
Colin Cross | 9243010 | 2017-10-09 14:59:32 -0700 | [diff] [blame] | 79 | fmt.Fprintln(w, "include $(CLEAR_VARS)") |
| 80 | fmt.Fprintln(w, "LOCAL_MODULE := "+name+"-hostdex") |
| 81 | fmt.Fprintln(w, "LOCAL_IS_HOST_MODULE := true") |
| 82 | fmt.Fprintln(w, "LOCAL_MODULE_CLASS := JAVA_LIBRARIES") |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 83 | fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", library.implementationJarFile.String()) |
Colin Cross | 9243010 | 2017-10-09 14:59:32 -0700 | [diff] [blame] | 84 | if library.properties.Installable != nil && *library.properties.Installable == false { |
| 85 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true") |
| 86 | } |
| 87 | if library.dexJarFile != nil { |
| 88 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", library.dexJarFile.String()) |
| 89 | } |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 90 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", library.implementationJarFile.String()) |
Colin Cross | 9243010 | 2017-10-09 14:59:32 -0700 | [diff] [blame] | 91 | fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES := "+strings.Join(data.Required, " ")) |
| 92 | fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_java_prebuilt.mk") |
| 93 | } |
| 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, " ")) |
| 105 | } |
| 106 | }) |
| 107 | |
| 108 | return data |
| 109 | } |
| 110 | |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 111 | func (prebuilt *Import) AndroidMk() android.AndroidMkData { |
| 112 | return android.AndroidMkData{ |
| 113 | Class: "JAVA_LIBRARIES", |
| 114 | OutputFile: android.OptionalPathForPath(prebuilt.combinedClasspathFile), |
Colin Cross | 5349941 | 2017-09-07 13:20:25 -0700 | [diff] [blame] | 115 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 116 | Extra: []android.AndroidMkExtraFunc{ |
| 117 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | ff3ae9d | 2018-04-10 16:15:18 -0700 | [diff] [blame] | 118 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := ", !Bool(prebuilt.properties.Installable)) |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 119 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", prebuilt.combinedClasspathFile.String()) |
Nan Zhang | ea568a4 | 2017-11-08 21:20:04 -0800 | [diff] [blame] | 120 | fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", String(prebuilt.properties.Sdk_version)) |
Colin Cross | a18e9cf | 2017-08-10 17:00:19 -0700 | [diff] [blame] | 121 | }, |
| 122 | }, |
| 123 | } |
Dan Willemsen | 218f656 | 2015-07-08 18:13:11 -0700 | [diff] [blame] | 124 | } |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 125 | |
Colin Cross | fabb608 | 2018-02-20 17:22:23 -0800 | [diff] [blame] | 126 | func (prebuilt *AARImport) AndroidMk() android.AndroidMkData { |
| 127 | return android.AndroidMkData{ |
| 128 | Class: "JAVA_LIBRARIES", |
| 129 | OutputFile: android.OptionalPathForPath(prebuilt.classpathFile), |
| 130 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
| 131 | Extra: []android.AndroidMkExtraFunc{ |
| 132 | func(w io.Writer, outputFile android.Path) { |
| 133 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true") |
| 134 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT := false") |
| 135 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", prebuilt.classpathFile.String()) |
| 136 | fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", prebuilt.exportPackage.String()) |
| 137 | fmt.Fprintln(w, "LOCAL_SOONG_EXPORT_PROGUARD_FLAGS :=", prebuilt.proguardFlags.String()) |
| 138 | fmt.Fprintln(w, "LOCAL_SDK_VERSION :=", String(prebuilt.properties.Sdk_version)) |
| 139 | }, |
| 140 | }, |
| 141 | } |
| 142 | } |
| 143 | |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 144 | func (binary *Binary) AndroidMk() android.AndroidMkData { |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 145 | |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 146 | if !binary.isWrapperVariant { |
| 147 | return android.AndroidMkData{ |
| 148 | Class: "JAVA_LIBRARIES", |
| 149 | OutputFile: android.OptionalPathForPath(binary.implementationJarFile), |
| 150 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
| 151 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 152 | android.WriteAndroidMkData(w, data) |
Colin Cross | 1965568 | 2017-09-07 17:00:22 -0700 | [diff] [blame] | 153 | |
Colin Cross | 6b4a32d | 2017-12-05 13:42:45 -0800 | [diff] [blame] | 154 | fmt.Fprintln(w, "jar_installed_module := $(LOCAL_INSTALLED_MODULE)") |
| 155 | }, |
| 156 | } |
| 157 | } else { |
| 158 | return android.AndroidMkData{ |
| 159 | Class: "EXECUTABLES", |
| 160 | OutputFile: android.OptionalPathForPath(binary.wrapperFile), |
| 161 | Extra: []android.AndroidMkExtraFunc{ |
| 162 | func(w io.Writer, outputFile android.Path) { |
| 163 | fmt.Fprintln(w, "LOCAL_STRIP_MODULE := false") |
| 164 | }, |
| 165 | }, |
| 166 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 167 | android.WriteAndroidMkData(w, data) |
| 168 | |
| 169 | // Ensure that the wrapper script timestamp is always updated when the jar is updated |
| 170 | fmt.Fprintln(w, "$(LOCAL_INSTALLED_MODULE): $(jar_installed_module)") |
| 171 | fmt.Fprintln(w, "jar_installed_module :=") |
| 172 | }, |
| 173 | } |
Colin Cross | 10a0349 | 2017-08-10 17:09:43 -0700 | [diff] [blame] | 174 | } |
| 175 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 176 | |
| 177 | func (app *AndroidApp) AndroidMk() android.AndroidMkData { |
| 178 | return android.AndroidMkData{ |
| 179 | Class: "APPS", |
| 180 | OutputFile: android.OptionalPathForPath(app.outputFile), |
| 181 | Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", |
| 182 | Extra: []android.AndroidMkExtraFunc{ |
| 183 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 184 | fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", app.exportPackage.String()) |
| 185 | if app.dexJarFile != nil { |
| 186 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", app.dexJarFile.String()) |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 187 | } |
Colin Cross | 5dfabfb | 2017-12-14 13:19:01 -0800 | [diff] [blame] | 188 | if app.implementationJarFile != nil { |
| 189 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", app.implementationJarFile) |
| 190 | } |
| 191 | if app.headerJarFile != nil { |
| 192 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", app.headerJarFile.String()) |
| 193 | } |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 194 | if app.jacocoReportClassesFile != nil { |
| 195 | fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", app.jacocoReportClassesFile.String()) |
| 196 | } |
Colin Cross | 66dbc0b | 2017-12-28 12:23:20 -0800 | [diff] [blame] | 197 | if app.proguardDictionary != nil { |
| 198 | fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", app.proguardDictionary.String()) |
| 199 | } |
Colin Cross | 7079856 | 2017-12-13 22:42:59 -0800 | [diff] [blame] | 200 | |
| 201 | if app.Name() == "framework-res" { |
| 202 | fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") |
| 203 | // Make base_rules.mk not put framework-res in a subdirectory called |
| 204 | // framework_res. |
| 205 | fmt.Fprintln(w, "LOCAL_NO_STANDARD_LIBRARIES := true") |
| 206 | } |
| 207 | |
| 208 | if len(app.rroDirs) > 0 { |
| 209 | fmt.Fprintln(w, "LOCAL_SOONG_RRO_DIRS :=", strings.Join(app.rroDirs.Strings(), " ")) |
| 210 | } |
| 211 | |
| 212 | if Bool(app.appProperties.Export_package_resources) { |
| 213 | fmt.Fprintln(w, "LOCAL_EXPORT_PACKAGE_RESOURCES := true") |
| 214 | } |
| 215 | |
| 216 | fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", app.manifestPath.String()) |
| 217 | |
Colin Cross | 1605606 | 2017-12-13 22:46:28 -0800 | [diff] [blame] | 218 | if Bool(app.appProperties.Privileged) { |
| 219 | fmt.Fprintln(w, "LOCAL_PRIVILEGED_MODULE := true") |
| 220 | } |
Colin Cross | e1731a5 | 2017-12-14 11:22:55 -0800 | [diff] [blame] | 221 | |
| 222 | fmt.Fprintln(w, "LOCAL_CERTIFICATE :=", app.certificate.pem.String()) |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 223 | }, |
| 224 | }, |
| 225 | } |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame^] | 226 | } |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 227 | |
Colin Cross | a97c5d3 | 2018-03-28 14:58:31 -0700 | [diff] [blame^] | 228 | func (a *AndroidLibrary) AndroidMk() android.AndroidMkData { |
| 229 | data := a.Library.AndroidMk() |
| 230 | |
| 231 | data.Extra = append(data.Extra, func(w io.Writer, outputFile android.Path) { |
| 232 | if a.proguardDictionary != nil { |
| 233 | fmt.Fprintln(w, "LOCAL_SOONG_PROGUARD_DICT :=", a.proguardDictionary.String()) |
| 234 | } |
| 235 | |
| 236 | if a.Name() == "framework-res" { |
| 237 | fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") |
| 238 | // Make base_rules.mk not put framework-res in a subdirectory called |
| 239 | // framework_res. |
| 240 | fmt.Fprintln(w, "LOCAL_NO_STANDARD_LIBRARIES := true") |
| 241 | } |
| 242 | |
| 243 | fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", a.exportPackage.String()) |
| 244 | fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", a.manifestPath.String()) |
| 245 | fmt.Fprintln(w, "LOCAL_SOONG_EXPORT_PROGUARD_FLAGS :=", a.proguardOptionsFile.String()) |
| 246 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE := true") |
| 247 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT := false") |
| 248 | }) |
| 249 | |
| 250 | return data |
Colin Cross | 5ab4e6d | 2017-11-22 16:20:45 -0800 | [diff] [blame] | 251 | } |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 252 | |
| 253 | func (jd *Javadoc) AndroidMk() android.AndroidMkData { |
| 254 | return android.AndroidMkData{ |
| 255 | Class: "JAVA_LIBRARIES", |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 256 | OutputFile: android.OptionalPathForPath(jd.stubsSrcJar), |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 257 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
| 258 | Extra: []android.AndroidMkExtraFunc{ |
| 259 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | 38b40df | 2018-04-10 16:14:46 -0700 | [diff] [blame] | 260 | if BoolDefault(jd.properties.Installable, true) { |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 261 | fmt.Fprintln(w, "LOCAL_DROIDDOC_DOC_ZIP := ", jd.docZip.String()) |
| 262 | } |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 263 | if jd.stubsSrcJar != nil { |
| 264 | fmt.Fprintln(w, "LOCAL_DROIDDOC_STUBS_SRCJAR := ", jd.stubsSrcJar.String()) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 265 | } |
| 266 | }, |
| 267 | }, |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | func (ddoc *Droiddoc) AndroidMk() android.AndroidMkData { |
| 272 | return android.AndroidMkData{ |
| 273 | Class: "JAVA_LIBRARIES", |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 274 | OutputFile: android.OptionalPathForPath(ddoc.stubsSrcJar), |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 275 | Include: "$(BUILD_SYSTEM)/soong_java_prebuilt.mk", |
| 276 | Extra: []android.AndroidMkExtraFunc{ |
| 277 | func(w io.Writer, outputFile android.Path) { |
Colin Cross | 38b40df | 2018-04-10 16:14:46 -0700 | [diff] [blame] | 278 | if BoolDefault(ddoc.Javadoc.properties.Installable, true) { |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 279 | fmt.Fprintln(w, "LOCAL_DROIDDOC_DOC_ZIP := ", ddoc.Javadoc.docZip.String()) |
| 280 | } |
Nan Zhang | ccff0f7 | 2018-03-08 17:26:16 -0800 | [diff] [blame] | 281 | if ddoc.Javadoc.stubsSrcJar != nil { |
| 282 | fmt.Fprintln(w, "LOCAL_DROIDDOC_STUBS_SRCJAR := ", ddoc.Javadoc.stubsSrcJar.String()) |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 283 | } |
Nan Zhang | 28c68b9 | 2018-03-13 16:17:01 -0700 | [diff] [blame] | 284 | apiFilePrefix := "INTERNAL_PLATFORM_" |
| 285 | if String(ddoc.properties.Api_tag_name) != "" { |
| 286 | apiFilePrefix += String(ddoc.properties.Api_tag_name) + "_" |
| 287 | } |
| 288 | if String(ddoc.properties.Api_filename) != "" { |
| 289 | fmt.Fprintln(w, apiFilePrefix+"API_FILE := ", ddoc.apiFile.String()) |
| 290 | } |
| 291 | if String(ddoc.properties.Private_api_filename) != "" { |
| 292 | fmt.Fprintln(w, apiFilePrefix+"PRIVATE_API_FILE := ", ddoc.privateApiFile.String()) |
| 293 | } |
| 294 | if String(ddoc.properties.Private_dex_api_filename) != "" { |
| 295 | fmt.Fprintln(w, apiFilePrefix+"PRIVATE_DEX_API_FILE := ", ddoc.privateDexApiFile.String()) |
| 296 | } |
| 297 | if String(ddoc.properties.Removed_api_filename) != "" { |
| 298 | fmt.Fprintln(w, apiFilePrefix+"REMOVED_API_FILE := ", ddoc.removedApiFile.String()) |
| 299 | } |
| 300 | if String(ddoc.properties.Exact_api_filename) != "" { |
| 301 | fmt.Fprintln(w, apiFilePrefix+"EXACT_API_FILE := ", ddoc.exactApiFile.String()) |
| 302 | } |
Nan Zhang | 581fd21 | 2018-01-10 16:06:12 -0800 | [diff] [blame] | 303 | }, |
| 304 | }, |
| 305 | } |
| 306 | } |