Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 1 | // Copyright (C) 2019 The Android Open Source Project |
| 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 apex |
| 16 | |
| 17 | import ( |
| 18 | "fmt" |
| 19 | "io" |
| 20 | "path/filepath" |
| 21 | "strings" |
| 22 | |
| 23 | "android/soong/android" |
| 24 | "android/soong/cc" |
Jaewoong Jung | 87a33e7 | 2020-03-26 14:01:48 -0700 | [diff] [blame^] | 25 | "android/soong/java" |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 26 | |
| 27 | "github.com/google/blueprint/proptools" |
| 28 | ) |
| 29 | |
| 30 | func (a *apexBundle) AndroidMk() android.AndroidMkData { |
| 31 | if a.properties.HideFromMake { |
| 32 | return android.AndroidMkData{ |
| 33 | Disabled: true, |
| 34 | } |
| 35 | } |
| 36 | writers := []android.AndroidMkData{} |
| 37 | writers = append(writers, a.androidMkForType()) |
| 38 | return android.AndroidMkData{ |
| 39 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 40 | for _, data := range writers { |
| 41 | data.Custom(w, name, prefix, moduleDir, data) |
| 42 | } |
| 43 | }} |
| 44 | } |
| 45 | |
Jiyong Park | db33486 | 2020-02-05 17:19:28 +0900 | [diff] [blame] | 46 | func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, moduleDir string) []string { |
| 47 | // apexBundleName comes from the 'name' property; apexName comes from 'apex_name' property. |
| 48 | // An apex is installed to /system/apex/<apexBundleName> and is activated at /apex/<apexName> |
| 49 | // In many cases, the two names are the same, but could be different in general. |
| 50 | |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 51 | moduleNames := []string{} |
| 52 | apexType := a.properties.ApexType |
| 53 | // To avoid creating duplicate build rules, run this function only when primaryApexType is true |
| 54 | // to install symbol files in $(PRODUCT_OUT}/apex. |
| 55 | // And if apexType is flattened, run this function to install files in $(PRODUCT_OUT}/system/apex. |
| 56 | if !a.primaryApexType && apexType != flattenedApex { |
| 57 | return moduleNames |
| 58 | } |
| 59 | |
Jiyong Park | db33486 | 2020-02-05 17:19:28 +0900 | [diff] [blame] | 60 | // b/140136207. When there are overriding APEXes for a VNDK APEX, the symbols file for the overridden |
| 61 | // APEX and the overriding APEX will have the same installation paths at /apex/com.android.vndk.v<ver> |
| 62 | // as their apexName will be the same. To avoid the path conflicts, skip installing the symbol files |
| 63 | // for the overriding VNDK APEXes. |
| 64 | symbolFilesNotNeeded := a.vndkApex && len(a.overridableProperties.Overrides) > 0 |
| 65 | if symbolFilesNotNeeded && apexType != flattenedApex { |
| 66 | return moduleNames |
| 67 | } |
| 68 | |
Jiyong Park | 7cd10e3 | 2020-01-14 09:22:18 +0900 | [diff] [blame] | 69 | var postInstallCommands []string |
| 70 | for _, fi := range a.filesInfo { |
| 71 | if a.linkToSystemLib && fi.transitiveDep && fi.AvailableToPlatform() { |
| 72 | // TODO(jiyong): pathOnDevice should come from fi.module, not being calculated here |
| 73 | linkTarget := filepath.Join("/system", fi.Path()) |
Jiyong Park | db33486 | 2020-02-05 17:19:28 +0900 | [diff] [blame] | 74 | linkPath := filepath.Join(a.installDir.ToMakePath().String(), apexBundleName, fi.Path()) |
Jiyong Park | 7cd10e3 | 2020-01-14 09:22:18 +0900 | [diff] [blame] | 75 | mkdirCmd := "mkdir -p " + filepath.Dir(linkPath) |
| 76 | linkCmd := "ln -sfn " + linkTarget + " " + linkPath |
| 77 | postInstallCommands = append(postInstallCommands, mkdirCmd, linkCmd) |
| 78 | } |
| 79 | } |
Jiyong Park | 7cd10e3 | 2020-01-14 09:22:18 +0900 | [diff] [blame] | 80 | |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 81 | for _, fi := range a.filesInfo { |
| 82 | if cc, ok := fi.module.(*cc.Module); ok && cc.Properties.HideFromMake { |
| 83 | continue |
| 84 | } |
| 85 | |
Jiyong Park | 7cd10e3 | 2020-01-14 09:22:18 +0900 | [diff] [blame] | 86 | linkToSystemLib := a.linkToSystemLib && fi.transitiveDep && fi.AvailableToPlatform() |
| 87 | |
| 88 | var moduleName string |
| 89 | if linkToSystemLib { |
| 90 | moduleName = fi.moduleName |
| 91 | } else { |
Jiyong Park | db33486 | 2020-02-05 17:19:28 +0900 | [diff] [blame] | 92 | moduleName = fi.moduleName + "." + apexBundleName + a.suffix |
Jiyong Park | 7cd10e3 | 2020-01-14 09:22:18 +0900 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | if !android.InList(moduleName, moduleNames) { |
| 96 | moduleNames = append(moduleNames, moduleName) |
| 97 | } |
| 98 | |
| 99 | if linkToSystemLib { |
| 100 | // No need to copy the file since it's linked to the system file |
| 101 | continue |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)") |
Jiyong Park | 1833cef | 2019-12-13 13:28:36 +0900 | [diff] [blame] | 105 | if fi.moduleDir != "" { |
| 106 | fmt.Fprintln(w, "LOCAL_PATH :=", fi.moduleDir) |
| 107 | } else { |
| 108 | fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir) |
| 109 | } |
Jiyong Park | 7cd10e3 | 2020-01-14 09:22:18 +0900 | [diff] [blame] | 110 | fmt.Fprintln(w, "LOCAL_MODULE :=", moduleName) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 111 | // /apex/<apex_name>/{lib|framework|...} |
| 112 | pathWhenActivated := filepath.Join("$(PRODUCT_OUT)", "apex", apexName, fi.installDir) |
| 113 | if apexType == flattenedApex { |
| 114 | // /system/apex/<name>/{lib|framework|...} |
| 115 | fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", filepath.Join(a.installDir.ToMakePath().String(), |
Jiyong Park | db33486 | 2020-02-05 17:19:28 +0900 | [diff] [blame] | 116 | apexBundleName, fi.installDir)) |
| 117 | if a.primaryApexType && !symbolFilesNotNeeded { |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 118 | fmt.Fprintln(w, "LOCAL_SOONG_SYMBOL_PATH :=", pathWhenActivated) |
| 119 | } |
| 120 | if len(fi.symlinks) > 0 { |
| 121 | fmt.Fprintln(w, "LOCAL_MODULE_SYMLINKS :=", strings.Join(fi.symlinks, " ")) |
| 122 | } |
| 123 | |
Bob Badour | a75b057 | 2020-02-18 20:21:55 -0800 | [diff] [blame] | 124 | if fi.module != nil && len(fi.module.NoticeFiles()) > 0 { |
| 125 | fmt.Fprintln(w, "LOCAL_NOTICE_FILE :=", strings.Join(fi.module.NoticeFiles().Strings(), " ")) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 126 | } |
| 127 | } else { |
| 128 | fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", pathWhenActivated) |
Jiyong Park | 19972c7 | 2020-01-28 20:05:29 +0900 | [diff] [blame] | 129 | |
| 130 | // For non-flattend APEXes, the merged notice file is attached to the APEX itself. |
| 131 | // We don't need to have notice file for the individual modules in it. Otherwise, |
| 132 | // we will have duplicated notice entries. |
| 133 | fmt.Fprintln(w, "LOCAL_NO_NOTICE_FILE := true") |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 134 | } |
| 135 | fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", fi.builtFile.String()) |
| 136 | fmt.Fprintln(w, "LOCAL_MODULE_CLASS :=", fi.class.NameInMake()) |
| 137 | if fi.module != nil { |
| 138 | archStr := fi.module.Target().Arch.ArchType.String() |
| 139 | host := false |
| 140 | switch fi.module.Target().Os.Class { |
| 141 | case android.Host: |
| 142 | if fi.module.Target().Arch.ArchType != android.Common { |
| 143 | fmt.Fprintln(w, "LOCAL_MODULE_HOST_ARCH :=", archStr) |
| 144 | } |
| 145 | host = true |
| 146 | case android.HostCross: |
| 147 | if fi.module.Target().Arch.ArchType != android.Common { |
| 148 | fmt.Fprintln(w, "LOCAL_MODULE_HOST_CROSS_ARCH :=", archStr) |
| 149 | } |
| 150 | host = true |
| 151 | case android.Device: |
| 152 | if fi.module.Target().Arch.ArchType != android.Common { |
| 153 | fmt.Fprintln(w, "LOCAL_MODULE_TARGET_ARCH :=", archStr) |
| 154 | } |
| 155 | } |
| 156 | if host { |
| 157 | makeOs := fi.module.Target().Os.String() |
| 158 | if fi.module.Target().Os == android.Linux || fi.module.Target().Os == android.LinuxBionic { |
| 159 | makeOs = "linux" |
| 160 | } |
| 161 | fmt.Fprintln(w, "LOCAL_MODULE_HOST_OS :=", makeOs) |
| 162 | fmt.Fprintln(w, "LOCAL_IS_HOST_MODULE := true") |
| 163 | } |
| 164 | } |
Jiyong Park | 618922e | 2020-01-08 13:35:43 +0900 | [diff] [blame] | 165 | if fi.jacocoReportClassesFile != nil { |
| 166 | fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", fi.jacocoReportClassesFile.String()) |
| 167 | } |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 168 | if fi.class == javaSharedLib { |
Jooyung Han | 58f26ab | 2019-12-18 15:34:32 +0900 | [diff] [blame] | 169 | javaModule := fi.module.(javaLibrary) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 170 | // soong_java_prebuilt.mk sets LOCAL_MODULE_SUFFIX := .jar Therefore |
| 171 | // we need to remove the suffix from LOCAL_MODULE_STEM, otherwise |
| 172 | // we will have foo.jar.jar |
| 173 | fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", strings.TrimSuffix(fi.builtFile.Base(), ".jar")) |
| 174 | fmt.Fprintln(w, "LOCAL_SOONG_CLASSES_JAR :=", javaModule.ImplementationAndResourcesJars()[0].String()) |
| 175 | fmt.Fprintln(w, "LOCAL_SOONG_HEADER_JAR :=", javaModule.HeaderJars()[0].String()) |
| 176 | fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", fi.builtFile.String()) |
| 177 | fmt.Fprintln(w, "LOCAL_DEX_PREOPT := false") |
| 178 | fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_java_prebuilt.mk") |
Jiyong Park | 618922e | 2020-01-08 13:35:43 +0900 | [diff] [blame] | 179 | } else if fi.class == app { |
Colin Cross | 503c1d0 | 2020-01-28 14:00:53 -0800 | [diff] [blame] | 180 | fmt.Fprintln(w, "LOCAL_CERTIFICATE :=", fi.certificate.AndroidMkString()) |
Jiyong Park | 618922e | 2020-01-08 13:35:43 +0900 | [diff] [blame] | 181 | // soong_app_prebuilt.mk sets LOCAL_MODULE_SUFFIX := .apk Therefore |
| 182 | // we need to remove the suffix from LOCAL_MODULE_STEM, otherwise |
| 183 | // we will have foo.apk.apk |
| 184 | fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", strings.TrimSuffix(fi.builtFile.Base(), ".apk")) |
Jaewoong Jung | 87a33e7 | 2020-03-26 14:01:48 -0700 | [diff] [blame^] | 185 | if app, ok := fi.module.(*java.AndroidApp); ok && len(app.JniCoverageOutputs()) > 0 { |
| 186 | fmt.Fprintln(w, "LOCAL_PREBUILT_COVERAGE_ARCHIVE :=", strings.Join(app.JniCoverageOutputs().Strings(), " ")) |
| 187 | } |
Jiyong Park | 618922e | 2020-01-08 13:35:43 +0900 | [diff] [blame] | 188 | fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_app_prebuilt.mk") |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 189 | } else if fi.class == nativeSharedLib || fi.class == nativeExecutable || fi.class == nativeTest { |
| 190 | fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", fi.builtFile.Base()) |
| 191 | if cc, ok := fi.module.(*cc.Module); ok { |
| 192 | if cc.UnstrippedOutputFile() != nil { |
| 193 | fmt.Fprintln(w, "LOCAL_SOONG_UNSTRIPPED_BINARY :=", cc.UnstrippedOutputFile().String()) |
| 194 | } |
| 195 | cc.AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w) |
| 196 | if cc.CoverageOutputFile().Valid() { |
| 197 | fmt.Fprintln(w, "LOCAL_PREBUILT_COVERAGE_ARCHIVE :=", cc.CoverageOutputFile().String()) |
| 198 | } |
| 199 | } |
| 200 | fmt.Fprintln(w, "include $(BUILD_SYSTEM)/soong_cc_prebuilt.mk") |
| 201 | } else { |
| 202 | fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", fi.builtFile.Base()) |
Jiyong Park | 7aa3f76 | 2020-01-28 16:51:34 +0900 | [diff] [blame] | 203 | if fi.builtFile == a.manifestPbOut && apexType == flattenedApex { |
Jooyung Han | 75de261 | 2020-01-24 02:02:45 +0900 | [diff] [blame] | 204 | if a.primaryApexType { |
| 205 | // Make apex_manifest.pb module for this APEX to override all other |
| 206 | // modules in the APEXes being overridden by this APEX |
| 207 | var patterns []string |
| 208 | for _, o := range a.overridableProperties.Overrides { |
| 209 | patterns = append(patterns, "%."+o+a.suffix) |
| 210 | } |
| 211 | fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(patterns, " ")) |
Jiyong Park | 0abc1b4 | 2020-01-09 17:43:39 +0900 | [diff] [blame] | 212 | |
Jiyong Park | 7aa3f76 | 2020-01-28 16:51:34 +0900 | [diff] [blame] | 213 | if len(a.compatSymlinks) > 0 { |
Jooyung Han | 75de261 | 2020-01-24 02:02:45 +0900 | [diff] [blame] | 214 | // For flattened apexes, compat symlinks are attached to apex_manifest.json which is guaranteed for every apex |
| 215 | postInstallCommands = append(postInstallCommands, a.compatSymlinks...) |
| 216 | } |
| 217 | } |
| 218 | if len(postInstallCommands) > 0 { |
Jiyong Park | 7cd10e3 | 2020-01-14 09:22:18 +0900 | [diff] [blame] | 219 | fmt.Fprintln(w, "LOCAL_POST_INSTALL_CMD :=", strings.Join(postInstallCommands, " && ")) |
Jiyong Park | 0abc1b4 | 2020-01-09 17:43:39 +0900 | [diff] [blame] | 220 | } |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 221 | } |
| 222 | fmt.Fprintln(w, "include $(BUILD_PREBUILT)") |
| 223 | } |
Jiyong Park | 31af267 | 2020-02-11 09:36:25 +0900 | [diff] [blame] | 224 | |
| 225 | // m <module_name> will build <module_name>.<apex_name> as well. |
| 226 | if fi.moduleName != moduleName && a.primaryApexType { |
| 227 | fmt.Fprintln(w, ".PHONY: "+fi.moduleName) |
| 228 | fmt.Fprintln(w, fi.moduleName+": "+moduleName) |
| 229 | } |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 230 | } |
| 231 | return moduleNames |
| 232 | } |
| 233 | |
Jiyong Park | 7afd107 | 2019-12-30 16:56:33 +0900 | [diff] [blame] | 234 | func (a *apexBundle) writeRequiredModules(w io.Writer) { |
| 235 | var required []string |
| 236 | var targetRequired []string |
| 237 | var hostRequired []string |
| 238 | for _, fi := range a.filesInfo { |
| 239 | required = append(required, fi.requiredModuleNames...) |
| 240 | targetRequired = append(targetRequired, fi.targetRequiredModuleNames...) |
| 241 | hostRequired = append(hostRequired, fi.hostRequiredModuleNames...) |
| 242 | } |
| 243 | |
| 244 | if len(required) > 0 { |
| 245 | fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(required, " ")) |
| 246 | } |
| 247 | if len(targetRequired) > 0 { |
| 248 | fmt.Fprintln(w, "LOCAL_TARGET_REQUIRED_MODULES +=", strings.Join(targetRequired, " ")) |
| 249 | } |
| 250 | if len(hostRequired) > 0 { |
| 251 | fmt.Fprintln(w, "LOCAL_HOST_REQUIRED_MODULES +=", strings.Join(hostRequired, " ")) |
| 252 | } |
| 253 | } |
| 254 | |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 255 | func (a *apexBundle) androidMkForType() android.AndroidMkData { |
| 256 | return android.AndroidMkData{ |
| 257 | Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) { |
| 258 | moduleNames := []string{} |
| 259 | apexType := a.properties.ApexType |
| 260 | if a.installable() { |
| 261 | apexName := proptools.StringDefault(a.properties.Apex_name, name) |
Jiyong Park | db33486 | 2020-02-05 17:19:28 +0900 | [diff] [blame] | 262 | moduleNames = a.androidMkForFiles(w, name, apexName, moduleDir) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | if apexType == flattenedApex { |
| 266 | // Only image APEXes can be flattened. |
| 267 | fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)") |
| 268 | fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir) |
| 269 | fmt.Fprintln(w, "LOCAL_MODULE :=", name+a.suffix) |
| 270 | if len(moduleNames) > 0 { |
| 271 | fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", strings.Join(moduleNames, " ")) |
| 272 | } |
Jiyong Park | 7afd107 | 2019-12-30 16:56:33 +0900 | [diff] [blame] | 273 | a.writeRequiredModules(w) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 274 | fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)") |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 275 | |
| 276 | } else { |
| 277 | fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)") |
| 278 | fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir) |
| 279 | fmt.Fprintln(w, "LOCAL_MODULE :=", name+a.suffix) |
| 280 | fmt.Fprintln(w, "LOCAL_MODULE_CLASS := ETC") // do we need a new class? |
| 281 | fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", a.outputFile.String()) |
| 282 | fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", a.installDir.ToMakePath().String()) |
| 283 | fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", name+apexType.suffix()) |
| 284 | fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !a.installable()) |
Jaewoong Jung | 7abcf8e | 2019-12-19 17:32:06 -0800 | [diff] [blame] | 285 | fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(a.overridableProperties.Overrides, " ")) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 286 | if len(moduleNames) > 0 { |
| 287 | fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(moduleNames, " ")) |
| 288 | } |
Jiyong Park | 956305c | 2020-01-09 12:32:06 +0900 | [diff] [blame] | 289 | if len(a.requiredDeps) > 0 { |
| 290 | fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(a.requiredDeps, " ")) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 291 | } |
Jiyong Park | 7afd107 | 2019-12-30 16:56:33 +0900 | [diff] [blame] | 292 | a.writeRequiredModules(w) |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 293 | var postInstallCommands []string |
| 294 | if a.prebuiltFileToDelete != "" { |
| 295 | postInstallCommands = append(postInstallCommands, "rm -rf "+ |
| 296 | filepath.Join(a.installDir.ToMakePath().String(), a.prebuiltFileToDelete)) |
| 297 | } |
| 298 | // For unflattened apexes, compat symlinks are attached to apex package itself as LOCAL_POST_INSTALL_CMD |
| 299 | postInstallCommands = append(postInstallCommands, a.compatSymlinks...) |
| 300 | if len(postInstallCommands) > 0 { |
| 301 | fmt.Fprintln(w, "LOCAL_POST_INSTALL_CMD :=", strings.Join(postInstallCommands, " && ")) |
| 302 | } |
Jiyong Park | 19972c7 | 2020-01-28 20:05:29 +0900 | [diff] [blame] | 303 | |
| 304 | if a.mergedNotices.Merged.Valid() { |
| 305 | fmt.Fprintln(w, "LOCAL_NOTICE_FILE :=", a.mergedNotices.Merged.Path().String()) |
| 306 | } |
| 307 | |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 308 | fmt.Fprintln(w, "include $(BUILD_PREBUILT)") |
| 309 | |
| 310 | if apexType == imageApex { |
| 311 | fmt.Fprintln(w, "ALL_MODULES.$(LOCAL_MODULE).BUNDLE :=", a.bundleModuleFile.String()) |
| 312 | } |
Jiyong Park | 3a1602e | 2020-01-14 14:39:19 +0900 | [diff] [blame] | 313 | |
| 314 | if a.installedFilesFile != nil { |
Colin Cross | 1c85e8e | 2020-02-26 16:55:51 -0800 | [diff] [blame] | 315 | goal := "checkbuild" |
Jiyong Park | 3a1602e | 2020-01-14 14:39:19 +0900 | [diff] [blame] | 316 | distFile := name + "-installed-files.txt" |
| 317 | fmt.Fprintln(w, ".PHONY:", goal) |
| 318 | fmt.Fprintf(w, "$(call dist-for-goals,%s,%s:%s)\n", |
| 319 | goal, a.installedFilesFile.String(), distFile) |
| 320 | } |
Jiyong Park | 09d7752 | 2019-11-18 11:16:27 +0900 | [diff] [blame] | 321 | } |
| 322 | }} |
| 323 | } |