Loading aconfig/init.go +4 −5 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,7 @@ var ( Restat: true, Restat: true, }, "release_version", "package", "declarations", "values", "default-permission") }, "release_version", "package", "declarations", "values", "default-permission") // For java_aconfig_library: Generate java file // For java_aconfig_library: Generate java library javaRule = pctx.AndroidStaticRule("java_aconfig_library", javaRule = pctx.AndroidStaticRule("java_aconfig_library", blueprint.RuleParams{ blueprint.RuleParams{ Command: `rm -rf ${out}.tmp` + Command: `rm -rf ${out}.tmp` + Loading @@ -58,7 +58,7 @@ var ( Restat: true, Restat: true, }, "mode") }, "mode") // For java_aconfig_library: Generate java file // For cc_aconfig_library: Generate C++ library cppRule = pctx.AndroidStaticRule("cc_aconfig_library", cppRule = pctx.AndroidStaticRule("cc_aconfig_library", blueprint.RuleParams{ blueprint.RuleParams{ Command: `rm -rf ${gendir}` + Command: `rm -rf ${gendir}` + Loading @@ -69,10 +69,10 @@ var ( ` --out ${gendir}`, ` --out ${gendir}`, CommandDeps: []string{ CommandDeps: []string{ "$aconfig", "$aconfig", "$soong_zip", }, }, }, "gendir", "mode") }, "gendir", "mode") // For rust_aconfig_library: Generate Rust library rustRule = pctx.AndroidStaticRule("rust_aconfig_library", rustRule = pctx.AndroidStaticRule("rust_aconfig_library", blueprint.RuleParams{ blueprint.RuleParams{ Command: `rm -rf ${gendir}` + Command: `rm -rf ${gendir}` + Loading @@ -83,11 +83,10 @@ var ( ` --out ${gendir}`, ` --out ${gendir}`, CommandDeps: []string{ CommandDeps: []string{ "$aconfig", "$aconfig", "$soong_zip", }, }, }, "gendir", "mode") }, "gendir", "mode") // For all_aconfig_declarations // For all_aconfig_declarations: Combine all parsed_flags proto files allDeclarationsRule = pctx.AndroidStaticRule("all_aconfig_declarations_dump", allDeclarationsRule = pctx.AndroidStaticRule("all_aconfig_declarations_dump", blueprint.RuleParams{ blueprint.RuleParams{ Command: `${aconfig} dump --format protobuf --out ${out} ${cache_files}`, Command: `${aconfig} dump --format protobuf --out ${out} ${cache_files}`, Loading android/paths.go +8 −0 Original line number Original line Diff line number Diff line Loading @@ -2210,6 +2210,14 @@ type DataPath struct { RelativeInstallPath string RelativeInstallPath string } } func (d *DataPath) ToRelativeInstallPath() string { relPath := d.SrcPath.Rel() if d.RelativeInstallPath != "" { relPath = filepath.Join(d.RelativeInstallPath, relPath) } return relPath } // PathsIfNonNil returns a Paths containing only the non-nil input arguments. // PathsIfNonNil returns a Paths containing only the non-nil input arguments. func PathsIfNonNil(paths ...Path) Paths { func PathsIfNonNil(paths ...Path) Paths { if len(paths) == 0 { if len(paths) == 0 { Loading apex/builder.go +4 −8 Original line number Original line Diff line number Diff line Loading @@ -563,13 +563,8 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) { // Copy the test files (if any) // Copy the test files (if any) for _, d := range fi.dataPaths { for _, d := range fi.dataPaths { // TODO(eakammer): This is now the third repetition of ~this logic for test paths, refactoring should be possible // TODO(eakammer): This is now the third repetition of ~this logic for test paths, refactoring should be possible relPath := d.SrcPath.Rel() relPath := d.ToRelativeInstallPath() dataPath := d.SrcPath.String() dataDest := imageDir.Join(ctx, fi.apexRelativePath(relPath)).String() if !strings.HasSuffix(dataPath, relPath) { panic(fmt.Errorf("path %q does not end with %q", dataPath, relPath)) } dataDest := imageDir.Join(ctx, fi.apexRelativePath(relPath), d.RelativeInstallPath).String() copyCommands = append(copyCommands, "cp -f "+d.SrcPath.String()+" "+dataDest) copyCommands = append(copyCommands, "cp -f "+d.SrcPath.String()+" "+dataDest) implicitInputs = append(implicitInputs, d.SrcPath) implicitInputs = append(implicitInputs, d.SrcPath) Loading Loading @@ -1095,7 +1090,8 @@ func (a *apexBundle) buildCannedFsConfig(ctx android.ModuleContext) android.Outp if f.installDir == "bin" || strings.HasPrefix(f.installDir, "bin/") { if f.installDir == "bin" || strings.HasPrefix(f.installDir, "bin/") { executablePaths = append(executablePaths, pathInApex) executablePaths = append(executablePaths, pathInApex) for _, d := range f.dataPaths { for _, d := range f.dataPaths { readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, d.RelativeInstallPath, d.SrcPath.Rel())) rel := d.ToRelativeInstallPath() readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, rel)) } } for _, s := range f.symlinks { for _, s := range f.symlinks { executablePaths = append(executablePaths, filepath.Join(f.installDir, s)) executablePaths = append(executablePaths, filepath.Join(f.installDir, s)) Loading cc/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ bootstrap_go_package { "soong-multitree", "soong-multitree", "soong-snapshot", "soong-snapshot", "soong-sysprop-bp2build", "soong-sysprop-bp2build", "soong-testing", "soong-tradefed", "soong-tradefed", ], ], srcs: [ srcs: [ Loading cc/cc.go +8 −3 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import ( "strconv" "strconv" "strings" "strings" "android/soong/testing" "android/soong/ui/metrics/bp2build_metrics_proto" "android/soong/ui/metrics/bp2build_metrics_proto" "github.com/google/blueprint" "github.com/google/blueprint" Loading Loading @@ -865,6 +866,7 @@ type Module struct { hod android.HostOrDeviceSupported hod android.HostOrDeviceSupported multilib android.Multilib multilib android.Multilib bazelable bool bazelable bool testModule bool // Allowable SdkMemberTypes of this module type. // Allowable SdkMemberTypes of this module type. sdkMemberTypes []android.SdkMemberType sdkMemberTypes []android.SdkMemberType Loading Loading @@ -2329,6 +2331,9 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { } } } } } } if c.testModule { ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{}) } c.maybeInstall(ctx, apexInfo) c.maybeInstall(ctx, apexInfo) } } Loading Loading
aconfig/init.go +4 −5 Original line number Original line Diff line number Diff line Loading @@ -40,7 +40,7 @@ var ( Restat: true, Restat: true, }, "release_version", "package", "declarations", "values", "default-permission") }, "release_version", "package", "declarations", "values", "default-permission") // For java_aconfig_library: Generate java file // For java_aconfig_library: Generate java library javaRule = pctx.AndroidStaticRule("java_aconfig_library", javaRule = pctx.AndroidStaticRule("java_aconfig_library", blueprint.RuleParams{ blueprint.RuleParams{ Command: `rm -rf ${out}.tmp` + Command: `rm -rf ${out}.tmp` + Loading @@ -58,7 +58,7 @@ var ( Restat: true, Restat: true, }, "mode") }, "mode") // For java_aconfig_library: Generate java file // For cc_aconfig_library: Generate C++ library cppRule = pctx.AndroidStaticRule("cc_aconfig_library", cppRule = pctx.AndroidStaticRule("cc_aconfig_library", blueprint.RuleParams{ blueprint.RuleParams{ Command: `rm -rf ${gendir}` + Command: `rm -rf ${gendir}` + Loading @@ -69,10 +69,10 @@ var ( ` --out ${gendir}`, ` --out ${gendir}`, CommandDeps: []string{ CommandDeps: []string{ "$aconfig", "$aconfig", "$soong_zip", }, }, }, "gendir", "mode") }, "gendir", "mode") // For rust_aconfig_library: Generate Rust library rustRule = pctx.AndroidStaticRule("rust_aconfig_library", rustRule = pctx.AndroidStaticRule("rust_aconfig_library", blueprint.RuleParams{ blueprint.RuleParams{ Command: `rm -rf ${gendir}` + Command: `rm -rf ${gendir}` + Loading @@ -83,11 +83,10 @@ var ( ` --out ${gendir}`, ` --out ${gendir}`, CommandDeps: []string{ CommandDeps: []string{ "$aconfig", "$aconfig", "$soong_zip", }, }, }, "gendir", "mode") }, "gendir", "mode") // For all_aconfig_declarations // For all_aconfig_declarations: Combine all parsed_flags proto files allDeclarationsRule = pctx.AndroidStaticRule("all_aconfig_declarations_dump", allDeclarationsRule = pctx.AndroidStaticRule("all_aconfig_declarations_dump", blueprint.RuleParams{ blueprint.RuleParams{ Command: `${aconfig} dump --format protobuf --out ${out} ${cache_files}`, Command: `${aconfig} dump --format protobuf --out ${out} ${cache_files}`, Loading
android/paths.go +8 −0 Original line number Original line Diff line number Diff line Loading @@ -2210,6 +2210,14 @@ type DataPath struct { RelativeInstallPath string RelativeInstallPath string } } func (d *DataPath) ToRelativeInstallPath() string { relPath := d.SrcPath.Rel() if d.RelativeInstallPath != "" { relPath = filepath.Join(d.RelativeInstallPath, relPath) } return relPath } // PathsIfNonNil returns a Paths containing only the non-nil input arguments. // PathsIfNonNil returns a Paths containing only the non-nil input arguments. func PathsIfNonNil(paths ...Path) Paths { func PathsIfNonNil(paths ...Path) Paths { if len(paths) == 0 { if len(paths) == 0 { Loading
apex/builder.go +4 −8 Original line number Original line Diff line number Diff line Loading @@ -563,13 +563,8 @@ func (a *apexBundle) buildApex(ctx android.ModuleContext) { // Copy the test files (if any) // Copy the test files (if any) for _, d := range fi.dataPaths { for _, d := range fi.dataPaths { // TODO(eakammer): This is now the third repetition of ~this logic for test paths, refactoring should be possible // TODO(eakammer): This is now the third repetition of ~this logic for test paths, refactoring should be possible relPath := d.SrcPath.Rel() relPath := d.ToRelativeInstallPath() dataPath := d.SrcPath.String() dataDest := imageDir.Join(ctx, fi.apexRelativePath(relPath)).String() if !strings.HasSuffix(dataPath, relPath) { panic(fmt.Errorf("path %q does not end with %q", dataPath, relPath)) } dataDest := imageDir.Join(ctx, fi.apexRelativePath(relPath), d.RelativeInstallPath).String() copyCommands = append(copyCommands, "cp -f "+d.SrcPath.String()+" "+dataDest) copyCommands = append(copyCommands, "cp -f "+d.SrcPath.String()+" "+dataDest) implicitInputs = append(implicitInputs, d.SrcPath) implicitInputs = append(implicitInputs, d.SrcPath) Loading Loading @@ -1095,7 +1090,8 @@ func (a *apexBundle) buildCannedFsConfig(ctx android.ModuleContext) android.Outp if f.installDir == "bin" || strings.HasPrefix(f.installDir, "bin/") { if f.installDir == "bin" || strings.HasPrefix(f.installDir, "bin/") { executablePaths = append(executablePaths, pathInApex) executablePaths = append(executablePaths, pathInApex) for _, d := range f.dataPaths { for _, d := range f.dataPaths { readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, d.RelativeInstallPath, d.SrcPath.Rel())) rel := d.ToRelativeInstallPath() readOnlyPaths = append(readOnlyPaths, filepath.Join(f.installDir, rel)) } } for _, s := range f.symlinks { for _, s := range f.symlinks { executablePaths = append(executablePaths, filepath.Join(f.installDir, s)) executablePaths = append(executablePaths, filepath.Join(f.installDir, s)) Loading
cc/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -19,6 +19,7 @@ bootstrap_go_package { "soong-multitree", "soong-multitree", "soong-snapshot", "soong-snapshot", "soong-sysprop-bp2build", "soong-sysprop-bp2build", "soong-testing", "soong-tradefed", "soong-tradefed", ], ], srcs: [ srcs: [ Loading
cc/cc.go +8 −3 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import ( "strconv" "strconv" "strings" "strings" "android/soong/testing" "android/soong/ui/metrics/bp2build_metrics_proto" "android/soong/ui/metrics/bp2build_metrics_proto" "github.com/google/blueprint" "github.com/google/blueprint" Loading Loading @@ -865,6 +866,7 @@ type Module struct { hod android.HostOrDeviceSupported hod android.HostOrDeviceSupported multilib android.Multilib multilib android.Multilib bazelable bool bazelable bool testModule bool // Allowable SdkMemberTypes of this module type. // Allowable SdkMemberTypes of this module type. sdkMemberTypes []android.SdkMemberType sdkMemberTypes []android.SdkMemberType Loading Loading @@ -2329,6 +2331,9 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { } } } } } } if c.testModule { ctx.SetProvider(testing.TestModuleProviderKey, testing.TestModuleProviderData{}) } c.maybeInstall(ctx, apexInfo) c.maybeInstall(ctx, apexInfo) } } Loading