Merge changes from topic "hiddenapi_exportable" into main
* changes: Copy exportable artifacts to module sdk snapshot Enable hiddenapi check for exportable stubs Add defaults support for bootclasspath_fragment module type
This commit is contained in:
commit
7e9343b889
17 changed files with 431 additions and 138 deletions
|
@ -214,6 +214,10 @@ func (c Config) ReleaseNdkAbiMonitored() bool {
|
|||
return c.config.productVariables.GetBuildFlagBool("RELEASE_NDK_ABI_MONITORED")
|
||||
}
|
||||
|
||||
func (c Config) ReleaseHiddenApiExportableStubs() bool {
|
||||
return c.config.productVariables.GetBuildFlagBool("RELEASE_HIDDEN_API_EXPORTABLE_STUBS")
|
||||
}
|
||||
|
||||
// A DeviceConfig object represents the configuration for a particular device
|
||||
// being built. For now there will only be one of these, but in the future there
|
||||
// may be multiple devices being built.
|
||||
|
|
|
@ -109,6 +109,17 @@ func (k SdkKind) DefaultJavaLibraryName() string {
|
|||
}
|
||||
}
|
||||
|
||||
func (k SdkKind) DefaultExportableJavaLibraryName() string {
|
||||
switch k {
|
||||
case SdkPublic, SdkSystem, SdkTest, SdkModule, SdkSystemServer:
|
||||
return k.DefaultJavaLibraryName() + "_exportable"
|
||||
case SdkCore:
|
||||
return k.DefaultJavaLibraryName() + ".exportable"
|
||||
default:
|
||||
panic(fmt.Errorf("API surface %v does not provide exportable stubs", k))
|
||||
}
|
||||
}
|
||||
|
||||
// SdkSpec represents the kind and the version of an SDK for a module to build against
|
||||
type SdkSpec struct {
|
||||
Kind SdkKind
|
||||
|
|
|
@ -53,7 +53,11 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
|
|||
java.FixtureConfigureBootJars("com.android.art:baz", "com.android.art:quuz"),
|
||||
java.FixtureConfigureApexBootJars("someapex:foo", "someapex:bar"),
|
||||
prepareForTestWithArtApex,
|
||||
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
java.FixtureWithLastReleaseApis("foo", "baz"),
|
||||
).RunTestWithBp(t, `
|
||||
|
@ -154,9 +158,9 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
|
|||
artFragment := result.Module("art-bootclasspath-fragment", "android_common")
|
||||
artInfo, _ := android.SingletonModuleProvider(result, artFragment, java.HiddenAPIInfoProvider)
|
||||
|
||||
bazPublicStubs := "out/soong/.intermediates/baz.stubs/android_common/dex/baz.stubs.jar"
|
||||
bazSystemStubs := "out/soong/.intermediates/baz.stubs.system/android_common/dex/baz.stubs.system.jar"
|
||||
bazTestStubs := "out/soong/.intermediates/baz.stubs.test/android_common/dex/baz.stubs.test.jar"
|
||||
bazPublicStubs := "out/soong/.intermediates/baz.stubs.exportable/android_common/dex/baz.stubs.exportable.jar"
|
||||
bazSystemStubs := "out/soong/.intermediates/baz.stubs.exportable.system/android_common/dex/baz.stubs.exportable.system.jar"
|
||||
bazTestStubs := "out/soong/.intermediates/baz.stubs.exportable.test/android_common/dex/baz.stubs.exportable.test.jar"
|
||||
|
||||
checkAPIScopeStubs("art", artInfo, java.PublicHiddenAPIScope, bazPublicStubs)
|
||||
checkAPIScopeStubs("art", artInfo, java.SystemHiddenAPIScope, bazSystemStubs)
|
||||
|
@ -167,8 +171,8 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) {
|
|||
otherFragment := result.Module("other-bootclasspath-fragment", "android_common")
|
||||
otherInfo, _ := android.SingletonModuleProvider(result, otherFragment, java.HiddenAPIInfoProvider)
|
||||
|
||||
fooPublicStubs := "out/soong/.intermediates/foo.stubs/android_common/dex/foo.stubs.jar"
|
||||
fooSystemStubs := "out/soong/.intermediates/foo.stubs.system/android_common/dex/foo.stubs.system.jar"
|
||||
fooPublicStubs := "out/soong/.intermediates/foo.stubs.exportable/android_common/dex/foo.stubs.exportable.jar"
|
||||
fooSystemStubs := "out/soong/.intermediates/foo.stubs.exportable.system/android_common/dex/foo.stubs.exportable.system.jar"
|
||||
|
||||
checkAPIScopeStubs("other", otherInfo, java.PublicHiddenAPIScope, bazPublicStubs, fooPublicStubs)
|
||||
checkAPIScopeStubs("other", otherInfo, java.SystemHiddenAPIScope, bazSystemStubs, fooSystemStubs)
|
||||
|
@ -696,6 +700,11 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
|
|||
|
||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
java.FixtureWithLastReleaseApis("foo", "quuz"),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
apex {
|
||||
name: "com.android.art",
|
||||
|
@ -807,11 +816,11 @@ func TestBootclasspathFragment_HiddenAPIList(t *testing.T) {
|
|||
"foo",
|
||||
})
|
||||
|
||||
fooStubs := getDexJarPath(result, "foo.stubs")
|
||||
quuzPublicStubs := getDexJarPath(result, "quuz.stubs")
|
||||
quuzSystemStubs := getDexJarPath(result, "quuz.stubs.system")
|
||||
quuzTestStubs := getDexJarPath(result, "quuz.stubs.test")
|
||||
quuzModuleLibStubs := getDexJarPath(result, "quuz.stubs.module_lib")
|
||||
fooStubs := getDexJarPath(result, "foo.stubs.exportable")
|
||||
quuzPublicStubs := getDexJarPath(result, "quuz.stubs.exportable")
|
||||
quuzSystemStubs := getDexJarPath(result, "quuz.stubs.exportable.system")
|
||||
quuzTestStubs := getDexJarPath(result, "quuz.stubs.exportable.test")
|
||||
quuzModuleLibStubs := getDexJarPath(result, "quuz.stubs.exportable.module_lib")
|
||||
|
||||
// Make sure that the fragment uses the quuz stub dex jars when generating the hidden API flags.
|
||||
fragment := result.ModuleForTests("mybootclasspathfragment", "android_common_apex10000")
|
||||
|
|
|
@ -252,6 +252,11 @@ func TestPlatformBootclasspathDependencies(t *testing.T) {
|
|||
java.FixtureWithLastReleaseApis("foo"),
|
||||
java.PrepareForTestWithDexpreopt,
|
||||
dexpreopt.FixtureDisableDexpreoptBootImages(false),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
apex {
|
||||
name: "com.android.art",
|
||||
|
@ -386,10 +391,10 @@ func TestPlatformBootclasspathDependencies(t *testing.T) {
|
|||
`platform:all_apex_contributions`,
|
||||
|
||||
// The following are stubs.
|
||||
`platform:android_stubs_current`,
|
||||
`platform:android_system_stubs_current`,
|
||||
`platform:android_test_stubs_current`,
|
||||
`platform:legacy.core.platform.api.stubs`,
|
||||
`platform:android_stubs_current_exportable`,
|
||||
`platform:android_system_stubs_current_exportable`,
|
||||
`platform:android_test_stubs_current_exportable`,
|
||||
`platform:legacy.core.platform.api.stubs.exportable`,
|
||||
|
||||
// Needed for generating the boot image.
|
||||
`platform:dex2oatd`,
|
||||
|
@ -422,6 +427,9 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) {
|
|||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(true)
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
java.FixtureWithPrebuiltApis(map[string][]string{
|
||||
"current": {},
|
||||
|
@ -546,7 +554,7 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) {
|
|||
"platform:prebuilt_sdk_test_current_android",
|
||||
|
||||
// Not a prebuilt as no prebuilt existed when it was added.
|
||||
"platform:legacy.core.platform.api.stubs",
|
||||
"platform:legacy.core.platform.api.stubs.exportable",
|
||||
|
||||
// The platform_bootclasspath intentionally adds dependencies on both source and prebuilt
|
||||
// modules when available as it does not know which one will be preferred.
|
||||
|
|
|
@ -229,6 +229,7 @@ type SourceOnlyBootclasspathProperties struct {
|
|||
|
||||
type BootclasspathFragmentModule struct {
|
||||
android.ModuleBase
|
||||
android.DefaultableModuleBase
|
||||
android.ApexModuleBase
|
||||
ClasspathFragmentBase
|
||||
|
||||
|
@ -267,6 +268,7 @@ func bootclasspathFragmentFactory() android.Module {
|
|||
android.InitApexModule(m)
|
||||
initClasspathFragment(m, BOOTCLASSPATH)
|
||||
android.InitAndroidArchModule(m, android.DeviceSupported, android.MultilibCommon)
|
||||
android.InitDefaultableModule(m)
|
||||
|
||||
android.AddLoadHook(m, func(ctx android.LoadHookContext) {
|
||||
// If code coverage has been enabled for the framework then append the properties with
|
||||
|
@ -399,6 +401,11 @@ func (i BootclasspathFragmentApexContentInfo) ProfileInstallPathInApex() string
|
|||
|
||||
func (b *BootclasspathFragmentModule) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
|
||||
tag := ctx.OtherModuleDependencyTag(dep)
|
||||
|
||||
// If the module is a default module, do not check the tag
|
||||
if _, ok := dep.(*Defaults); ok {
|
||||
return true
|
||||
}
|
||||
if IsBootclasspathFragmentContentDepTag(tag) {
|
||||
// Boot image contents are automatically added to apex.
|
||||
return true
|
||||
|
|
|
@ -222,6 +222,11 @@ func TestBootclasspathFragment_StubLibs(t *testing.T) {
|
|||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary", "mycoreplatform"),
|
||||
FixtureConfigureApexBootJars("someapex:mysdklibrary"),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
bootclasspath_fragment {
|
||||
name: "myfragment",
|
||||
|
@ -277,11 +282,11 @@ func TestBootclasspathFragment_StubLibs(t *testing.T) {
|
|||
stubsJar := "out/soong/.intermediates/mystublib/android_common/dex/mystublib.jar"
|
||||
|
||||
// Stubs jars for mysdklibrary
|
||||
publicStubsJar := "out/soong/.intermediates/mysdklibrary.stubs/android_common/dex/mysdklibrary.stubs.jar"
|
||||
systemStubsJar := "out/soong/.intermediates/mysdklibrary.stubs.system/android_common/dex/mysdklibrary.stubs.system.jar"
|
||||
publicStubsJar := "out/soong/.intermediates/mysdklibrary.stubs.exportable/android_common/dex/mysdklibrary.stubs.exportable.jar"
|
||||
systemStubsJar := "out/soong/.intermediates/mysdklibrary.stubs.exportable.system/android_common/dex/mysdklibrary.stubs.exportable.system.jar"
|
||||
|
||||
// Stubs jars for myothersdklibrary
|
||||
otherPublicStubsJar := "out/soong/.intermediates/myothersdklibrary.stubs/android_common/dex/myothersdklibrary.stubs.jar"
|
||||
otherPublicStubsJar := "out/soong/.intermediates/myothersdklibrary.stubs.exportable/android_common/dex/myothersdklibrary.stubs.exportable.jar"
|
||||
|
||||
// Check that SdkPublic uses public stubs for all sdk libraries.
|
||||
android.AssertPathsRelativeToTopEquals(t, "public dex stubs jar", []string{otherPublicStubsJar, publicStubsJar, stubsJar}, info.TransitiveStubDexJarsByScope.StubDexJarsForScope(PublicHiddenAPIScope))
|
||||
|
|
|
@ -38,9 +38,6 @@ java_defaults {
|
|||
visibility: ["//visibility:public"],
|
||||
sdk_version: "none",
|
||||
system_modules: "none",
|
||||
dist: {
|
||||
targets: dist_targets,
|
||||
},
|
||||
}
|
||||
|
||||
java_library {
|
||||
|
@ -89,6 +86,32 @@ java_library {
|
|||
},
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "core.current.stubs.exportable.from-source",
|
||||
defaults: [
|
||||
"core.current.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"art.module.public.api.stubs.exportable",
|
||||
"conscrypt.module.public.api.stubs.exportable",
|
||||
"i18n.module.public.api.stubs.exportable",
|
||||
],
|
||||
dist: {
|
||||
targets: dist_targets,
|
||||
dest: "core.current.stubs.jar",
|
||||
},
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "core.current.stubs.exportable",
|
||||
defaults: [
|
||||
"core.current.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"core.current.stubs.exportable.from-source",
|
||||
],
|
||||
}
|
||||
|
||||
// Distributed with the SDK for turning into system modules to compile apps
|
||||
// against.
|
||||
//
|
||||
|
@ -298,6 +321,19 @@ java_library {
|
|||
],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "legacy.core.platform.api.stubs.exportable.from-source",
|
||||
visibility: core_platform_visibility,
|
||||
defaults: [
|
||||
"core.platform.api.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"art.module.public.api.stubs.exportable.module_lib",
|
||||
"conscrypt.module.platform.api.stubs.exportable",
|
||||
"legacy.i18n.module.platform.api.stubs.exportable",
|
||||
],
|
||||
}
|
||||
|
||||
java_defaults {
|
||||
name: "android_core_platform_stubs_current_contributions",
|
||||
api_surface: "core_platform",
|
||||
|
@ -345,6 +381,17 @@ java_library {
|
|||
},
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "legacy.core.platform.api.stubs.exportable",
|
||||
visibility: core_platform_visibility,
|
||||
defaults: [
|
||||
"core.platform.api.stubs.defaults",
|
||||
],
|
||||
static_libs: [
|
||||
"legacy.core.platform.api.stubs.exportable.from-source",
|
||||
],
|
||||
}
|
||||
|
||||
java_defaults {
|
||||
name: "core.platform.api.stubs.defaults",
|
||||
hostdex: true,
|
||||
|
|
|
@ -199,6 +199,10 @@ type ApiStubsSrcProvider interface {
|
|||
StubsSrcJar() android.Path
|
||||
}
|
||||
|
||||
type ExportableApiStubsSrcProvider interface {
|
||||
ExportableStubsSrcJar() android.Path
|
||||
}
|
||||
|
||||
// Provider of information about API stubs, used by java_sdk_library.
|
||||
type ApiStubsProvider interface {
|
||||
AnnotationsZip() android.Path
|
||||
|
@ -208,6 +212,14 @@ type ApiStubsProvider interface {
|
|||
ApiStubsSrcProvider
|
||||
}
|
||||
|
||||
type ExportableApiStubsProvider interface {
|
||||
ExportableAnnotationsZip() android.Path
|
||||
ExportableApiFilePath() android.Path
|
||||
ExportableRemovedApiFilePath() android.Path
|
||||
|
||||
ExportableApiStubsSrcProvider
|
||||
}
|
||||
|
||||
type currentApiTimestampProvider interface {
|
||||
CurrentApiTimestamp() android.Path
|
||||
}
|
||||
|
|
|
@ -245,12 +245,22 @@ func hiddenAPIComputeMonolithicStubLibModules(config android.Config) map[*Hidden
|
|||
testStubModules = append(testStubModules, "sdk_test_current_android")
|
||||
} else {
|
||||
// Use stub modules built from source
|
||||
publicStubModules = append(publicStubModules, android.SdkPublic.DefaultJavaLibraryName())
|
||||
systemStubModules = append(systemStubModules, android.SdkSystem.DefaultJavaLibraryName())
|
||||
testStubModules = append(testStubModules, android.SdkTest.DefaultJavaLibraryName())
|
||||
if config.ReleaseHiddenApiExportableStubs() {
|
||||
publicStubModules = append(publicStubModules, android.SdkPublic.DefaultExportableJavaLibraryName())
|
||||
systemStubModules = append(systemStubModules, android.SdkSystem.DefaultExportableJavaLibraryName())
|
||||
testStubModules = append(testStubModules, android.SdkTest.DefaultExportableJavaLibraryName())
|
||||
} else {
|
||||
publicStubModules = append(publicStubModules, android.SdkPublic.DefaultJavaLibraryName())
|
||||
systemStubModules = append(systemStubModules, android.SdkSystem.DefaultJavaLibraryName())
|
||||
testStubModules = append(testStubModules, android.SdkTest.DefaultJavaLibraryName())
|
||||
}
|
||||
}
|
||||
// We do not have prebuilts of the core platform api yet
|
||||
corePlatformStubModules = append(corePlatformStubModules, "legacy.core.platform.api.stubs")
|
||||
if config.ReleaseHiddenApiExportableStubs() {
|
||||
corePlatformStubModules = append(corePlatformStubModules, "legacy.core.platform.api.stubs.exportable")
|
||||
} else {
|
||||
corePlatformStubModules = append(corePlatformStubModules, "legacy.core.platform.api.stubs")
|
||||
}
|
||||
|
||||
// Allow products to define their own stubs for custom product jars that apps can use.
|
||||
publicStubModules = append(publicStubModules, config.ProductHiddenAPIStubs()...)
|
||||
|
@ -289,7 +299,12 @@ func hiddenAPIAddStubLibDependencies(ctx android.BottomUpMutatorContext, apiScop
|
|||
func hiddenAPIRetrieveDexJarBuildPath(ctx android.ModuleContext, module android.Module, kind android.SdkKind) android.Path {
|
||||
var dexJar OptionalDexJarPath
|
||||
if sdkLibrary, ok := module.(SdkLibraryDependency); ok {
|
||||
dexJar = sdkLibrary.SdkApiStubDexJar(ctx, kind)
|
||||
if ctx.Config().ReleaseHiddenApiExportableStubs() {
|
||||
dexJar = sdkLibrary.SdkApiExportableStubDexJar(ctx, kind)
|
||||
} else {
|
||||
dexJar = sdkLibrary.SdkApiStubDexJar(ctx, kind)
|
||||
}
|
||||
|
||||
} else if j, ok := module.(UsesLibraryDependency); ok {
|
||||
dexJar = j.DexJarBuildPath(ctx)
|
||||
} else {
|
||||
|
|
|
@ -177,10 +177,10 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
|
|||
{
|
||||
name: "testBundled",
|
||||
unbundledBuild: false,
|
||||
publicStub: "android_stubs_current",
|
||||
systemStub: "android_system_stubs_current",
|
||||
testStub: "android_test_stubs_current",
|
||||
corePlatformStub: "legacy.core.platform.api.stubs",
|
||||
publicStub: "android_stubs_current_exportable",
|
||||
systemStub: "android_system_stubs_current_exportable",
|
||||
testStub: "android_test_stubs_current_exportable",
|
||||
corePlatformStub: "legacy.core.platform.api.stubs.exportable",
|
||||
preparer: android.GroupFixturePreparers(),
|
||||
}, {
|
||||
name: "testUnbundled",
|
||||
|
@ -188,7 +188,7 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
|
|||
publicStub: "sdk_public_current_android",
|
||||
systemStub: "sdk_system_current_android",
|
||||
testStub: "sdk_test_current_android",
|
||||
corePlatformStub: "legacy.core.platform.api.stubs",
|
||||
corePlatformStub: "legacy.core.platform.api.stubs.exportable",
|
||||
preparer: PrepareForTestWithPrebuiltsOfCurrentApi,
|
||||
},
|
||||
}
|
||||
|
@ -200,6 +200,9 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
|
|||
prepareForTestWithDefaultPlatformBootclasspath,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(tc.unbundledBuild)
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTest(t)
|
||||
|
||||
|
|
|
@ -2726,6 +2726,8 @@ func DefaultsFactory() android.Module {
|
|||
&LintProperties{},
|
||||
&appTestHelperAppProperties{},
|
||||
&JavaApiLibraryProperties{},
|
||||
&bootclasspathFragmentProperties{},
|
||||
&SourceOnlyBootclasspathProperties{},
|
||||
)
|
||||
|
||||
android.InitDefaultsModule(module)
|
||||
|
|
|
@ -104,9 +104,16 @@ type apiScope struct {
|
|||
// The name of the property in the java_sdk_library_import
|
||||
propertyName string
|
||||
|
||||
// The tag to use to depend on the stubs library module.
|
||||
// The tag to use to depend on the stubs library module if the parent module
|
||||
// does not differentiate everything and exportable stubs (e.g. sdk_library_import).
|
||||
stubsTag scopeDependencyTag
|
||||
|
||||
// The tag to use to depend on the everything stubs library module.
|
||||
everythingStubsTag scopeDependencyTag
|
||||
|
||||
// The tag to use to depend on the exportable stubs library module.
|
||||
exportableStubsTag scopeDependencyTag
|
||||
|
||||
// The tag to use to depend on the stubs source module (if separate from the API module).
|
||||
stubsSourceTag scopeDependencyTag
|
||||
|
||||
|
@ -172,6 +179,16 @@ func initApiScope(scope *apiScope) *apiScope {
|
|||
apiScope: scope,
|
||||
depInfoExtractor: (*scopePaths).extractStubsLibraryInfoFromDependency,
|
||||
}
|
||||
scope.everythingStubsTag = scopeDependencyTag{
|
||||
name: name + "-stubs-everything",
|
||||
apiScope: scope,
|
||||
depInfoExtractor: (*scopePaths).extractEverythingStubsLibraryInfoFromDependency,
|
||||
}
|
||||
scope.exportableStubsTag = scopeDependencyTag{
|
||||
name: name + "-stubs-exportable",
|
||||
apiScope: scope,
|
||||
depInfoExtractor: (*scopePaths).extractExportableStubsLibraryInfoFromDependency,
|
||||
}
|
||||
scope.stubsSourceTag = scopeDependencyTag{
|
||||
name: name + "-stubs-source",
|
||||
apiScope: scope,
|
||||
|
@ -669,6 +686,11 @@ type scopePaths struct {
|
|||
// This is not the implementation jar, it still only contains stubs.
|
||||
stubsDexJarPath OptionalDexJarPath
|
||||
|
||||
// The exportable dex jar for the stubs.
|
||||
// This is not the implementation jar, it still only contains stubs.
|
||||
// Includes unflagged apis and flagged apis enabled by release configurations.
|
||||
exportableStubsDexJarPath OptionalDexJarPath
|
||||
|
||||
// The API specification file, e.g. system_current.txt.
|
||||
currentApiFilePath android.OptionalPath
|
||||
|
||||
|
@ -695,6 +717,36 @@ func (paths *scopePaths) extractStubsLibraryInfoFromDependency(ctx android.Modul
|
|||
|
||||
libDep := dep.(UsesLibraryDependency)
|
||||
paths.stubsDexJarPath = libDep.DexJarBuildPath(ctx)
|
||||
paths.exportableStubsDexJarPath = libDep.DexJarBuildPath(ctx)
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf("expected module that has JavaInfoProvider, e.g. java_library")
|
||||
}
|
||||
}
|
||||
|
||||
func (paths *scopePaths) extractEverythingStubsLibraryInfoFromDependency(ctx android.ModuleContext, dep android.Module) error {
|
||||
if lib, ok := android.OtherModuleProvider(ctx, dep, JavaInfoProvider); ok {
|
||||
paths.stubsHeaderPath = lib.HeaderJars
|
||||
if !ctx.Config().ReleaseHiddenApiExportableStubs() {
|
||||
paths.stubsImplPath = lib.ImplementationJars
|
||||
}
|
||||
|
||||
libDep := dep.(UsesLibraryDependency)
|
||||
paths.stubsDexJarPath = libDep.DexJarBuildPath(ctx)
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf("expected module that has JavaInfoProvider, e.g. java_library")
|
||||
}
|
||||
}
|
||||
|
||||
func (paths *scopePaths) extractExportableStubsLibraryInfoFromDependency(ctx android.ModuleContext, dep android.Module) error {
|
||||
if lib, ok := android.OtherModuleProvider(ctx, dep, JavaInfoProvider); ok {
|
||||
if ctx.Config().ReleaseHiddenApiExportableStubs() {
|
||||
paths.stubsImplPath = lib.ImplementationJars
|
||||
}
|
||||
|
||||
libDep := dep.(UsesLibraryDependency)
|
||||
paths.exportableStubsDexJarPath = libDep.DexJarBuildPath(ctx)
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf("expected module that has JavaInfoProvider, e.g. java_library")
|
||||
|
@ -710,6 +762,15 @@ func (paths *scopePaths) treatDepAsApiStubsProvider(dep android.Module, action f
|
|||
}
|
||||
}
|
||||
|
||||
func (paths *scopePaths) treatDepAsExportableApiStubsProvider(dep android.Module, action func(provider ExportableApiStubsProvider)) error {
|
||||
if exportableApiStubsProvider, ok := dep.(ExportableApiStubsProvider); ok {
|
||||
action(exportableApiStubsProvider)
|
||||
return nil
|
||||
} else {
|
||||
return fmt.Errorf("expected module that implements ExportableApiStubsSrcProvider, e.g. droidstubs")
|
||||
}
|
||||
}
|
||||
|
||||
func (paths *scopePaths) treatDepAsApiStubsSrcProvider(dep android.Module, action func(provider ApiStubsSrcProvider)) error {
|
||||
if apiStubsProvider, ok := dep.(ApiStubsSrcProvider); ok {
|
||||
action(apiStubsProvider)
|
||||
|
@ -725,6 +786,12 @@ func (paths *scopePaths) extractApiInfoFromApiStubsProvider(provider ApiStubsPro
|
|||
paths.removedApiFilePath = android.OptionalPathForPath(provider.RemovedApiFilePath())
|
||||
}
|
||||
|
||||
func (paths *scopePaths) extractApiInfoFromExportableApiStubsProvider(provider ExportableApiStubsProvider) {
|
||||
paths.annotationsZip = android.OptionalPathForPath(provider.ExportableAnnotationsZip())
|
||||
paths.currentApiFilePath = android.OptionalPathForPath(provider.ExportableApiFilePath())
|
||||
paths.removedApiFilePath = android.OptionalPathForPath(provider.ExportableRemovedApiFilePath())
|
||||
}
|
||||
|
||||
func (paths *scopePaths) extractApiInfoFromDep(ctx android.ModuleContext, dep android.Module) error {
|
||||
return paths.treatDepAsApiStubsProvider(dep, func(provider ApiStubsProvider) {
|
||||
paths.extractApiInfoFromApiStubsProvider(provider)
|
||||
|
@ -735,6 +802,10 @@ func (paths *scopePaths) extractStubsSourceInfoFromApiStubsProviders(provider Ap
|
|||
paths.stubsSrcJar = android.OptionalPathForPath(provider.StubsSrcJar())
|
||||
}
|
||||
|
||||
func (paths *scopePaths) extractStubsSourceInfoFromExportableApiStubsProviders(provider ExportableApiStubsSrcProvider) {
|
||||
paths.stubsSrcJar = android.OptionalPathForPath(provider.ExportableStubsSrcJar())
|
||||
}
|
||||
|
||||
func (paths *scopePaths) extractStubsSourceInfoFromDep(ctx android.ModuleContext, dep android.Module) error {
|
||||
return paths.treatDepAsApiStubsSrcProvider(dep, func(provider ApiStubsSrcProvider) {
|
||||
paths.extractStubsSourceInfoFromApiStubsProviders(provider)
|
||||
|
@ -742,6 +813,12 @@ func (paths *scopePaths) extractStubsSourceInfoFromDep(ctx android.ModuleContext
|
|||
}
|
||||
|
||||
func (paths *scopePaths) extractStubsSourceAndApiInfoFromApiStubsProvider(ctx android.ModuleContext, dep android.Module) error {
|
||||
if ctx.Config().ReleaseHiddenApiExportableStubs() {
|
||||
return paths.treatDepAsExportableApiStubsProvider(dep, func(provider ExportableApiStubsProvider) {
|
||||
paths.extractApiInfoFromExportableApiStubsProvider(provider)
|
||||
paths.extractStubsSourceInfoFromExportableApiStubsProviders(provider)
|
||||
})
|
||||
}
|
||||
return paths.treatDepAsApiStubsProvider(dep, func(provider ApiStubsProvider) {
|
||||
paths.extractApiInfoFromApiStubsProvider(provider)
|
||||
paths.extractStubsSourceInfoFromApiStubsProviders(provider)
|
||||
|
@ -1131,6 +1208,16 @@ func (c *commonToSdkLibraryAndImport) SdkApiStubDexJar(ctx android.BaseModuleCon
|
|||
return paths.stubsDexJarPath
|
||||
}
|
||||
|
||||
// to satisfy SdkLibraryDependency interface
|
||||
func (c *commonToSdkLibraryAndImport) SdkApiExportableStubDexJar(ctx android.BaseModuleContext, kind android.SdkKind) OptionalDexJarPath {
|
||||
paths := c.selectScopePaths(ctx, kind)
|
||||
if paths == nil {
|
||||
return makeUnsetDexJarPath()
|
||||
}
|
||||
|
||||
return paths.exportableStubsDexJarPath
|
||||
}
|
||||
|
||||
// to satisfy SdkLibraryDependency interface
|
||||
func (c *commonToSdkLibraryAndImport) SdkRemovedTxtFile(ctx android.BaseModuleContext, kind android.SdkKind) android.OptionalPath {
|
||||
apiScope := sdkKindToApiScope(kind)
|
||||
|
@ -1249,10 +1336,16 @@ type SdkLibraryDependency interface {
|
|||
// they are identical to the corresponding header jars.
|
||||
SdkImplementationJars(ctx android.BaseModuleContext, sdkVersion android.SdkSpec) android.Paths
|
||||
|
||||
// SdkApiStubDexJar returns the dex jar for the stubs. It is needed by the hiddenapi processing
|
||||
// tool which processes dex files.
|
||||
// SdkApiStubDexJar returns the dex jar for the stubs for the prebuilt
|
||||
// java_sdk_library_import module. It is needed by the hiddenapi processing tool which
|
||||
// processes dex files.
|
||||
SdkApiStubDexJar(ctx android.BaseModuleContext, kind android.SdkKind) OptionalDexJarPath
|
||||
|
||||
// SdkApiExportableStubDexJar returns the exportable dex jar for the stubs for
|
||||
// java_sdk_library module. It is needed by the hiddenapi processing tool which processes
|
||||
// dex files.
|
||||
SdkApiExportableStubDexJar(ctx android.BaseModuleContext, kind android.SdkKind) OptionalDexJarPath
|
||||
|
||||
// SdkRemovedTxtFile returns the optional path to the removed.txt file for the specified sdk kind.
|
||||
SdkRemovedTxtFile(ctx android.BaseModuleContext, kind android.SdkKind) android.OptionalPath
|
||||
|
||||
|
@ -1365,8 +1458,10 @@ func (module *SdkLibrary) ComponentDepsMutator(ctx android.BottomUpMutatorContex
|
|||
for _, apiScope := range module.getGeneratedApiScopes(ctx) {
|
||||
// Add dependencies to the stubs library
|
||||
stubModuleName := module.stubsLibraryModuleName(apiScope)
|
||||
ctx.AddVariationDependencies(nil, apiScope.everythingStubsTag, stubModuleName)
|
||||
|
||||
ctx.AddVariationDependencies(nil, apiScope.stubsTag, stubModuleName)
|
||||
exportableStubModuleName := module.exportableStubsLibraryModuleName(apiScope)
|
||||
ctx.AddVariationDependencies(nil, apiScope.exportableStubsTag, exportableStubModuleName)
|
||||
|
||||
// Add a dependency on the stubs source in order to access both stubs source and api information.
|
||||
ctx.AddVariationDependencies(nil, apiScope.stubsSourceAndApiTag, module.stubsSourceModuleName(apiScope))
|
||||
|
|
|
@ -38,6 +38,11 @@ func TestJavaSdkLibrary(t *testing.T) {
|
|||
android.FixtureModifyConfig(func(config android.Config) {
|
||||
config.SetApiLibraries([]string{"foo"})
|
||||
}),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
droiddoc_exported_dir {
|
||||
name: "droiddoc-templates-sdk",
|
||||
|
@ -139,6 +144,9 @@ func TestJavaSdkLibrary(t *testing.T) {
|
|||
"foo.api.public.latest",
|
||||
"foo.api.system.latest",
|
||||
"foo.stubs",
|
||||
"foo.stubs.exportable",
|
||||
"foo.stubs.exportable.system",
|
||||
"foo.stubs.exportable.test",
|
||||
"foo.stubs.source",
|
||||
"foo.stubs.source.system",
|
||||
"foo.stubs.source.test",
|
||||
|
@ -529,6 +537,11 @@ func TestJavaSdkLibrary_Deps(t *testing.T) {
|
|||
prepareForJavaTest,
|
||||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("sdklib"),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
java_sdk_library {
|
||||
name: "sdklib",
|
||||
|
@ -547,6 +560,7 @@ func TestJavaSdkLibrary_Deps(t *testing.T) {
|
|||
`sdklib.api.public.latest`,
|
||||
`sdklib.impl`,
|
||||
`sdklib.stubs`,
|
||||
`sdklib.stubs.exportable`,
|
||||
`sdklib.stubs.source`,
|
||||
`sdklib.xml`,
|
||||
})
|
||||
|
@ -919,6 +933,11 @@ func TestJavaSdkLibraryImport_WithSource(t *testing.T) {
|
|||
prepareForJavaTest,
|
||||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("sdklib"),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
java_sdk_library {
|
||||
name: "sdklib",
|
||||
|
@ -945,6 +964,7 @@ func TestJavaSdkLibraryImport_WithSource(t *testing.T) {
|
|||
`sdklib.api.public.latest`,
|
||||
`sdklib.impl`,
|
||||
`sdklib.stubs`,
|
||||
`sdklib.stubs.exportable`,
|
||||
`sdklib.stubs.source`,
|
||||
`sdklib.xml`,
|
||||
})
|
||||
|
@ -966,6 +986,11 @@ func testJavaSdkLibraryImport_Preferred(t *testing.T, prefer string, preparer an
|
|||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("sdklib"),
|
||||
preparer,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
java_sdk_library {
|
||||
name: "sdklib",
|
||||
|
@ -1018,6 +1043,7 @@ func testJavaSdkLibraryImport_Preferred(t *testing.T, prefer string, preparer an
|
|||
`sdklib.api.public.latest`,
|
||||
`sdklib.impl`,
|
||||
`sdklib.stubs`,
|
||||
`sdklib.stubs.exportable`,
|
||||
`sdklib.stubs.source`,
|
||||
`sdklib.xml`,
|
||||
})
|
||||
|
|
|
@ -407,6 +407,14 @@ func gatherRequiredDepsForTest() string {
|
|||
"legacy.core.platform.api.stubs",
|
||||
"stable.core.platform.api.stubs",
|
||||
|
||||
"android_stubs_current_exportable",
|
||||
"android_system_stubs_current_exportable",
|
||||
"android_test_stubs_current_exportable",
|
||||
"android_module_lib_stubs_current_exportable",
|
||||
"android_system_server_stubs_current_exportable",
|
||||
"core.current.stubs.exportable",
|
||||
"legacy.core.platform.api.stubs.exportable",
|
||||
|
||||
"kotlin-stdlib",
|
||||
"kotlin-stdlib-jdk7",
|
||||
"kotlin-stdlib-jdk8",
|
||||
|
|
|
@ -270,6 +270,12 @@ func testSnapshotWithBootClasspathFragment_Contents(t *testing.T, sdk string, co
|
|||
// Add a platform_bootclasspath that depends on the fragment.
|
||||
fixtureAddPlatformBootclasspathForBootclasspathFragment("myapex", "mybootclasspathfragment"),
|
||||
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
|
||||
android.FixtureWithRootAndroidBp(sdk+`
|
||||
apex {
|
||||
name: "myapex",
|
||||
|
@ -489,15 +495,15 @@ func TestSnapshotWithBootClasspathFragment_Contents(t *testing.T) {
|
|||
.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/filtered-stub-flags.csv -> hiddenapi/filtered-stub-flags.csv
|
||||
.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/filtered-flags.csv -> hiddenapi/filtered-flags.csv
|
||||
.intermediates/mysdk/common_os/empty -> java_boot_libs/snapshot/jars/are/invalid/mybootlib.jar
|
||||
.intermediates/myothersdklibrary.stubs/android_common/combined/myothersdklibrary.stubs.jar -> sdk_library/public/myothersdklibrary-stubs.jar
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/everything/myothersdklibrary.stubs.source_api.txt -> sdk_library/public/myothersdklibrary.txt
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/everything/myothersdklibrary.stubs.source_removed.txt -> sdk_library/public/myothersdklibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs/android_common/combined/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mycoreplatform.stubs/android_common/combined/mycoreplatform.stubs.jar -> sdk_library/public/mycoreplatform-stubs.jar
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/everything/mycoreplatform.stubs.source_api.txt -> sdk_library/public/mycoreplatform.txt
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/everything/mycoreplatform.stubs.source_removed.txt -> sdk_library/public/mycoreplatform-removed.txt
|
||||
.intermediates/myothersdklibrary.stubs.exportable/android_common/combined/myothersdklibrary.stubs.exportable.jar -> sdk_library/public/myothersdklibrary-stubs.jar
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/exportable/myothersdklibrary.stubs.source_api.txt -> sdk_library/public/myothersdklibrary.txt
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/exportable/myothersdklibrary.stubs.source_removed.txt -> sdk_library/public/myothersdklibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs.exportable/android_common/combined/mysdklibrary.stubs.exportable.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mycoreplatform.stubs.exportable/android_common/combined/mycoreplatform.stubs.exportable.jar -> sdk_library/public/mycoreplatform-stubs.jar
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/exportable/mycoreplatform.stubs.source_api.txt -> sdk_library/public/mycoreplatform.txt
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/exportable/mycoreplatform.stubs.source_removed.txt -> sdk_library/public/mycoreplatform-removed.txt
|
||||
`)
|
||||
})
|
||||
|
||||
|
@ -509,15 +515,15 @@ func TestSnapshotWithBootClasspathFragment_Contents(t *testing.T) {
|
|||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi/filtered-stub-flags.csv -> hiddenapi/filtered-stub-flags.csv
|
||||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi/filtered-flags.csv -> hiddenapi/filtered-flags.csv
|
||||
.intermediates/mysdk/common_os/empty -> java_boot_libs/snapshot/jars/are/invalid/mybootlib.jar
|
||||
.intermediates/myothersdklibrary.stubs/android_common/combined/myothersdklibrary.stubs.jar -> sdk_library/public/myothersdklibrary-stubs.jar
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/everything/myothersdklibrary.stubs.source_api.txt -> sdk_library/public/myothersdklibrary.txt
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/everything/myothersdklibrary.stubs.source_removed.txt -> sdk_library/public/myothersdklibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs/android_common/combined/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mycoreplatform.stubs/android_common/combined/mycoreplatform.stubs.jar -> sdk_library/public/mycoreplatform-stubs.jar
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/everything/mycoreplatform.stubs.source_api.txt -> sdk_library/public/mycoreplatform.txt
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/everything/mycoreplatform.stubs.source_removed.txt -> sdk_library/public/mycoreplatform-removed.txt
|
||||
.intermediates/myothersdklibrary.stubs.exportable/android_common/combined/myothersdklibrary.stubs.exportable.jar -> sdk_library/public/myothersdklibrary-stubs.jar
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/exportable/myothersdklibrary.stubs.source_api.txt -> sdk_library/public/myothersdklibrary.txt
|
||||
.intermediates/myothersdklibrary.stubs.source/android_common/exportable/myothersdklibrary.stubs.source_removed.txt -> sdk_library/public/myothersdklibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs.exportable/android_common/combined/mysdklibrary.stubs.exportable.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mycoreplatform.stubs.exportable/android_common/combined/mycoreplatform.stubs.exportable.jar -> sdk_library/public/mycoreplatform-stubs.jar
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/exportable/mycoreplatform.stubs.source_api.txt -> sdk_library/public/mycoreplatform.txt
|
||||
.intermediates/mycoreplatform.stubs.source/android_common/exportable/mycoreplatform.stubs.source_removed.txt -> sdk_library/public/mycoreplatform-removed.txt
|
||||
`
|
||||
t.Run("added-via-apex", func(t *testing.T) {
|
||||
testSnapshotWithBootClasspathFragment_Contents(t, `
|
||||
|
@ -760,6 +766,12 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) {
|
|||
// Add a platform_bootclasspath that depends on the fragment.
|
||||
fixtureAddPlatformBootclasspathForBootclasspathFragment("myapex", "mybootclasspathfragment"),
|
||||
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
|
||||
android.MockFS{
|
||||
"my-blocked.txt": nil,
|
||||
"my-max-target-o-low-priority.txt": nil,
|
||||
|
@ -963,12 +975,12 @@ my-unsupported-packages.txt -> hiddenapi/my-unsupported-packages.txt
|
|||
.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/filtered-stub-flags.csv -> hiddenapi/filtered-stub-flags.csv
|
||||
.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/filtered-flags.csv -> hiddenapi/filtered-flags.csv
|
||||
.intermediates/mysdk/common_os/empty -> java_boot_libs/snapshot/jars/are/invalid/mybootlib.jar
|
||||
.intermediates/mynewlibrary.stubs/android_common/combined/mynewlibrary.stubs.jar -> sdk_library/public/mynewlibrary-stubs.jar
|
||||
.intermediates/mynewlibrary.stubs.source/android_common/everything/mynewlibrary.stubs.source_api.txt -> sdk_library/public/mynewlibrary.txt
|
||||
.intermediates/mynewlibrary.stubs.source/android_common/everything/mynewlibrary.stubs.source_removed.txt -> sdk_library/public/mynewlibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs/android_common/combined/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mynewlibrary.stubs.exportable/android_common/combined/mynewlibrary.stubs.exportable.jar -> sdk_library/public/mynewlibrary-stubs.jar
|
||||
.intermediates/mynewlibrary.stubs.source/android_common/exportable/mynewlibrary.stubs.source_api.txt -> sdk_library/public/mynewlibrary.txt
|
||||
.intermediates/mynewlibrary.stubs.source/android_common/exportable/mynewlibrary.stubs.source_removed.txt -> sdk_library/public/mynewlibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs.exportable/android_common/combined/mysdklibrary.stubs.exportable.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
`),
|
||||
snapshotTestPreparer(checkSnapshotWithoutSource, preparerForSnapshot),
|
||||
snapshotTestPreparer(checkSnapshotWithSourcePreferred, preparerForSnapshot),
|
||||
|
@ -997,6 +1009,12 @@ func testSnapshotWithBootClasspathFragment_MinSdkVersion(t *testing.T, targetBui
|
|||
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": targetBuildRelease,
|
||||
}),
|
||||
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
|
||||
android.FixtureWithRootAndroidBp(`
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
|
@ -1095,15 +1113,15 @@ java_sdk_library_import {
|
|||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi-for-sdk-snapshot/index.csv -> hiddenapi/index.csv
|
||||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi-for-sdk-snapshot/stub-flags.csv -> hiddenapi/stub-flags.csv
|
||||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi-for-sdk-snapshot/all-flags.csv -> hiddenapi/all-flags.csv
|
||||
.intermediates/mysdklibrary.stubs/android_common/combined/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs.exportable/android_common/combined/mysdklibrary.stubs.exportable.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
`
|
||||
|
||||
// On S the stub flags should only be generated from mysdklibrary as mynewsdklibrary is not part
|
||||
// of the snapshot.
|
||||
expectedStubFlagsInputs := []string{
|
||||
"out/soong/.intermediates/mysdklibrary.stubs/android_common/dex/mysdklibrary.stubs.jar",
|
||||
"out/soong/.intermediates/mysdklibrary.stubs.exportable/android_common/dex/mysdklibrary.stubs.exportable.jar",
|
||||
"out/soong/.intermediates/mysdklibrary/android_common/aligned/mysdklibrary.jar",
|
||||
}
|
||||
|
||||
|
@ -1173,20 +1191,20 @@ java_sdk_library_import {
|
|||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi/signature-patterns.csv -> hiddenapi/signature-patterns.csv
|
||||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi/filtered-stub-flags.csv -> hiddenapi/filtered-stub-flags.csv
|
||||
.intermediates/mybootclasspathfragment/android_common_myapex/modular-hiddenapi/filtered-flags.csv -> hiddenapi/filtered-flags.csv
|
||||
.intermediates/mysdklibrary.stubs/android_common/combined/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mynewsdklibrary.stubs/android_common/combined/mynewsdklibrary.stubs.jar -> sdk_library/public/mynewsdklibrary-stubs.jar
|
||||
.intermediates/mynewsdklibrary.stubs.source/android_common/everything/mynewsdklibrary.stubs.source_api.txt -> sdk_library/public/mynewsdklibrary.txt
|
||||
.intermediates/mynewsdklibrary.stubs.source/android_common/everything/mynewsdklibrary.stubs.source_removed.txt -> sdk_library/public/mynewsdklibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs.exportable/android_common/combined/mysdklibrary.stubs.exportable.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mynewsdklibrary.stubs.exportable/android_common/combined/mynewsdklibrary.stubs.exportable.jar -> sdk_library/public/mynewsdklibrary-stubs.jar
|
||||
.intermediates/mynewsdklibrary.stubs.source/android_common/exportable/mynewsdklibrary.stubs.source_api.txt -> sdk_library/public/mynewsdklibrary.txt
|
||||
.intermediates/mynewsdklibrary.stubs.source/android_common/exportable/mynewsdklibrary.stubs.source_removed.txt -> sdk_library/public/mynewsdklibrary-removed.txt
|
||||
`
|
||||
|
||||
// On tiramisu the stub flags should be generated from both mynewsdklibrary and mysdklibrary as
|
||||
// they are both part of the snapshot.
|
||||
expectedStubFlagsInputs := []string{
|
||||
"out/soong/.intermediates/mynewsdklibrary.stubs/android_common/dex/mynewsdklibrary.stubs.jar",
|
||||
"out/soong/.intermediates/mynewsdklibrary.stubs.exportable/android_common/dex/mynewsdklibrary.stubs.exportable.jar",
|
||||
"out/soong/.intermediates/mynewsdklibrary/android_common/aligned/mynewsdklibrary.jar",
|
||||
"out/soong/.intermediates/mysdklibrary.stubs/android_common/dex/mysdklibrary.stubs.jar",
|
||||
"out/soong/.intermediates/mysdklibrary.stubs.exportable/android_common/dex/mysdklibrary.stubs.exportable.jar",
|
||||
"out/soong/.intermediates/mysdklibrary/android_common/aligned/mysdklibrary.jar",
|
||||
}
|
||||
|
||||
|
|
|
@ -45,6 +45,11 @@ var prepareForSdkTestWithJavaSdkLibrary = android.GroupFixturePreparers(
|
|||
java.PrepareForTestWithJavaDefaultModules,
|
||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||
java.FixtureWithLastReleaseApis("myjavalib"),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
)
|
||||
|
||||
// Contains tests for SDK members provided by the java package.
|
||||
|
@ -608,6 +613,11 @@ func TestSnapshotWithJavaSystemModules(t *testing.T) {
|
|||
"1": {"myjavalib"},
|
||||
"2": {"myjavalib"},
|
||||
}),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
|
@ -696,9 +706,9 @@ java_system_modules_import {
|
|||
checkAllCopyRules(`
|
||||
.intermediates/exported-system-module/android_common/turbine-combined/exported-system-module.jar -> java/exported-system-module.jar
|
||||
.intermediates/system-module/android_common/turbine-combined/system-module.jar -> java/system-module.jar
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
`),
|
||||
checkInfoContents(result.Config, `
|
||||
[
|
||||
|
@ -941,15 +951,15 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.system/android_common/combined/myjavalib.stubs.system.jar -> sdk_library/system/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/everything/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/everything/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.test/android_common/combined/myjavalib.stubs.test.jar -> sdk_library/test/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.test/android_common/everything/myjavalib.stubs.source.test_api.txt -> sdk_library/test/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.test/android_common/everything/myjavalib.stubs.source.test_removed.txt -> sdk_library/test/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable.system/android_common/combined/myjavalib.stubs.exportable.system.jar -> sdk_library/system/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable.test/android_common/combined/myjavalib.stubs.exportable.test.jar -> sdk_library/test/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.test/android_common/exportable/myjavalib.stubs.source.test_api.txt -> sdk_library/test/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.test/android_common/exportable/myjavalib.stubs.source.test_removed.txt -> sdk_library/test/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||
|
@ -999,9 +1009,9 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib-foo.stubs/android_common/combined/myjavalib-foo.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib-foo.stubs.source/android_common/everything/myjavalib-foo.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib-foo.stubs.source/android_common/everything/myjavalib-foo.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib-foo.stubs.exportable/android_common/combined/myjavalib-foo.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib-foo.stubs.source/android_common/exportable/myjavalib-foo.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib-foo.stubs.source/android_common/exportable/myjavalib-foo.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||
|
@ -1052,10 +1062,10 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source-stubs.srcjar -> sdk_library/public/myjavalib.srcjar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source-stubs.srcjar -> sdk_library/public/myjavalib.srcjar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
`),
|
||||
)
|
||||
}
|
||||
|
@ -1100,10 +1110,10 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_annotations.zip -> sdk_library/public/myjavalib_annotations.zip
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_annotations.zip -> sdk_library/public/myjavalib_annotations.zip
|
||||
`),
|
||||
checkMergeZips(".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip"),
|
||||
)
|
||||
|
@ -1153,16 +1163,23 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip"),
|
||||
)
|
||||
}
|
||||
|
||||
func TestSnapshotWithJavaSdkLibrary_CompileDex(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(prepareForSdkTestWithJavaSdkLibrary).RunTestWithBp(t, `
|
||||
result := android.GroupFixturePreparers(
|
||||
prepareForSdkTestWithJavaSdkLibrary,
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTestWithBp(t, `
|
||||
sdk {
|
||||
name: "mysdk",
|
||||
java_sdk_libs: ["myjavalib"],
|
||||
|
@ -1214,21 +1231,22 @@ java_sdk_library_import {
|
|||
ctx := android.ModuleInstallPathContextForTesting(result.Config)
|
||||
dexJarBuildPath := func(name string, kind android.SdkKind) string {
|
||||
dep := result.Module(name, "android_common").(java.SdkLibraryDependency)
|
||||
path := dep.SdkApiStubDexJar(ctx, kind).Path()
|
||||
path := dep.SdkApiExportableStubDexJar(ctx, kind).Path()
|
||||
return path.RelativeToTop().String()
|
||||
}
|
||||
|
||||
dexJarPath := dexJarBuildPath("myjavalib", android.SdkPublic)
|
||||
android.AssertStringEquals(t, "source dex public stubs jar build path", "out/soong/.intermediates/myjavalib.stubs/android_common/dex/myjavalib.stubs.jar", dexJarPath)
|
||||
android.AssertStringEquals(t, "source dex public stubs jar build path", "out/soong/.intermediates/myjavalib.stubs.exportable/android_common/dex/myjavalib.stubs.exportable.jar", dexJarPath)
|
||||
|
||||
dexJarPath = dexJarBuildPath("myjavalib", android.SdkSystem)
|
||||
systemDexJar := "out/soong/.intermediates/myjavalib.stubs.system/android_common/dex/myjavalib.stubs.system.jar"
|
||||
systemDexJar := "out/soong/.intermediates/myjavalib.stubs.exportable.system/android_common/dex/myjavalib.stubs.exportable.system.jar"
|
||||
android.AssertStringEquals(t, "source dex system stubs jar build path", systemDexJar, dexJarPath)
|
||||
|
||||
// This should fall back to system as module is not available.
|
||||
dexJarPath = dexJarBuildPath("myjavalib", android.SdkModule)
|
||||
android.AssertStringEquals(t, "source dex module stubs jar build path", systemDexJar, dexJarPath)
|
||||
|
||||
// Prebuilt dex jar does not come from the exportable stubs.
|
||||
dexJarPath = dexJarBuildPath(android.PrebuiltNameFromSource("myjavalib"), android.SdkPublic)
|
||||
android.AssertStringEquals(t, "prebuilt dex public stubs jar build path", "out/soong/.intermediates/snapshot/prebuilt_myjavalib.stubs/android_common/dex/myjavalib.stubs.jar", dexJarPath)
|
||||
}),
|
||||
|
@ -1270,9 +1288,9 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||
|
@ -1318,9 +1336,9 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||
|
@ -1376,12 +1394,12 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.system/android_common/combined/myjavalib.stubs.system.jar -> sdk_library/system/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/everything/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/everything/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable.system/android_common/combined/myjavalib.stubs.exportable.system.jar -> sdk_library/system/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||
|
@ -1448,15 +1466,15 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.system/android_common/combined/myjavalib.stubs.system.jar -> sdk_library/system/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/everything/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/everything/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.module_lib/android_common/combined/myjavalib.stubs.module_lib.jar -> sdk_library/module-lib/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.module_lib/android_common/everything/myjavalib.stubs.source.module_lib_api.txt -> sdk_library/module-lib/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.module_lib/android_common/everything/myjavalib.stubs.source.module_lib_removed.txt -> sdk_library/module-lib/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable.system/android_common/combined/myjavalib.stubs.exportable.system.jar -> sdk_library/system/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_api.txt -> sdk_library/system/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system/android_common/exportable/myjavalib.stubs.source.system_removed.txt -> sdk_library/system/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable.module_lib/android_common/combined/myjavalib.stubs.exportable.module_lib.jar -> sdk_library/module-lib/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.module_lib/android_common/exportable/myjavalib.stubs.source.module_lib_api.txt -> sdk_library/module-lib/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.module_lib/android_common/exportable/myjavalib.stubs.source.module_lib_removed.txt -> sdk_library/module-lib/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/module-lib/myjavalib_stub_sources.zip",
|
||||
|
@ -1514,12 +1532,12 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.system_server/android_common/combined/myjavalib.stubs.system_server.jar -> sdk_library/system-server/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system_server/android_common/everything/myjavalib.stubs.source.system_server_api.txt -> sdk_library/system-server/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system_server/android_common/everything/myjavalib.stubs.source.system_server_removed.txt -> sdk_library/system-server/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable.system_server/android_common/combined/myjavalib.stubs.exportable.system_server.jar -> sdk_library/system-server/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source.system_server/android_common/exportable/myjavalib.stubs.source.system_server_api.txt -> sdk_library/system-server/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source.system_server/android_common/exportable/myjavalib.stubs.source.system_server_removed.txt -> sdk_library/system-server/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||
|
@ -1568,9 +1586,9 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
`),
|
||||
checkMergeZips(
|
||||
".intermediates/mysdk/common_os/tmp/sdk_library/public/myjavalib_stub_sources.zip",
|
||||
|
@ -1625,9 +1643,9 @@ java_sdk_library_import {
|
|||
}
|
||||
`),
|
||||
checkAllCopyRules(`
|
||||
.intermediates/myjavalib.stubs/android_common/combined/myjavalib.stubs.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/everything/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
.intermediates/myjavalib.stubs.exportable/android_common/combined/myjavalib.stubs.exportable.jar -> sdk_library/public/myjavalib-stubs.jar
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_api.txt -> sdk_library/public/myjavalib.txt
|
||||
.intermediates/myjavalib.stubs.source/android_common/exportable/myjavalib.stubs.source_removed.txt -> sdk_library/public/myjavalib-removed.txt
|
||||
docs/known_doctags -> doctags/docs/known_doctags
|
||||
`),
|
||||
)
|
||||
|
|
|
@ -442,6 +442,11 @@ java_import {
|
|||
android.FixtureMergeEnv(map[string]string{
|
||||
"SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S",
|
||||
}),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildFlags = map[string]string{
|
||||
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS": "true",
|
||||
}
|
||||
}),
|
||||
).RunTest(t)
|
||||
|
||||
CheckSnapshot(t, result, "mysdk", "",
|
||||
|
@ -487,9 +492,9 @@ java_sdk_library_import {
|
|||
.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/index.csv -> hiddenapi/index.csv
|
||||
.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/stub-flags.csv -> hiddenapi/stub-flags.csv
|
||||
.intermediates/mybootclasspathfragment/android_common/modular-hiddenapi/all-flags.csv -> hiddenapi/all-flags.csv
|
||||
.intermediates/mysdklibrary.stubs/android_common/combined/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/everything/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
.intermediates/mysdklibrary.stubs.exportable/android_common/combined/mysdklibrary.stubs.exportable.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||
.intermediates/mysdklibrary.stubs.source/android_common/exportable/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||
`),
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue