Merge changes If313580b,I68d50d68 into main
* changes: Use a provider for systems modules Add PrepareForTestWithBuildFlag
This commit is contained in:
@@ -150,12 +150,7 @@ func TestReleaseAconfigExtraReleaseConfigs(t *testing.T) {
|
|||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
fixture := GroupFixturePreparers(
|
fixture := GroupFixturePreparers(
|
||||||
FixtureModifyProductVariables(func(vars FixtureProductVariables) {
|
PrepareForTestWithBuildFlag("RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS", tc.flag),
|
||||||
if vars.BuildFlags == nil {
|
|
||||||
vars.BuildFlags = make(map[string]string)
|
|
||||||
}
|
|
||||||
vars.BuildFlags["RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS"] = tc.flag
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
actual := fixture.RunTest(t).Config.ReleaseAconfigExtraReleaseConfigs()
|
actual := fixture.RunTest(t).Config.ReleaseAconfigExtraReleaseConfigs()
|
||||||
AssertArrayString(t, tc.name, tc.expected, actual)
|
AssertArrayString(t, tc.name, tc.expected, actual)
|
||||||
|
@@ -574,11 +574,7 @@ func newOverrideSourceModule() Module {
|
|||||||
|
|
||||||
func TestPrebuiltErrorCannotListBothSourceAndPrebuiltInContributions(t *testing.T) {
|
func TestPrebuiltErrorCannotListBothSourceAndPrebuiltInContributions(t *testing.T) {
|
||||||
selectMainlineModuleContritbutions := GroupFixturePreparers(
|
selectMainlineModuleContritbutions := GroupFixturePreparers(
|
||||||
FixtureModifyProductVariables(func(variables FixtureProductVariables) {
|
PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "my_apex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "my_apex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
testPrebuiltErrorWithFixture(t, `Found duplicate variations of the same module in apex_contributions: foo and prebuilt_foo. Please remove one of these`, `
|
testPrebuiltErrorWithFixture(t, `Found duplicate variations of the same module in apex_contributions: foo and prebuilt_foo. Please remove one of these`, `
|
||||||
source {
|
source {
|
||||||
|
@@ -174,6 +174,16 @@ var PrepareForTestDisallowNonExistentPaths = FixtureModifyConfig(func(config Con
|
|||||||
config.TestAllowNonExistentPaths = false
|
config.TestAllowNonExistentPaths = false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// PrepareForTestWithBuildFlag returns a FixturePreparer that sets the given flag to the given value.
|
||||||
|
func PrepareForTestWithBuildFlag(flag, value string) FixturePreparer {
|
||||||
|
return FixtureModifyProductVariables(func(variables FixtureProductVariables) {
|
||||||
|
if variables.BuildFlags == nil {
|
||||||
|
variables.BuildFlags = make(map[string]string)
|
||||||
|
}
|
||||||
|
variables.BuildFlags[flag] = value
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func NewTestArchContext(config Config) *TestContext {
|
func NewTestArchContext(config Config) *TestContext {
|
||||||
ctx := NewTestContext(config)
|
ctx := NewTestContext(config)
|
||||||
ctx.preDeps = append(ctx.preDeps, registerArchMutator)
|
ctx.preDeps = append(ctx.preDeps, registerArchMutator)
|
||||||
|
@@ -11299,11 +11299,7 @@ func TestBootDexJarsMultipleApexPrebuilts(t *testing.T) {
|
|||||||
fs["platform/Test.java"] = nil
|
fs["platform/Test.java"] = nil
|
||||||
}),
|
}),
|
||||||
|
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", tc.selectedApexContributions),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": tc.selectedApexContributions,
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
ctx := testDexpreoptWithApexes(t, bp, "", preparer, fragment)
|
ctx := testDexpreoptWithApexes(t, bp, "", preparer, fragment)
|
||||||
checkBootDexJarPath(t, ctx, "framework-foo", tc.expectedBootJar)
|
checkBootDexJarPath(t, ctx, "framework-foo", tc.expectedBootJar)
|
||||||
@@ -11442,11 +11438,7 @@ func TestInstallationRulesForMultipleApexPrebuilts(t *testing.T) {
|
|||||||
android.FixtureMergeMockFs(map[string][]byte{
|
android.FixtureMergeMockFs(map[string][]byte{
|
||||||
"system/sepolicy/apex/com.android.foo-file_contexts": nil,
|
"system/sepolicy/apex/com.android.foo-file_contexts": nil,
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", tc.selectedApexContributions),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": tc.selectedApexContributions,
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
if tc.expectedError != "" {
|
if tc.expectedError != "" {
|
||||||
preparer = preparer.ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(tc.expectedError))
|
preparer = preparer.ExtendWithErrorHandler(android.FixtureExpectsOneErrorPattern(tc.expectedError))
|
||||||
@@ -11562,11 +11554,7 @@ func TestInstallationRulesForMultipleApexPrebuiltsWithoutSource(t *testing.T) {
|
|||||||
android.FixtureMergeMockFs(map[string][]byte{
|
android.FixtureMergeMockFs(map[string][]byte{
|
||||||
"system/sepolicy/apex/com.android.adservices-file_contexts": nil,
|
"system/sepolicy/apex/com.android.adservices-file_contexts": nil,
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", tc.selectedApexContributions),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": tc.selectedApexContributions,
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
ctx := testApex(t, bp, preparer)
|
ctx := testApex(t, bp, preparer)
|
||||||
|
|
||||||
|
@@ -53,11 +53,7 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
|
|||||||
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"),
|
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"),
|
||||||
java.FixtureConfigureApexBootJars("someapex:foo", "someapex:bar"),
|
java.FixtureConfigureApexBootJars("someapex:foo", "someapex:bar"),
|
||||||
prepareForTestWithArtApex,
|
prepareForTestWithArtApex,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
java.FixtureWithLastReleaseApis("foo", "baz"),
|
java.FixtureWithLastReleaseApis("foo", "baz"),
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
@@ -731,11 +727,7 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
|
|||||||
|
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
java.FixtureWithLastReleaseApis("foo", "quuz"),
|
java.FixtureWithLastReleaseApis("foo", "quuz"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
apex {
|
apex {
|
||||||
name: "com.android.art",
|
name: "com.android.art",
|
||||||
|
@@ -399,11 +399,7 @@ func TestDexpreoptProfileWithMultiplePrebuiltArtApexes(t *testing.T) {
|
|||||||
java.FixtureConfigureBootJars("com.android.art:core-oj"),
|
java.FixtureConfigureBootJars("com.android.art:core-oj"),
|
||||||
PrepareForTestWithApexBuildComponents,
|
PrepareForTestWithApexBuildComponents,
|
||||||
prepareForTestWithArtApex,
|
prepareForTestWithArtApex,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ART", tc.selectedArtApexContributions),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ART": tc.selectedArtApexContributions,
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, bp)
|
).RunTestWithBp(t, bp)
|
||||||
|
|
||||||
dexBootJars := result.ModuleForTests("dex_bootjars", "android_common")
|
dexBootJars := result.ModuleForTests("dex_bootjars", "android_common")
|
||||||
|
@@ -254,11 +254,7 @@ func TestPlatformBootclasspathDependencies(t *testing.T) {
|
|||||||
java.FixtureWithLastReleaseApis("foo"),
|
java.FixtureWithLastReleaseApis("foo"),
|
||||||
java.PrepareForTestWithDexpreopt,
|
java.PrepareForTestWithDexpreopt,
|
||||||
dexpreopt.FixtureDisableDexpreoptBootImages(false),
|
dexpreopt.FixtureDisableDexpreoptBootImages(false),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
apex {
|
apex {
|
||||||
name: "com.android.art",
|
name: "com.android.art",
|
||||||
@@ -429,10 +425,9 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) {
|
|||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
|
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
|
|
||||||
java.FixtureWithPrebuiltApis(map[string][]string{
|
java.FixtureWithPrebuiltApis(map[string][]string{
|
||||||
"current": {},
|
"current": {},
|
||||||
"30": {"foo"},
|
"30": {"foo"},
|
||||||
@@ -935,11 +930,7 @@ func TestNonBootJarMissingInPrebuiltFragment(t *testing.T) {
|
|||||||
PrepareForTestWithApexBuildComponents,
|
PrepareForTestWithApexBuildComponents,
|
||||||
prepareForTestWithMyapex,
|
prepareForTestWithMyapex,
|
||||||
java.FixtureConfigureApexBootJars(tc.configuredBootJars...),
|
java.FixtureConfigureApexBootJars(tc.configuredBootJars...),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ART", "my_apex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ART": "my_apex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
if tc.errorExpected {
|
if tc.errorExpected {
|
||||||
fixture = fixture.ExtendWithErrorHandler(
|
fixture = fixture.ExtendWithErrorHandler(
|
||||||
|
@@ -3194,12 +3194,7 @@ func TestVendorSdkVersion(t *testing.T) {
|
|||||||
|
|
||||||
ctx = android.GroupFixturePreparers(
|
ctx = android.GroupFixturePreparers(
|
||||||
prepareForCcTest,
|
prepareForCcTest,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_BOARD_API_LEVEL_FROZEN", "true"),
|
||||||
if variables.BuildFlags == nil {
|
|
||||||
variables.BuildFlags = make(map[string]string)
|
|
||||||
}
|
|
||||||
variables.BuildFlags["RELEASE_BOARD_API_LEVEL_FROZEN"] = "true"
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, bp)
|
).RunTestWithBp(t, bp)
|
||||||
testSdkVersionFlag("libfoo", "30")
|
testSdkVersionFlag("libfoo", "30")
|
||||||
testSdkVersionFlag("libbar", "29")
|
testSdkVersionFlag("libbar", "29")
|
||||||
|
@@ -476,11 +476,7 @@ func TestMultiplePrebuilts(t *testing.T) {
|
|||||||
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
||||||
android.RegisterApexContributionsBuildComponents(ctx)
|
android.RegisterApexContributionsBuildComponents(ctx)
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
ctx := testPrebuilt(t, fmt.Sprintf(bp, tc.selectedDependencyName), map[string][]byte{
|
ctx := testPrebuilt(t, fmt.Sprintf(bp, tc.selectedDependencyName), map[string][]byte{
|
||||||
"libbar.so": nil,
|
"libbar.so": nil,
|
||||||
@@ -574,11 +570,7 @@ func TestMultiplePrebuiltsPreferredUsingLegacyFlags(t *testing.T) {
|
|||||||
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
||||||
android.RegisterApexContributionsBuildComponents(ctx)
|
android.RegisterApexContributionsBuildComponents(ctx)
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
if tc.expectedErr != "" {
|
if tc.expectedErr != "" {
|
||||||
preparer = preparer.ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(tc.expectedErr))
|
preparer = preparer.ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(tc.expectedErr))
|
||||||
@@ -638,11 +630,7 @@ func TestMissingVariantInModuleSdk(t *testing.T) {
|
|||||||
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
|
||||||
android.RegisterApexContributionsBuildComponents(ctx)
|
android.RegisterApexContributionsBuildComponents(ctx)
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
ctx := testPrebuilt(t, bp, map[string][]byte{
|
ctx := testPrebuilt(t, bp, map[string][]byte{
|
||||||
"libbar.so": nil,
|
"libbar.so": nil,
|
||||||
|
18
java/base.go
18
java/base.go
@@ -2378,16 +2378,24 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
|
|||||||
case bootClasspathTag:
|
case bootClasspathTag:
|
||||||
// If a system modules dependency has been added to the bootclasspath
|
// If a system modules dependency has been added to the bootclasspath
|
||||||
// then add its libs to the bootclasspath.
|
// then add its libs to the bootclasspath.
|
||||||
sm := module.(SystemModulesProvider)
|
if sm, ok := android.OtherModuleProvider(ctx, module, SystemModulesProvider); ok {
|
||||||
deps.bootClasspath = append(deps.bootClasspath, sm.HeaderJars()...)
|
depHeaderJars := sm.HeaderJars
|
||||||
|
deps.bootClasspath = append(deps.bootClasspath, depHeaderJars...)
|
||||||
|
} else {
|
||||||
|
ctx.PropertyErrorf("boot classpath dependency %q does not provide SystemModulesProvider",
|
||||||
|
ctx.OtherModuleName(module))
|
||||||
|
}
|
||||||
|
|
||||||
case systemModulesTag:
|
case systemModulesTag:
|
||||||
if deps.systemModules != nil {
|
if deps.systemModules != nil {
|
||||||
panic("Found two system module dependencies")
|
panic("Found two system module dependencies")
|
||||||
}
|
}
|
||||||
sm := module.(SystemModulesProvider)
|
if sm, ok := android.OtherModuleProvider(ctx, module, SystemModulesProvider); ok {
|
||||||
outputDir, outputDeps := sm.OutputDirAndDeps()
|
deps.systemModules = &systemModules{sm.OutputDir, sm.OutputDirDeps}
|
||||||
deps.systemModules = &systemModules{outputDir, outputDeps}
|
} else {
|
||||||
|
ctx.PropertyErrorf("system modules dependency %q does not provide SystemModulesProvider",
|
||||||
|
ctx.OtherModuleName(module))
|
||||||
|
}
|
||||||
|
|
||||||
case instrumentationForTag:
|
case instrumentationForTag:
|
||||||
ctx.PropertyErrorf("instrumentation_for", "dependency %q of type %q does not provide JavaInfo so is unsuitable for use with this property", ctx.OtherModuleName(module), ctx.OtherModuleType(module))
|
ctx.PropertyErrorf("instrumentation_for", "dependency %q of type %q does not provide JavaInfo so is unsuitable for use with this property", ctx.OtherModuleName(module), ctx.OtherModuleType(module))
|
||||||
|
@@ -222,11 +222,7 @@ func TestBootclasspathFragment_StubLibs(t *testing.T) {
|
|||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary", "mycoreplatform"),
|
FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary", "mycoreplatform"),
|
||||||
FixtureConfigureApexBootJars("someapex:mysdklibrary"),
|
FixtureConfigureApexBootJars("someapex:mysdklibrary"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
bootclasspath_fragment {
|
bootclasspath_fragment {
|
||||||
name: "myfragment",
|
name: "myfragment",
|
||||||
|
@@ -365,10 +365,10 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
|
|||||||
case bootClasspathTag:
|
case bootClasspathTag:
|
||||||
if dep, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok {
|
if dep, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok {
|
||||||
deps.bootClasspath = append(deps.bootClasspath, dep.ImplementationJars...)
|
deps.bootClasspath = append(deps.bootClasspath, dep.ImplementationJars...)
|
||||||
} else if sm, ok := module.(SystemModulesProvider); ok {
|
} else if sm, ok := android.OtherModuleProvider(ctx, module, SystemModulesProvider); ok {
|
||||||
// A system modules dependency has been added to the bootclasspath
|
// A system modules dependency has been added to the bootclasspath
|
||||||
// so add its libs to the bootclasspath.
|
// so add its libs to the bootclasspath.
|
||||||
deps.bootClasspath = append(deps.bootClasspath, sm.HeaderJars()...)
|
deps.bootClasspath = append(deps.bootClasspath, sm.HeaderJars...)
|
||||||
} else {
|
} else {
|
||||||
panic(fmt.Errorf("unknown dependency %q for %q", otherName, ctx.ModuleName()))
|
panic(fmt.Errorf("unknown dependency %q for %q", otherName, ctx.ModuleName()))
|
||||||
}
|
}
|
||||||
@@ -396,9 +396,12 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
|
|||||||
if deps.systemModules != nil {
|
if deps.systemModules != nil {
|
||||||
panic("Found two system module dependencies")
|
panic("Found two system module dependencies")
|
||||||
}
|
}
|
||||||
sm := module.(SystemModulesProvider)
|
if sm, ok := android.OtherModuleProvider(ctx, module, SystemModulesProvider); ok {
|
||||||
outputDir, outputDeps := sm.OutputDirAndDeps()
|
deps.systemModules = &systemModules{sm.OutputDir, sm.OutputDirDeps}
|
||||||
deps.systemModules = &systemModules{outputDir, outputDeps}
|
} else {
|
||||||
|
ctx.PropertyErrorf("boot classpath dependency %q does not provide SystemModulesProvider",
|
||||||
|
ctx.OtherModuleName(module))
|
||||||
|
}
|
||||||
case aconfigDeclarationTag:
|
case aconfigDeclarationTag:
|
||||||
if dep, ok := android.OtherModuleProvider(ctx, module, android.AconfigDeclarationsProviderKey); ok {
|
if dep, ok := android.OtherModuleProvider(ctx, module, android.AconfigDeclarationsProviderKey); ok {
|
||||||
deps.aconfigProtoFiles = append(deps.aconfigProtoFiles, dep.IntermediateCacheOutputPath)
|
deps.aconfigProtoFiles = append(deps.aconfigProtoFiles, dep.IntermediateCacheOutputPath)
|
||||||
|
@@ -421,11 +421,9 @@ func TestReleaseExportRuntimeApis(t *testing.T) {
|
|||||||
result := android.GroupFixturePreparers(
|
result := android.GroupFixturePreparers(
|
||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
variables.ExportRuntimeApis = proptools.BoolPtr(true)
|
variables.ExportRuntimeApis = proptools.BoolPtr(true)
|
||||||
}),
|
}),
|
||||||
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
android.FixtureMergeMockFs(map[string][]byte{
|
android.FixtureMergeMockFs(map[string][]byte{
|
||||||
"a/A.java": nil,
|
"a/A.java": nil,
|
||||||
"a/current.txt": nil,
|
"a/current.txt": nil,
|
||||||
|
@@ -203,10 +203,8 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
|
|||||||
FixtureConfigureBootJars("platform:foo"),
|
FixtureConfigureBootJars("platform:foo"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(tc.unbundledBuild)
|
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(tc.unbundledBuild)
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
}),
|
||||||
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
java_library {
|
java_library {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
|
@@ -2261,8 +2261,9 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
staticLibs = append(staticLibs, provider.HeaderJars...)
|
staticLibs = append(staticLibs, provider.HeaderJars...)
|
||||||
}
|
}
|
||||||
case systemModulesTag:
|
case systemModulesTag:
|
||||||
module := dep.(SystemModulesProvider)
|
if sm, ok := android.OtherModuleProvider(ctx, dep, SystemModulesProvider); ok {
|
||||||
systemModulesPaths = append(systemModulesPaths, module.HeaderJars()...)
|
systemModulesPaths = append(systemModulesPaths, sm.HeaderJars...)
|
||||||
|
}
|
||||||
case metalavaCurrentApiTimestampTag:
|
case metalavaCurrentApiTimestampTag:
|
||||||
if currentApiTimestampProvider, ok := dep.(currentApiTimestampProvider); ok {
|
if currentApiTimestampProvider, ok := dep.(currentApiTimestampProvider); ok {
|
||||||
al.validationPaths = append(al.validationPaths, currentApiTimestampProvider.CurrentApiTimestamp())
|
al.validationPaths = append(al.validationPaths, currentApiTimestampProvider.CurrentApiTimestamp())
|
||||||
|
@@ -2634,11 +2634,7 @@ func TestMultiplePrebuilts(t *testing.T) {
|
|||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
ctx := android.GroupFixturePreparers(
|
ctx := android.GroupFixturePreparers(
|
||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
|
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
|
||||||
|
|
||||||
// check that rdep gets the correct variation of dep
|
// check that rdep gets the correct variation of dep
|
||||||
@@ -2708,11 +2704,7 @@ func TestMultiplePlatformCompatConfigPrebuilts(t *testing.T) {
|
|||||||
ctx := android.GroupFixturePreparers(
|
ctx := android.GroupFixturePreparers(
|
||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
PrepareForTestWithPlatformCompatConfig,
|
PrepareForTestWithPlatformCompatConfig,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
|
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
|
||||||
|
|
||||||
mergedGlobalConfig := ctx.SingletonForTests("platform_compat_config_singleton").Output("compat_config/merged_compat_config.xml")
|
mergedGlobalConfig := ctx.SingletonForTests("platform_compat_config_singleton").Output("compat_config/merged_compat_config.xml")
|
||||||
|
@@ -35,11 +35,7 @@ func TestJavaSdkLibrary(t *testing.T) {
|
|||||||
"29": {"foo"},
|
"29": {"foo"},
|
||||||
"30": {"bar", "barney", "baz", "betty", "foo", "fred", "quuz", "wilma"},
|
"30": {"bar", "barney", "baz", "betty", "foo", "fred", "quuz", "wilma"},
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
droiddoc_exported_dir {
|
droiddoc_exported_dir {
|
||||||
name: "droiddoc-templates-sdk",
|
name: "droiddoc-templates-sdk",
|
||||||
@@ -537,11 +533,7 @@ func TestJavaSdkLibrary_Deps(t *testing.T) {
|
|||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("sdklib"),
|
FixtureWithLastReleaseApis("sdklib"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
name: "sdklib",
|
name: "sdklib",
|
||||||
@@ -934,11 +926,7 @@ func TestJavaSdkLibraryImport_WithSource(t *testing.T) {
|
|||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("sdklib"),
|
FixtureWithLastReleaseApis("sdklib"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
name: "sdklib",
|
name: "sdklib",
|
||||||
@@ -987,11 +975,7 @@ func testJavaSdkLibraryImport_Preferred(t *testing.T, prefer string, preparer an
|
|||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("sdklib"),
|
FixtureWithLastReleaseApis("sdklib"),
|
||||||
preparer,
|
preparer,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
name: "sdklib",
|
name: "sdklib",
|
||||||
@@ -1183,11 +1167,7 @@ func TestSdkLibraryImport_MetadataModuleSupersedesPreferred(t *testing.T) {
|
|||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("sdklib.source_preferred_using_legacy_flags", "sdklib.prebuilt_preferred_using_legacy_flags"),
|
FixtureWithLastReleaseApis("sdklib.source_preferred_using_legacy_flags", "sdklib.prebuilt_preferred_using_legacy_flags"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "my_mainline_module_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "my_mainline_module_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, bp)
|
).RunTestWithBp(t, bp)
|
||||||
|
|
||||||
// Make sure that rdeps get the correct source vs prebuilt based on mainline_module_contributions
|
// Make sure that rdeps get the correct source vs prebuilt based on mainline_module_contributions
|
||||||
@@ -1369,11 +1349,7 @@ func TestJavaSdkLibraryDist(t *testing.T) {
|
|||||||
"sdklib_group_foo",
|
"sdklib_group_foo",
|
||||||
"sdklib_owner_foo",
|
"sdklib_owner_foo",
|
||||||
"foo"),
|
"foo"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
name: "sdklib_no_group",
|
name: "sdklib_no_group",
|
||||||
@@ -1785,12 +1761,8 @@ func TestStubResolutionOfJavaSdkLibraryInLibs(t *testing.T) {
|
|||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("sdklib"),
|
FixtureWithLastReleaseApis("sdklib"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
// We can use any of the apex contribution build flags from build/soong/android/config.go#mainlineApexContributionBuildFlags here
|
||||||
variables.BuildFlags = map[string]string{
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "my_mainline_module_contributions"),
|
||||||
// We can use any of the apex contribution build flags from build/soong/android/config.go#mainlineApexContributionBuildFlags here
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "my_mainline_module_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
result := fixture.RunTestWithBp(t, bp)
|
result := fixture.RunTestWithBp(t, bp)
|
||||||
@@ -1873,11 +1845,7 @@ func TestMultipleSdkLibraryPrebuilts(t *testing.T) {
|
|||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
PrepareForTestWithJavaSdkLibraryFiles,
|
PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
FixtureWithLastReleaseApis("sdklib", "sdklib.v1", "sdklib.v2"),
|
FixtureWithLastReleaseApis("sdklib", "sdklib.v1", "sdklib.v2"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "my_mainline_module_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "my_mainline_module_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
|
@@ -120,14 +120,16 @@ func SystemModulesFactory() android.Module {
|
|||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
type SystemModulesProvider interface {
|
type SystemModulesProviderInfo struct {
|
||||||
HeaderJars() android.Paths
|
// The aggregated header jars from all jars specified in the libs property.
|
||||||
OutputDirAndDeps() (android.Path, android.Paths)
|
// Used when system module is added as a dependency to bootclasspath.
|
||||||
|
HeaderJars android.Paths
|
||||||
|
|
||||||
|
OutputDir android.Path
|
||||||
|
OutputDirDeps android.Paths
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ SystemModulesProvider = (*SystemModules)(nil)
|
var SystemModulesProvider = blueprint.NewProvider[*SystemModulesProviderInfo]()
|
||||||
|
|
||||||
var _ SystemModulesProvider = (*systemModulesImport)(nil)
|
|
||||||
|
|
||||||
type SystemModules struct {
|
type SystemModules struct {
|
||||||
android.ModuleBase
|
android.ModuleBase
|
||||||
@@ -135,9 +137,6 @@ type SystemModules struct {
|
|||||||
|
|
||||||
properties SystemModulesProperties
|
properties SystemModulesProperties
|
||||||
|
|
||||||
// The aggregated header jars from all jars specified in the libs property.
|
|
||||||
// Used when system module is added as a dependency to bootclasspath.
|
|
||||||
headerJars android.Paths
|
|
||||||
outputDir android.Path
|
outputDir android.Path
|
||||||
outputDeps android.Paths
|
outputDeps android.Paths
|
||||||
}
|
}
|
||||||
@@ -147,17 +146,6 @@ type SystemModulesProperties struct {
|
|||||||
Libs []string
|
Libs []string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (system *SystemModules) HeaderJars() android.Paths {
|
|
||||||
return system.headerJars
|
|
||||||
}
|
|
||||||
|
|
||||||
func (system *SystemModules) OutputDirAndDeps() (android.Path, android.Paths) {
|
|
||||||
if system.outputDir == nil || len(system.outputDeps) == 0 {
|
|
||||||
panic("Missing directory for system module dependency")
|
|
||||||
}
|
|
||||||
return system.outputDir, system.outputDeps
|
|
||||||
}
|
|
||||||
|
|
||||||
func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
var jars android.Paths
|
var jars android.Paths
|
||||||
|
|
||||||
@@ -167,9 +155,13 @@ func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleConte
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
system.headerJars = jars
|
|
||||||
|
|
||||||
system.outputDir, system.outputDeps = TransformJarsToSystemModules(ctx, jars)
|
system.outputDir, system.outputDeps = TransformJarsToSystemModules(ctx, jars)
|
||||||
|
|
||||||
|
android.SetProvider(ctx, SystemModulesProvider, &SystemModulesProviderInfo{
|
||||||
|
HeaderJars: jars,
|
||||||
|
OutputDir: system.outputDir,
|
||||||
|
OutputDirDeps: system.outputDeps,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// ComponentDepsMutator is called before prebuilt modules without a corresponding source module are
|
// ComponentDepsMutator is called before prebuilt modules without a corresponding source module are
|
||||||
|
@@ -182,11 +182,7 @@ func TestMultipleSystemModulesPrebuilts(t *testing.T) {
|
|||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
res := android.GroupFixturePreparers(
|
res := android.GroupFixturePreparers(
|
||||||
prepareForJavaTest,
|
prepareForJavaTest,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_APEX_CONTRIBUTIONS_ADSERVICES", "myapex_contributions"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_APEX_CONTRIBUTIONS_ADSERVICES": "myapex_contributions",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
|
).RunTestWithBp(t, fmt.Sprintf(bp, tc.selectedDependencyName))
|
||||||
|
|
||||||
// check that rdep gets the correct variation of system_modules
|
// check that rdep gets the correct variation of system_modules
|
||||||
|
@@ -276,11 +276,7 @@ func testSnapshotWithBootClasspathFragment_Contents(t *testing.T, sdk string, co
|
|||||||
// Add a platform_bootclasspath that depends on the fragment.
|
// Add a platform_bootclasspath that depends on the fragment.
|
||||||
fixtureAddPlatformBootclasspathForBootclasspathFragment("myapex", "mybootclasspathfragment"),
|
fixtureAddPlatformBootclasspathForBootclasspathFragment("myapex", "mybootclasspathfragment"),
|
||||||
|
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
// Make sure that we have atleast one platform library so that we can check the monolithic hiddenapi
|
// Make sure that we have atleast one platform library so that we can check the monolithic hiddenapi
|
||||||
// file creation.
|
// file creation.
|
||||||
java.FixtureConfigureBootJars("platform:foo"),
|
java.FixtureConfigureBootJars("platform:foo"),
|
||||||
@@ -799,11 +795,7 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) {
|
|||||||
// Add a platform_bootclasspath that depends on the fragment.
|
// Add a platform_bootclasspath that depends on the fragment.
|
||||||
fixtureAddPlatformBootclasspathForBootclasspathFragment("myapex", "mybootclasspathfragment"),
|
fixtureAddPlatformBootclasspathForBootclasspathFragment("myapex", "mybootclasspathfragment"),
|
||||||
|
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
|
|
||||||
android.MockFS{
|
android.MockFS{
|
||||||
"my-blocked.txt": nil,
|
"my-blocked.txt": nil,
|
||||||
@@ -1053,11 +1045,7 @@ func testSnapshotWithBootClasspathFragment_MinSdkVersion(t *testing.T, targetBui
|
|||||||
variables.Platform_version_active_codenames = []string{"VanillaIceCream"}
|
variables.Platform_version_active_codenames = []string{"VanillaIceCream"}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
|
|
||||||
android.FixtureWithRootAndroidBp(`
|
android.FixtureWithRootAndroidBp(`
|
||||||
sdk {
|
sdk {
|
||||||
|
@@ -45,11 +45,7 @@ var prepareForSdkTestWithJavaSdkLibrary = android.GroupFixturePreparers(
|
|||||||
java.PrepareForTestWithJavaDefaultModules,
|
java.PrepareForTestWithJavaDefaultModules,
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
java.FixtureWithLastReleaseApis("myjavalib"),
|
java.FixtureWithLastReleaseApis("myjavalib"),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Contains tests for SDK members provided by the java package.
|
// Contains tests for SDK members provided by the java package.
|
||||||
@@ -666,11 +662,7 @@ func TestSnapshotWithJavaSystemModules(t *testing.T) {
|
|||||||
"1": {"myjavalib"},
|
"1": {"myjavalib"},
|
||||||
"2": {"myjavalib"},
|
"2": {"myjavalib"},
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
sdk {
|
sdk {
|
||||||
name: "mysdk",
|
name: "mysdk",
|
||||||
@@ -1313,11 +1305,7 @@ java_sdk_library_import {
|
|||||||
func TestSnapshotWithJavaSdkLibrary_CompileDex(t *testing.T) {
|
func TestSnapshotWithJavaSdkLibrary_CompileDex(t *testing.T) {
|
||||||
result := android.GroupFixturePreparers(
|
result := android.GroupFixturePreparers(
|
||||||
prepareForSdkTestWithJavaSdkLibrary,
|
prepareForSdkTestWithJavaSdkLibrary,
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTestWithBp(t, `
|
).RunTestWithBp(t, `
|
||||||
sdk {
|
sdk {
|
||||||
name: "mysdk",
|
name: "mysdk",
|
||||||
|
@@ -457,11 +457,7 @@ java_import {
|
|||||||
android.FixtureMergeEnv(map[string]string{
|
android.FixtureMergeEnv(map[string]string{
|
||||||
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
|
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
).RunTest(t)
|
).RunTest(t)
|
||||||
|
|
||||||
CheckSnapshot(t, result, "mysdk", "",
|
CheckSnapshot(t, result, "mysdk", "",
|
||||||
@@ -573,11 +569,9 @@ java_sdk_library_import {
|
|||||||
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
|
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
|
||||||
}),
|
}),
|
||||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
variables.BuildFlags = map[string]string{
|
|
||||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
|
||||||
}
|
|
||||||
variables.Platform_version_active_codenames = []string{"UpsideDownCake", "Tiramisu", "S-V2"}
|
variables.Platform_version_active_codenames = []string{"UpsideDownCake", "Tiramisu", "S-V2"}
|
||||||
}),
|
}),
|
||||||
|
android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
|
||||||
).RunTest(t)
|
).RunTest(t)
|
||||||
|
|
||||||
CheckSnapshot(t, result, "mysdk", "",
|
CheckSnapshot(t, result, "mysdk", "",
|
||||||
|
Reference in New Issue
Block a user