blob: 6d7b3ecba18f248b900134e260aca0bd8bc5e1a2 [file] [log] [blame]
Jiyong Park9b409bc2019-10-11 14:59:13 +09001// 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
15package sdk
16
17import (
18 "fmt"
Jiyong Park9b409bc2019-10-11 14:59:13 +090019 "path/filepath"
Jiyong Park9b409bc2019-10-11 14:59:13 +090020 "strings"
21
22 "github.com/google/blueprint/proptools"
23
24 "android/soong/android"
Jiyong Park73c54ee2019-10-22 20:31:18 +090025 "android/soong/cc"
Jiyong Park9b409bc2019-10-11 14:59:13 +090026 "android/soong/java"
27)
28
29var pctx = android.NewPackageContext("android/soong/sdk")
30
31// generatedFile abstracts operations for writing contents into a file and emit a build rule
32// for the file.
33type generatedFile struct {
Jiyong Park73c54ee2019-10-22 20:31:18 +090034 path android.OutputPath
35 content strings.Builder
36 indentLevel int
Jiyong Park9b409bc2019-10-11 14:59:13 +090037}
38
Jiyong Park232e7852019-11-04 12:23:40 +090039func newGeneratedFile(ctx android.ModuleContext, path ...string) *generatedFile {
Jiyong Park9b409bc2019-10-11 14:59:13 +090040 return &generatedFile{
Jiyong Park232e7852019-11-04 12:23:40 +090041 path: android.PathForModuleOut(ctx, path...).OutputPath,
Jiyong Park73c54ee2019-10-22 20:31:18 +090042 indentLevel: 0,
Jiyong Park9b409bc2019-10-11 14:59:13 +090043 }
44}
45
Paul Duffin0e0cf1d2019-11-12 19:39:25 +000046func (gf *generatedFile) Indent() {
Jiyong Park73c54ee2019-10-22 20:31:18 +090047 gf.indentLevel++
48}
49
Paul Duffin0e0cf1d2019-11-12 19:39:25 +000050func (gf *generatedFile) Dedent() {
Jiyong Park73c54ee2019-10-22 20:31:18 +090051 gf.indentLevel--
52}
53
Paul Duffin0e0cf1d2019-11-12 19:39:25 +000054func (gf *generatedFile) Printfln(format string, args ...interface{}) {
Jiyong Park9b409bc2019-10-11 14:59:13 +090055 // ninja consumes newline characters in rspfile_content. Prevent it by
Paul Duffin0e0cf1d2019-11-12 19:39:25 +000056 // escaping the backslash in the newline character. The extra backslash
Jiyong Park9b409bc2019-10-11 14:59:13 +090057 // is removed when the rspfile is written to the actual script file
Jiyong Park73c54ee2019-10-22 20:31:18 +090058 fmt.Fprintf(&(gf.content), strings.Repeat(" ", gf.indentLevel)+format+"\\n", args...)
Jiyong Park9b409bc2019-10-11 14:59:13 +090059}
60
61func (gf *generatedFile) build(pctx android.PackageContext, ctx android.BuilderContext, implicits android.Paths) {
62 rb := android.NewRuleBuilder()
63 // convert \\n to \n
64 rb.Command().
65 Implicits(implicits).
66 Text("echo").Text(proptools.ShellEscape(gf.content.String())).
67 Text("| sed 's/\\\\n/\\n/g' >").Output(gf.path)
68 rb.Command().
69 Text("chmod a+x").Output(gf.path)
70 rb.Build(pctx, ctx, gf.path.Base(), "Build "+gf.path.Base())
71}
72
Paul Duffin0e0cf1d2019-11-12 19:39:25 +000073func (s *sdk) javaLibs(ctx android.ModuleContext) []android.SdkAware {
74 result := []android.SdkAware{}
Jiyong Park9b409bc2019-10-11 14:59:13 +090075 ctx.VisitDirectDeps(func(m android.Module) {
Jiyong Park73c54ee2019-10-22 20:31:18 +090076 if j, ok := m.(*java.Library); ok {
77 result = append(result, j)
Jiyong Park9b409bc2019-10-11 14:59:13 +090078 }
79 })
80 return result
81}
82
Paul Duffin91547182019-11-12 19:39:36 +000083func (s *sdk) stubsSources(ctx android.ModuleContext) []android.SdkAware {
84 result := []android.SdkAware{}
85 ctx.VisitDirectDeps(func(m android.Module) {
86 if j, ok := m.(*java.Droidstubs); ok {
87 result = append(result, j)
88 }
89 })
90 return result
91}
92
Jiyong Park73c54ee2019-10-22 20:31:18 +090093// archSpecificNativeLibInfo represents an arch-specific variant of a native lib
94type archSpecificNativeLibInfo struct {
95 name string
96 archType string
97 exportedIncludeDirs android.Paths
98 exportedSystemIncludeDirs android.Paths
99 exportedFlags []string
Jiyong Park232e7852019-11-04 12:23:40 +0900100 exportedDeps android.Paths
Jiyong Park73c54ee2019-10-22 20:31:18 +0900101 outputFile android.Path
102}
Jiyong Park9b409bc2019-10-11 14:59:13 +0900103
Jiyong Park73c54ee2019-10-22 20:31:18 +0900104func (lib *archSpecificNativeLibInfo) signature() string {
105 return fmt.Sprintf("%v %v %v %v",
106 lib.name,
107 lib.exportedIncludeDirs.Strings(),
108 lib.exportedSystemIncludeDirs.Strings(),
109 lib.exportedFlags)
110}
111
112// nativeLibInfo represents a collection of arch-specific modules having the same name
113type nativeLibInfo struct {
114 name string
115 archVariants []archSpecificNativeLibInfo
116 // hasArchSpecificFlags is set to true if modules for each architecture all have the same
117 // include dirs, flags, etc, in which case only those of the first arch is selected.
118 hasArchSpecificFlags bool
119}
120
121// nativeMemberInfos collects all cc.Modules that are member of an SDK.
122func (s *sdk) nativeMemberInfos(ctx android.ModuleContext) []*nativeLibInfo {
123 infoMap := make(map[string]*nativeLibInfo)
124
125 // Collect cc.Modules
126 ctx.VisitDirectDeps(func(m android.Module) {
127 ccModule, ok := m.(*cc.Module)
128 if !ok {
129 return
130 }
131 depName := ctx.OtherModuleName(m)
132
133 if _, ok := infoMap[depName]; !ok {
134 infoMap[depName] = &nativeLibInfo{name: depName}
135 }
136
137 info := infoMap[depName]
138 info.archVariants = append(info.archVariants, archSpecificNativeLibInfo{
139 name: ccModule.BaseModuleName(),
140 archType: ccModule.Target().Arch.ArchType.String(),
141 exportedIncludeDirs: ccModule.ExportedIncludeDirs(),
142 exportedSystemIncludeDirs: ccModule.ExportedSystemIncludeDirs(),
143 exportedFlags: ccModule.ExportedFlags(),
Jiyong Park232e7852019-11-04 12:23:40 +0900144 exportedDeps: ccModule.ExportedDeps(),
Jiyong Park73c54ee2019-10-22 20:31:18 +0900145 outputFile: ccModule.OutputFile().Path(),
146 })
147 })
148
149 // Determine if include dirs and flags for each module are different across arch-specific
150 // modules or not. And set hasArchSpecificFlags accordingly
151 for _, info := range infoMap {
152 // by default, include paths and flags are assumed to be the same across arches
153 info.hasArchSpecificFlags = false
154 oldSignature := ""
155 for _, av := range info.archVariants {
156 newSignature := av.signature()
157 if oldSignature == "" {
158 oldSignature = newSignature
159 }
160 if oldSignature != newSignature {
161 info.hasArchSpecificFlags = true
162 break
163 }
164 }
Jiyong Park9b409bc2019-10-11 14:59:13 +0900165 }
166
Jiyong Park73c54ee2019-10-22 20:31:18 +0900167 var list []*nativeLibInfo
168 for _, v := range infoMap {
169 list = append(list, v)
170 }
171 return list
172}
Jiyong Park9b409bc2019-10-11 14:59:13 +0900173
Jiyong Park73c54ee2019-10-22 20:31:18 +0900174// SDK directory structure
175// <sdk_root>/
176// Android.bp : definition of a 'sdk' module is here. This is a hand-made one.
177// <api_ver>/ : below this directory are all auto-generated
178// Android.bp : definition of 'sdk_snapshot' module is here
179// aidl/
180// frameworks/base/core/..../IFoo.aidl : an exported AIDL file
181// java/
Jiyong Park232e7852019-11-04 12:23:40 +0900182// <module_name>.jar : the stub jar for a java library 'module_name'
Jiyong Park73c54ee2019-10-22 20:31:18 +0900183// include/
184// bionic/libc/include/stdlib.h : an exported header file
185// include_gen/
Jiyong Park232e7852019-11-04 12:23:40 +0900186// <module_name>/com/android/.../IFoo.h : a generated header file
Jiyong Park73c54ee2019-10-22 20:31:18 +0900187// <arch>/include/ : arch-specific exported headers
188// <arch>/include_gen/ : arch-specific generated headers
189// <arch>/lib/
190// libFoo.so : a stub library
191
192const (
Jiyong Park73c54ee2019-10-22 20:31:18 +0900193 nativeIncludeDir = "include"
194 nativeGeneratedIncludeDir = "include_gen"
195 nativeStubDir = "lib"
196 nativeStubFileSuffix = ".so"
197)
198
Jiyong Park73c54ee2019-10-22 20:31:18 +0900199// path to the stub file of a native shared library. Relative to <sdk_root>/<api_dir>
200func nativeStubFilePathFor(lib archSpecificNativeLibInfo) string {
201 return filepath.Join(lib.archType,
202 nativeStubDir, lib.name+nativeStubFileSuffix)
203}
204
205// paths to the include dirs of a native shared library. Relative to <sdk_root>/<api_dir>
206func nativeIncludeDirPathsFor(ctx android.ModuleContext, lib archSpecificNativeLibInfo,
207 systemInclude bool, archSpecific bool) []string {
208 var result []string
Jiyong Park73c54ee2019-10-22 20:31:18 +0900209 var includeDirs []android.Path
210 if !systemInclude {
211 includeDirs = lib.exportedIncludeDirs
212 } else {
213 includeDirs = lib.exportedSystemIncludeDirs
214 }
215 for _, dir := range includeDirs {
216 var path string
Jiyong Park232e7852019-11-04 12:23:40 +0900217 if _, gen := dir.(android.WritablePath); gen {
218 path = filepath.Join(nativeGeneratedIncludeDir, lib.name)
Jiyong Park73c54ee2019-10-22 20:31:18 +0900219 } else {
220 path = filepath.Join(nativeIncludeDir, dir.String())
221 }
222 if archSpecific {
223 path = filepath.Join(lib.archType, path)
224 }
225 result = append(result, path)
226 }
227 return result
228}
229
Jiyong Park232e7852019-11-04 12:23:40 +0900230// A name that uniquely identifies a prebuilt SDK member for a version of SDK snapshot
Jiyong Park73c54ee2019-10-22 20:31:18 +0900231// This isn't visible to users, so could be changed in future.
232func versionedSdkMemberName(ctx android.ModuleContext, memberName string, version string) string {
233 return ctx.ModuleName() + "_" + memberName + string(android.SdkVersionSeparator) + version
234}
235
Jiyong Park232e7852019-11-04 12:23:40 +0900236// buildSnapshot is the main function in this source file. It creates rules to copy
237// the contents (header files, stub libraries, etc) into the zip file.
238func (s *sdk) buildSnapshot(ctx android.ModuleContext) android.OutputPath {
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000239 snapshotDir := android.PathForModuleOut(ctx, "snapshot")
Jiyong Park9b409bc2019-10-11 14:59:13 +0900240
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000241 bp := newGeneratedFile(ctx, "snapshot", "Android.bp")
242 bp.Printfln("// This is auto-generated. DO NOT EDIT.")
243 bp.Printfln("")
244
245 builder := &snapshotBuilder{
246 ctx: ctx,
247 version: "current",
248 snapshotDir: snapshotDir.OutputPath,
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000249 filesToZip: []android.Path{bp.path},
Paul Duffin91547182019-11-12 19:39:36 +0000250 androidBpFile: bp,
Jiyong Park73c54ee2019-10-22 20:31:18 +0900251 }
Jiyong Park9b409bc2019-10-11 14:59:13 +0900252
Jiyong Park232e7852019-11-04 12:23:40 +0900253 // copy exported AIDL files and stub jar files
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000254 javaLibs := s.javaLibs(ctx)
255 for _, m := range javaLibs {
256 m.BuildSnapshot(ctx, builder)
Jiyong Park73c54ee2019-10-22 20:31:18 +0900257 }
258
Paul Duffin91547182019-11-12 19:39:36 +0000259 // copy stubs sources
260 stubsSources := s.stubsSources(ctx)
261 for _, m := range stubsSources {
262 m.BuildSnapshot(ctx, builder)
263 }
264
Jiyong Park232e7852019-11-04 12:23:40 +0900265 // copy exported header files and stub *.so files
Jiyong Park73c54ee2019-10-22 20:31:18 +0900266 nativeLibInfos := s.nativeMemberInfos(ctx)
267 for _, info := range nativeLibInfos {
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000268 buildSharedNativeLibSnapshot(ctx, info, builder)
Jiyong Park73c54ee2019-10-22 20:31:18 +0900269 }
Jiyong Park9b409bc2019-10-11 14:59:13 +0900270
Jiyong Park232e7852019-11-04 12:23:40 +0900271 // generate Android.bp
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000272
273 bp.Printfln("sdk_snapshot {")
274 bp.Indent()
275 bp.Printfln("name: %q,", ctx.ModuleName()+string(android.SdkVersionSeparator)+builder.version)
276 if len(javaLibs) > 0 {
277 bp.Printfln("java_libs: [")
278 bp.Indent()
279 for _, m := range javaLibs {
280 bp.Printfln("%q,", builder.VersionedSdkMemberName(m.Name()))
281 }
282 bp.Dedent()
283 bp.Printfln("],") // java_libs
284 }
Paul Duffin91547182019-11-12 19:39:36 +0000285 if len(stubsSources) > 0 {
286 bp.Printfln("stubs_sources: [")
287 bp.Indent()
288 for _, m := range stubsSources {
289 bp.Printfln("%q,", builder.VersionedSdkMemberName(m.Name()))
290 }
291 bp.Dedent()
292 bp.Printfln("],") // stubs_sources
293 }
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000294 if len(nativeLibInfos) > 0 {
295 bp.Printfln("native_shared_libs: [")
296 bp.Indent()
297 for _, info := range nativeLibInfos {
298 bp.Printfln("%q,", builder.VersionedSdkMemberName(info.name))
299 }
300 bp.Dedent()
301 bp.Printfln("],") // native_shared_libs
302 }
303 bp.Dedent()
304 bp.Printfln("}") // sdk_snapshot
305 bp.Printfln("")
306
307 bp.build(pctx, ctx, nil)
308
309 filesToZip := builder.filesToZip
Jiyong Park9b409bc2019-10-11 14:59:13 +0900310
Jiyong Park232e7852019-11-04 12:23:40 +0900311 // zip them all
Paul Duffin91547182019-11-12 19:39:36 +0000312 outputZipFile := android.PathForModuleOut(ctx, ctx.ModuleName()+"-current.zip").OutputPath
313 outputRuleName := "snapshot"
314 outputDesc := "Building snapshot for " + ctx.ModuleName()
315
316 // If there are no zips to merge then generate the output zip directly.
317 // Otherwise, generate an intermediate zip file into which other zips can be
318 // merged.
319 var zipFile android.OutputPath
320 var ruleName string
321 var desc string
322 if len(builder.zipsToMerge) == 0 {
323 zipFile = outputZipFile
324 ruleName = outputRuleName
325 desc = outputDesc
326 } else {
327 zipFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"-current.unmerged.zip").OutputPath
328 ruleName = "intermediate snapshot"
329 desc = "Building intermediate snapshot for " + ctx.ModuleName()
330 }
331
Jiyong Park232e7852019-11-04 12:23:40 +0900332 rb := android.NewRuleBuilder()
333 rb.Command().
334 BuiltTool(ctx, "soong_zip").
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000335 FlagWithArg("-C ", builder.snapshotDir.String()).
Jiyong Park232e7852019-11-04 12:23:40 +0900336 FlagWithRspFileInputList("-l ", filesToZip).
337 FlagWithOutput("-o ", zipFile)
Paul Duffin91547182019-11-12 19:39:36 +0000338 rb.Build(pctx, ctx, ruleName, desc)
Jiyong Park9b409bc2019-10-11 14:59:13 +0900339
Paul Duffin91547182019-11-12 19:39:36 +0000340 if len(builder.zipsToMerge) != 0 {
341 rb := android.NewRuleBuilder()
342 rb.Command().
343 BuiltTool(ctx, "merge_zips").
344 Output(outputZipFile).
345 Input(zipFile).
346 Inputs(builder.zipsToMerge)
347 rb.Build(pctx, ctx, outputRuleName, outputDesc)
348 }
349
350 return outputZipFile
Jiyong Park9b409bc2019-10-11 14:59:13 +0900351}
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000352
353func buildSharedNativeLibSnapshot(ctx android.ModuleContext, info *nativeLibInfo, builder android.SnapshotBuilder) {
354 // a function for emitting include dirs
355 printExportedDirCopyCommandsForNativeLibs := func(lib archSpecificNativeLibInfo) {
356 includeDirs := lib.exportedIncludeDirs
357 includeDirs = append(includeDirs, lib.exportedSystemIncludeDirs...)
358 if len(includeDirs) == 0 {
359 return
360 }
361 for _, dir := range includeDirs {
362 if _, gen := dir.(android.WritablePath); gen {
363 // generated headers are copied via exportedDeps. See below.
364 continue
365 }
366 targetDir := nativeIncludeDir
367 if info.hasArchSpecificFlags {
368 targetDir = filepath.Join(lib.archType, targetDir)
369 }
370
371 // TODO(jiyong) copy headers having other suffixes
372 headers, _ := ctx.GlobWithDeps(dir.String()+"/**/*.h", nil)
373 for _, file := range headers {
374 src := android.PathForSource(ctx, file)
375 dest := filepath.Join(targetDir, file)
376 builder.CopyToSnapshot(src, dest)
377 }
378 }
379
380 genHeaders := lib.exportedDeps
381 for _, file := range genHeaders {
382 targetDir := nativeGeneratedIncludeDir
383 if info.hasArchSpecificFlags {
384 targetDir = filepath.Join(lib.archType, targetDir)
385 }
386 dest := filepath.Join(targetDir, lib.name, file.Rel())
387 builder.CopyToSnapshot(file, dest)
388 }
389 }
390
391 if !info.hasArchSpecificFlags {
392 printExportedDirCopyCommandsForNativeLibs(info.archVariants[0])
393 }
394
395 // for each architecture
396 for _, av := range info.archVariants {
397 builder.CopyToSnapshot(av.outputFile, nativeStubFilePathFor(av))
398
399 if info.hasArchSpecificFlags {
400 printExportedDirCopyCommandsForNativeLibs(av)
401 }
402 }
403
Paul Duffin90102502019-11-25 19:49:33 +0000404 info.generatePrebuiltLibrary(ctx, builder, true)
405
406 // This module is for the case when the source tree for the unversioned module
407 // doesn't exist (i.e. building in an unbundled tree). "prefer:" is set to false
408 // so that this module does not eclipse the unversioned module if it exists.
409 info.generatePrebuiltLibrary(ctx, builder, false)
410}
411
412func (info *nativeLibInfo) generatePrebuiltLibrary(ctx android.ModuleContext, builder android.SnapshotBuilder, versioned bool) {
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000413 bp := builder.AndroidBpFile()
414 bp.Printfln("cc_prebuilt_library_shared {")
415 bp.Indent()
Paul Duffin90102502019-11-25 19:49:33 +0000416 name := info.name
417 if versioned {
418 bp.Printfln("name: %q,", builder.VersionedSdkMemberName(name))
419 bp.Printfln("sdk_member_name: %q,", name)
420 } else {
421 bp.Printfln("name: %q,", name)
422 bp.Printfln("prefer: false,")
423 }
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000424
425 // a function for emitting include dirs
426 printExportedDirsForNativeLibs := func(lib archSpecificNativeLibInfo, systemInclude bool) {
427 includeDirs := nativeIncludeDirPathsFor(ctx, lib, systemInclude, info.hasArchSpecificFlags)
428 if len(includeDirs) == 0 {
429 return
430 }
431 if !systemInclude {
432 bp.Printfln("export_include_dirs: [")
433 } else {
434 bp.Printfln("export_system_include_dirs: [")
435 }
436 bp.Indent()
437 for _, dir := range includeDirs {
438 bp.Printfln("%q,", dir)
439 }
440 bp.Dedent()
441 bp.Printfln("],")
442 }
443
444 if !info.hasArchSpecificFlags {
445 printExportedDirsForNativeLibs(info.archVariants[0], false /*systemInclude*/)
446 printExportedDirsForNativeLibs(info.archVariants[0], true /*systemInclude*/)
447 }
448
449 bp.Printfln("arch: {")
450 bp.Indent()
451 for _, av := range info.archVariants {
452 bp.Printfln("%s: {", av.archType)
453 bp.Indent()
454 bp.Printfln("srcs: [%q],", nativeStubFilePathFor(av))
455 if info.hasArchSpecificFlags {
456 // export_* properties are added inside the arch: {<arch>: {...}} block
457 printExportedDirsForNativeLibs(av, false /*systemInclude*/)
458 printExportedDirsForNativeLibs(av, true /*systemInclude*/)
459 }
460 bp.Dedent()
461 bp.Printfln("},") // <arch>
462 }
463 bp.Dedent()
464 bp.Printfln("},") // arch
465 bp.Printfln("stl: \"none\",")
466 bp.Printfln("system_shared_libs: [],")
467 bp.Dedent()
468 bp.Printfln("}") // cc_prebuilt_library_shared
469 bp.Printfln("")
470}
471
472type snapshotBuilder struct {
473 ctx android.ModuleContext
474 version string
475 snapshotDir android.OutputPath
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000476 androidBpFile *generatedFile
Paul Duffin91547182019-11-12 19:39:36 +0000477 filesToZip android.Paths
478 zipsToMerge android.Paths
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000479}
480
481func (s *snapshotBuilder) CopyToSnapshot(src android.Path, dest string) {
482 path := s.snapshotDir.Join(s.ctx, dest)
483 s.ctx.Build(pctx, android.BuildParams{
484 Rule: android.Cp,
485 Input: src,
486 Output: path,
487 })
488 s.filesToZip = append(s.filesToZip, path)
489}
490
Paul Duffin91547182019-11-12 19:39:36 +0000491func (s *snapshotBuilder) UnzipToSnapshot(zipPath android.Path, destDir string) {
492 ctx := s.ctx
493
494 // Repackage the zip file so that the entries are in the destDir directory.
495 // This will allow the zip file to be merged into the snapshot.
496 tmpZipPath := android.PathForModuleOut(ctx, "tmp", destDir+".zip").OutputPath
497 rb := android.NewRuleBuilder()
498 rb.Command().
499 BuiltTool(ctx, "zip2zip").
500 FlagWithInput("-i ", zipPath).
501 FlagWithOutput("-o ", tmpZipPath).
502 Flag("**/*:" + destDir)
503 rb.Build(pctx, ctx, "repackaging "+destDir,
504 "Repackaging zip file "+destDir+" for snapshot "+ctx.ModuleName())
505
506 // Add the repackaged zip file to the files to merge.
507 s.zipsToMerge = append(s.zipsToMerge, tmpZipPath)
508}
509
Paul Duffin0e0cf1d2019-11-12 19:39:25 +0000510func (s *snapshotBuilder) AndroidBpFile() android.GeneratedSnapshotFile {
511 return s.androidBpFile
512}
513
514func (s *snapshotBuilder) VersionedSdkMemberName(unversionedName string) interface{} {
515 return versionedSdkMemberName(s.ctx, unversionedName, s.version)
516}