Loading apex/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ bootstrap_go_package { "soong-android", "soong-bpf", "soong-cc", "soong-filesystem", "soong-java", "soong-python", "soong-rust", Loading apex/apex.go +17 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import ( "android/soong/bpf" "android/soong/cc" prebuilt_etc "android/soong/etc" "android/soong/filesystem" "android/soong/java" "android/soong/python" "android/soong/rust" Loading Loading @@ -96,6 +97,9 @@ type apexBundleProperties struct { // List of BPF programs inside this APEX bundle. Bpfs []string // List of filesystem images that are embedded inside this APEX bundle. Filesystems []string // Name of the apex_key module that provides the private key to sign this APEX bundle. Key *string Loading Loading @@ -530,6 +534,7 @@ var ( bpfTag = dependencyTag{name: "bpf", payload: true} certificateTag = dependencyTag{name: "certificate"} executableTag = dependencyTag{name: "executable", payload: true} fsTag = dependencyTag{name: "filesystem", payload: true} javaLibTag = dependencyTag{name: "javaLib", payload: true} jniLibTag = dependencyTag{name: "jniLib", payload: true} keyTag = dependencyTag{name: "key"} Loading Loading @@ -709,6 +714,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) { commonVariation := ctx.Config().AndroidCommonTarget.Variations() ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.properties.Java_libs...) ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.properties.Bpfs...) ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...) // With EMMA_INSTRUMENT_FRAMEWORK=true the ART boot image includes jacoco library. if a.artApex && ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") { Loading Loading @@ -1481,6 +1487,11 @@ func apexFileForBpfProgram(ctx android.BaseModuleContext, builtFile android.Path return newApexFile(ctx, builtFile, builtFile.Base(), dirInApex, etc, bpfProgram) } func apexFileForFilesystem(ctx android.BaseModuleContext, buildFile android.Path, fs filesystem.Filesystem) apexFile { dirInApex := filepath.Join("etc", "fs") return newApexFile(ctx, buildFile, buildFile.Base(), dirInApex, etc, fs) } // WalyPayloadDeps visits dependencies that contributes to the payload of this APEX. For each of the // visited module, the `do` callback is executed. Returning true in the callback continues the visit // to the child modules. Returning false makes the visit to continue in the sibling or the parent Loading Loading @@ -1655,6 +1666,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { } else { ctx.PropertyErrorf("bpfs", "%q is not a bpf module", depName) } case fsTag: if fs, ok := child.(filesystem.Filesystem); ok { filesInfo = append(filesInfo, apexFileForFilesystem(ctx, fs.OutputPath(), fs)) } else { ctx.PropertyErrorf("filesystems", "%q is not a filesystem module", depName) } case prebuiltTag: if prebuilt, ok := child.(prebuilt_etc.PrebuiltEtcModule); ok { filesInfo = append(filesInfo, apexFileForPrebuiltEtc(ctx, prebuilt, depName)) Loading filesystem/filesystem.go +18 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ func filesystemFactory() android.Module { return module } var dependencyTag = struct{ blueprint.BaseDependencyTag }{} var dependencyTag = struct { blueprint.BaseDependencyTag android.InstallAlwaysNeededDependencyTag }{} func (f *filesystem) DepsMutator(ctx android.BottomUpMutatorContext) { f.AddDeps(ctx, dependencyTag) Loading Loading @@ -80,7 +83,7 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { Text(">").Output(propFile). Implicit(mkuserimg) f.output = android.PathForModuleOut(ctx, "filesystem.img").OutputPath f.output = android.PathForModuleOut(ctx, f.installFileName()).OutputPath builder.Command().BuiltTool("build_image"). Text(rootDir.String()). // input directory Input(propFile). Loading Loading @@ -109,3 +112,16 @@ func (f *filesystem) AndroidMkEntries() []android.AndroidMkEntries { }, }} } // Filesystem is the public interface for the filesystem struct. Currently, it's only for the apex // package to have access to the output file. type Filesystem interface { android.Module OutputPath() android.Path } var _ Filesystem = (*filesystem)(nil) func (f *filesystem) OutputPath() android.Path { return f.output } Loading
apex/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ bootstrap_go_package { "soong-android", "soong-bpf", "soong-cc", "soong-filesystem", "soong-java", "soong-python", "soong-rust", Loading
apex/apex.go +17 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import ( "android/soong/bpf" "android/soong/cc" prebuilt_etc "android/soong/etc" "android/soong/filesystem" "android/soong/java" "android/soong/python" "android/soong/rust" Loading Loading @@ -96,6 +97,9 @@ type apexBundleProperties struct { // List of BPF programs inside this APEX bundle. Bpfs []string // List of filesystem images that are embedded inside this APEX bundle. Filesystems []string // Name of the apex_key module that provides the private key to sign this APEX bundle. Key *string Loading Loading @@ -530,6 +534,7 @@ var ( bpfTag = dependencyTag{name: "bpf", payload: true} certificateTag = dependencyTag{name: "certificate"} executableTag = dependencyTag{name: "executable", payload: true} fsTag = dependencyTag{name: "filesystem", payload: true} javaLibTag = dependencyTag{name: "javaLib", payload: true} jniLibTag = dependencyTag{name: "jniLib", payload: true} keyTag = dependencyTag{name: "key"} Loading Loading @@ -709,6 +714,7 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) { commonVariation := ctx.Config().AndroidCommonTarget.Variations() ctx.AddFarVariationDependencies(commonVariation, javaLibTag, a.properties.Java_libs...) ctx.AddFarVariationDependencies(commonVariation, bpfTag, a.properties.Bpfs...) ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...) // With EMMA_INSTRUMENT_FRAMEWORK=true the ART boot image includes jacoco library. if a.artApex && ctx.Config().IsEnvTrue("EMMA_INSTRUMENT_FRAMEWORK") { Loading Loading @@ -1481,6 +1487,11 @@ func apexFileForBpfProgram(ctx android.BaseModuleContext, builtFile android.Path return newApexFile(ctx, builtFile, builtFile.Base(), dirInApex, etc, bpfProgram) } func apexFileForFilesystem(ctx android.BaseModuleContext, buildFile android.Path, fs filesystem.Filesystem) apexFile { dirInApex := filepath.Join("etc", "fs") return newApexFile(ctx, buildFile, buildFile.Base(), dirInApex, etc, fs) } // WalyPayloadDeps visits dependencies that contributes to the payload of this APEX. For each of the // visited module, the `do` callback is executed. Returning true in the callback continues the visit // to the child modules. Returning false makes the visit to continue in the sibling or the parent Loading Loading @@ -1655,6 +1666,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) { } else { ctx.PropertyErrorf("bpfs", "%q is not a bpf module", depName) } case fsTag: if fs, ok := child.(filesystem.Filesystem); ok { filesInfo = append(filesInfo, apexFileForFilesystem(ctx, fs.OutputPath(), fs)) } else { ctx.PropertyErrorf("filesystems", "%q is not a filesystem module", depName) } case prebuiltTag: if prebuilt, ok := child.(prebuilt_etc.PrebuiltEtcModule); ok { filesInfo = append(filesInfo, apexFileForPrebuiltEtc(ctx, prebuilt, depName)) Loading
filesystem/filesystem.go +18 −2 Original line number Diff line number Diff line Loading @@ -46,7 +46,10 @@ func filesystemFactory() android.Module { return module } var dependencyTag = struct{ blueprint.BaseDependencyTag }{} var dependencyTag = struct { blueprint.BaseDependencyTag android.InstallAlwaysNeededDependencyTag }{} func (f *filesystem) DepsMutator(ctx android.BottomUpMutatorContext) { f.AddDeps(ctx, dependencyTag) Loading Loading @@ -80,7 +83,7 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) { Text(">").Output(propFile). Implicit(mkuserimg) f.output = android.PathForModuleOut(ctx, "filesystem.img").OutputPath f.output = android.PathForModuleOut(ctx, f.installFileName()).OutputPath builder.Command().BuiltTool("build_image"). Text(rootDir.String()). // input directory Input(propFile). Loading Loading @@ -109,3 +112,16 @@ func (f *filesystem) AndroidMkEntries() []android.AndroidMkEntries { }, }} } // Filesystem is the public interface for the filesystem struct. Currently, it's only for the apex // package to have access to the output file. type Filesystem interface { android.Module OutputPath() android.Path } var _ Filesystem = (*filesystem)(nil) func (f *filesystem) OutputPath() android.Path { return f.output }