Loading AconfigFlags.bp +33 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ aconfig_srcjars = [ ":android.os.vibrator.flags-aconfig-java{.generated_srcjars}", ":android.security.flags-aconfig-java{.generated_srcjars}", ":android.view.flags-aconfig-java{.generated_srcjars}", ":android.view.accessibility.flags-aconfig-java{.generated_srcjars}", ":camera_platform_flags_core_java_lib{.generated_srcjars}", ":com.android.window.flags.window-aconfig-java{.generated_srcjars}", ":android.hardware.biometrics.flags-aconfig-java{.generated_srcjars}", Loading @@ -40,6 +41,7 @@ aconfig_srcjars = [ ":android.app.flags-aconfig-java{.generated_srcjars}", ":android.credentials.flags-aconfig-java{.generated_srcjars}", ":android.view.contentprotection.flags-aconfig-java{.generated_srcjars}", ":android.service.voice.flags-aconfig-java{.generated_srcjars}", ] filegroup { Loading Loading @@ -240,6 +242,24 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } // View.accessibility aconfig_declarations { name: "android.view.accessibility.flags-aconfig", package: "android.view.accessibility", srcs: ["core/java/android/view/accessibility/flags/*.aconfig"], } java_aconfig_library { name: "android.view.accessibility.flags-aconfig-java", aconfig_declarations: "android.view.accessibility.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], } cc_aconfig_library { name: "aconfig_view_accessibility_flags_c_lib", aconfig_declarations: "android.view.accessibility.flags-aconfig", } // Widget aconfig_declarations { name: "android.widget.flags-aconfig", Loading Loading @@ -383,3 +403,16 @@ java_aconfig_library { aconfig_declarations: "android.view.contentprotection.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], } // Voice aconfig_declarations { name: "android.service.voice.flags-aconfig", package: "android.service.voice.flags", srcs: ["core/java/android/service/voice/flags/*.aconfig"], } java_aconfig_library { name: "android.service.voice.flags-aconfig-java", aconfig_declarations: "android.service.voice.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], } api/Android.bp +0 −9 Original line number Diff line number Diff line Loading @@ -62,15 +62,6 @@ metalava_cmd = "$(location metalava)" metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED " metalava_cmd += " --quiet " genrule { name: "current-api-xml", tools: ["metalava"], srcs: [":frameworks-base-api-current.txt"], out: ["current.api"], cmd: metalava_cmd + "signature-to-jdiff $(in) $(out)", visibility: ["//visibility:public"], } combined_apis { name: "frameworks-base-api", bootclasspath: [ Loading api/ApiDocs.bp +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ doc_defaults { custom_template: "droiddoc-templates-sdk", resourcesdir: "docs/html/reference/images/", resourcesoutdir: "reference/android/images/", lint_baseline: "javadoc-lint-baseline", hdf: [ "dac true", "sdk.codename O", Loading api/api.go +49 −26 Original line number Diff line number Diff line Loading @@ -115,6 +115,7 @@ type defaultsProps struct { } type Bazel_module struct { Label *string Bp2build_available *bool } type bazelProperties struct { Loading @@ -141,6 +142,8 @@ type MergedTxtDefinition struct { ModuleTag string // public, system, module-lib or system-server Scope string // True if there is a bp2build definition for this module Bp2buildDefined bool } func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { Loading @@ -153,8 +156,10 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { if txt.Scope != "public" { filename = txt.Scope + "-" + filename } moduleName := ctx.ModuleName() + "-" + filename props := genruleProps{} props.Name = proptools.StringPtr(ctx.ModuleName() + "-" + filename) props.Name = proptools.StringPtr(moduleName) props.Tools = []string{"metalava"} props.Out = []string{filename} props.Cmd = proptools.StringPtr(metalavaCmd + "$(in) --out $(out)") Loading @@ -172,7 +177,20 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { }, } props.Visibility = []string{"//visibility:public"} ctx.CreateModule(genrule.GenRuleFactory, &props, &bp2buildNotAvailable) bazelProps := bazelProperties{ &Bazel_module{ Bp2build_available: proptools.BoolPtr(false), }, } if txt.Bp2buildDefined { moduleDir := ctx.ModuleDir() if moduleDir == android.Bp2BuildTopLevel { moduleDir = "" } label := fmt.Sprintf("//%s:%s", moduleDir, moduleName) bazelProps.Label = &label } ctx.CreateModule(genrule.GenRuleFactory, &props, &bazelProps) } func createMergedAnnotationsFilegroups(ctx android.LoadHookContext, modules, system_server_modules []string) { Loading Loading @@ -304,6 +322,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ tagSuffix := []string{".api.txt}", ".removed-api.txt}"} distFilename := []string{"android.txt", "android-removed.txt"} bp2BuildDefined := []bool{true, false} for i, f := range []string{"current.txt", "removed.txt"} { textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -312,6 +331,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: bootclasspath, ModuleTag: "{.public" + tagSuffix[i], Scope: "public", Bp2buildDefined: bp2BuildDefined[i], }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -320,6 +340,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: bootclasspath, ModuleTag: "{.system" + tagSuffix[i], Scope: "system", Bp2buildDefined: bp2BuildDefined[i], }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -328,6 +349,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: bootclasspath, ModuleTag: "{.module-lib" + tagSuffix[i], Scope: "module-lib", Bp2buildDefined: bp2BuildDefined[i], }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -336,6 +358,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: system_server_classpath, ModuleTag: "{.system-server" + tagSuffix[i], Scope: "system-server", Bp2buildDefined: bp2BuildDefined[i], }) } for _, txt := range textFiles { Loading api/api_test.go +45 −8 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ func runCombinedApisTestCase(t *testing.T, tc bp2build.Bp2buildTestCase) { t.Helper() runCombinedApisTestCaseWithRegistrationCtxFunc(t, tc, func(ctx android.RegistrationContext) { ctx.RegisterModuleType("java_defaults", java.DefaultsFactory) ctx.RegisterModuleType("java_sdk_library", java.SdkLibraryFactory) ctx.RegisterModuleType("filegroup", android.FileGroupFactory) }) } Loading @@ -44,6 +46,33 @@ func TestCombinedApisGeneral(t *testing.T) { bootclasspath: ["bcp"], system_server_classpath: ["ssc"], } java_sdk_library { name: "bcp", srcs: ["a.java", "b.java"], shared_library: false, } java_sdk_library { name: "ssc", srcs: ["a.java", "b.java"], shared_library: false, } filegroup { name: "non-updatable-current.txt", srcs: ["current.txt"], } filegroup { name: "non-updatable-system-current.txt", srcs: ["system-current.txt"], } filegroup { name: "non-updatable-module-lib-current.txt", srcs: ["system-removed.txt"], } filegroup { name: "non-updatable-system-server-current.txt", srcs: ["system-lint-baseline.txt"], } `, Filesystem: map[string]string{ "a/Android.bp": ` Loading @@ -51,27 +80,35 @@ func TestCombinedApisGeneral(t *testing.T) { name: "android.jar_defaults", } `, "api/current.txt": "", "api/removed.txt": "", "api/system-current.txt": "", "api/system-removed.txt": "", "api/test-current.txt": "", "api/test-removed.txt": "", }, StubbedBuildDefinitions: []string{"bcp", "ssc", "non-updatable-current.txt", "non-updatable-system-current.txt", "non-updatable-module-lib-current.txt", "non-updatable-system-server-current.txt"}, ExpectedHandcraftedModules: []string{"foo-current.txt", "foo-system-current.txt", "foo-module-lib-current.txt", "foo-system-server-current.txt"}, ExpectedBazelTargets: []string{ bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-current.txt", bp2build.AttrNameToString{ "scope": `"public"`, "base": `":non-updatable-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":bcp__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-current.txt"`, "deps": `[":bcp"]`, }), bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-system-current.txt", bp2build.AttrNameToString{ "scope": `"system"`, "base": `":non-updatable-system-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":bcp__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-system-current.txt"`, "deps": `[":bcp"]`, }), bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-module-lib-current.txt", bp2build.AttrNameToString{ "scope": `"module-lib"`, "base": `":non-updatable-module-lib-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":bcp__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-module-lib-current.txt"`, "deps": `[":bcp"]`, }), bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-system-server-current.txt", bp2build.AttrNameToString{ "scope": `"system-server"`, "base": `":non-updatable-system-server-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":ssc__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-system-server-current.txt"`, "deps": `[":ssc"]`, }), }, }) Loading Loading
AconfigFlags.bp +33 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ aconfig_srcjars = [ ":android.os.vibrator.flags-aconfig-java{.generated_srcjars}", ":android.security.flags-aconfig-java{.generated_srcjars}", ":android.view.flags-aconfig-java{.generated_srcjars}", ":android.view.accessibility.flags-aconfig-java{.generated_srcjars}", ":camera_platform_flags_core_java_lib{.generated_srcjars}", ":com.android.window.flags.window-aconfig-java{.generated_srcjars}", ":android.hardware.biometrics.flags-aconfig-java{.generated_srcjars}", Loading @@ -40,6 +41,7 @@ aconfig_srcjars = [ ":android.app.flags-aconfig-java{.generated_srcjars}", ":android.credentials.flags-aconfig-java{.generated_srcjars}", ":android.view.contentprotection.flags-aconfig-java{.generated_srcjars}", ":android.service.voice.flags-aconfig-java{.generated_srcjars}", ] filegroup { Loading Loading @@ -240,6 +242,24 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } // View.accessibility aconfig_declarations { name: "android.view.accessibility.flags-aconfig", package: "android.view.accessibility", srcs: ["core/java/android/view/accessibility/flags/*.aconfig"], } java_aconfig_library { name: "android.view.accessibility.flags-aconfig-java", aconfig_declarations: "android.view.accessibility.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], } cc_aconfig_library { name: "aconfig_view_accessibility_flags_c_lib", aconfig_declarations: "android.view.accessibility.flags-aconfig", } // Widget aconfig_declarations { name: "android.widget.flags-aconfig", Loading Loading @@ -383,3 +403,16 @@ java_aconfig_library { aconfig_declarations: "android.view.contentprotection.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], } // Voice aconfig_declarations { name: "android.service.voice.flags-aconfig", package: "android.service.voice.flags", srcs: ["core/java/android/service/voice/flags/*.aconfig"], } java_aconfig_library { name: "android.service.voice.flags-aconfig-java", aconfig_declarations: "android.service.voice.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], }
api/Android.bp +0 −9 Original line number Diff line number Diff line Loading @@ -62,15 +62,6 @@ metalava_cmd = "$(location metalava)" metalava_cmd += " -J--add-opens=java.base/java.util=ALL-UNNAMED " metalava_cmd += " --quiet " genrule { name: "current-api-xml", tools: ["metalava"], srcs: [":frameworks-base-api-current.txt"], out: ["current.api"], cmd: metalava_cmd + "signature-to-jdiff $(in) $(out)", visibility: ["//visibility:public"], } combined_apis { name: "frameworks-base-api", bootclasspath: [ Loading
api/ApiDocs.bp +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ doc_defaults { custom_template: "droiddoc-templates-sdk", resourcesdir: "docs/html/reference/images/", resourcesoutdir: "reference/android/images/", lint_baseline: "javadoc-lint-baseline", hdf: [ "dac true", "sdk.codename O", Loading
api/api.go +49 −26 Original line number Diff line number Diff line Loading @@ -115,6 +115,7 @@ type defaultsProps struct { } type Bazel_module struct { Label *string Bp2build_available *bool } type bazelProperties struct { Loading @@ -141,6 +142,8 @@ type MergedTxtDefinition struct { ModuleTag string // public, system, module-lib or system-server Scope string // True if there is a bp2build definition for this module Bp2buildDefined bool } func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { Loading @@ -153,8 +156,10 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { if txt.Scope != "public" { filename = txt.Scope + "-" + filename } moduleName := ctx.ModuleName() + "-" + filename props := genruleProps{} props.Name = proptools.StringPtr(ctx.ModuleName() + "-" + filename) props.Name = proptools.StringPtr(moduleName) props.Tools = []string{"metalava"} props.Out = []string{filename} props.Cmd = proptools.StringPtr(metalavaCmd + "$(in) --out $(out)") Loading @@ -172,7 +177,20 @@ func createMergedTxt(ctx android.LoadHookContext, txt MergedTxtDefinition) { }, } props.Visibility = []string{"//visibility:public"} ctx.CreateModule(genrule.GenRuleFactory, &props, &bp2buildNotAvailable) bazelProps := bazelProperties{ &Bazel_module{ Bp2build_available: proptools.BoolPtr(false), }, } if txt.Bp2buildDefined { moduleDir := ctx.ModuleDir() if moduleDir == android.Bp2BuildTopLevel { moduleDir = "" } label := fmt.Sprintf("//%s:%s", moduleDir, moduleName) bazelProps.Label = &label } ctx.CreateModule(genrule.GenRuleFactory, &props, &bazelProps) } func createMergedAnnotationsFilegroups(ctx android.LoadHookContext, modules, system_server_modules []string) { Loading Loading @@ -304,6 +322,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ tagSuffix := []string{".api.txt}", ".removed-api.txt}"} distFilename := []string{"android.txt", "android-removed.txt"} bp2BuildDefined := []bool{true, false} for i, f := range []string{"current.txt", "removed.txt"} { textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -312,6 +331,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: bootclasspath, ModuleTag: "{.public" + tagSuffix[i], Scope: "public", Bp2buildDefined: bp2BuildDefined[i], }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -320,6 +340,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: bootclasspath, ModuleTag: "{.system" + tagSuffix[i], Scope: "system", Bp2buildDefined: bp2BuildDefined[i], }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -328,6 +349,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: bootclasspath, ModuleTag: "{.module-lib" + tagSuffix[i], Scope: "module-lib", Bp2buildDefined: bp2BuildDefined[i], }) textFiles = append(textFiles, MergedTxtDefinition{ TxtFilename: f, Loading @@ -336,6 +358,7 @@ func createMergedTxts(ctx android.LoadHookContext, bootclasspath, system_server_ Modules: system_server_classpath, ModuleTag: "{.system-server" + tagSuffix[i], Scope: "system-server", Bp2buildDefined: bp2BuildDefined[i], }) } for _, txt := range textFiles { Loading
api/api_test.go +45 −8 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ func runCombinedApisTestCase(t *testing.T, tc bp2build.Bp2buildTestCase) { t.Helper() runCombinedApisTestCaseWithRegistrationCtxFunc(t, tc, func(ctx android.RegistrationContext) { ctx.RegisterModuleType("java_defaults", java.DefaultsFactory) ctx.RegisterModuleType("java_sdk_library", java.SdkLibraryFactory) ctx.RegisterModuleType("filegroup", android.FileGroupFactory) }) } Loading @@ -44,6 +46,33 @@ func TestCombinedApisGeneral(t *testing.T) { bootclasspath: ["bcp"], system_server_classpath: ["ssc"], } java_sdk_library { name: "bcp", srcs: ["a.java", "b.java"], shared_library: false, } java_sdk_library { name: "ssc", srcs: ["a.java", "b.java"], shared_library: false, } filegroup { name: "non-updatable-current.txt", srcs: ["current.txt"], } filegroup { name: "non-updatable-system-current.txt", srcs: ["system-current.txt"], } filegroup { name: "non-updatable-module-lib-current.txt", srcs: ["system-removed.txt"], } filegroup { name: "non-updatable-system-server-current.txt", srcs: ["system-lint-baseline.txt"], } `, Filesystem: map[string]string{ "a/Android.bp": ` Loading @@ -51,27 +80,35 @@ func TestCombinedApisGeneral(t *testing.T) { name: "android.jar_defaults", } `, "api/current.txt": "", "api/removed.txt": "", "api/system-current.txt": "", "api/system-removed.txt": "", "api/test-current.txt": "", "api/test-removed.txt": "", }, StubbedBuildDefinitions: []string{"bcp", "ssc", "non-updatable-current.txt", "non-updatable-system-current.txt", "non-updatable-module-lib-current.txt", "non-updatable-system-server-current.txt"}, ExpectedHandcraftedModules: []string{"foo-current.txt", "foo-system-current.txt", "foo-module-lib-current.txt", "foo-system-server-current.txt"}, ExpectedBazelTargets: []string{ bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-current.txt", bp2build.AttrNameToString{ "scope": `"public"`, "base": `":non-updatable-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":bcp__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-current.txt"`, "deps": `[":bcp"]`, }), bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-system-current.txt", bp2build.AttrNameToString{ "scope": `"system"`, "base": `":non-updatable-system-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":bcp__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-system-current.txt"`, "deps": `[":bcp"]`, }), bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-module-lib-current.txt", bp2build.AttrNameToString{ "scope": `"module-lib"`, "base": `":non-updatable-module-lib-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":bcp__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-module-lib-current.txt"`, "deps": `[":bcp"]`, }), bp2build.MakeBazelTargetNoRestrictions("merged_txts", "foo-system-server-current.txt", bp2build.AttrNameToString{ "scope": `"system-server"`, "base": `":non-updatable-system-server-current.txt__BP2BUILD__MISSING__DEP"`, "deps": `[":ssc__BP2BUILD__MISSING__DEP"]`, "base": `":non-updatable-system-server-current.txt"`, "deps": `[":ssc"]`, }), }, }) Loading