Add java_sdk_library in bootclasspath_fragment contents to sdk am: a10bd3c127
am: 94a452c768
am: 58fcebb1a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705470 Change-Id: I673fd870c37f11966c4914c033ab8f96b8ece825
This commit is contained in:
commit
f3042faefe
|
@ -61,8 +61,14 @@ func (b bootclasspathFragmentContentDependencyTag) ReplaceSourceWithPrebuilt() b
|
||||||
}
|
}
|
||||||
|
|
||||||
// SdkMemberType causes dependencies added with this tag to be automatically added to the sdk as if
|
// SdkMemberType causes dependencies added with this tag to be automatically added to the sdk as if
|
||||||
// they were specified using java_boot_libs.
|
// they were specified using java_boot_libs or java_sdk_libs.
|
||||||
func (b bootclasspathFragmentContentDependencyTag) SdkMemberType(_ android.Module) android.SdkMemberType {
|
func (b bootclasspathFragmentContentDependencyTag) SdkMemberType(child android.Module) android.SdkMemberType {
|
||||||
|
// If the module is a java_sdk_library then treat it as if it was specified in the java_sdk_libs
|
||||||
|
// property, otherwise treat if it was specified in the java_boot_libs property.
|
||||||
|
if javaSdkLibrarySdkMemberType.IsInstance(child) {
|
||||||
|
return javaSdkLibrarySdkMemberType
|
||||||
|
}
|
||||||
|
|
||||||
return javaBootLibsSdkMemberType
|
return javaBootLibsSdkMemberType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,21 +165,33 @@ func TestSnapshotWithBootClasspathFragment_Contents(t *testing.T) {
|
||||||
prepareForSdkTestWithJava,
|
prepareForSdkTestWithJava,
|
||||||
java.PrepareForTestWithJavaDefaultModules,
|
java.PrepareForTestWithJavaDefaultModules,
|
||||||
java.PrepareForTestWithJavaSdkLibraryFiles,
|
java.PrepareForTestWithJavaSdkLibraryFiles,
|
||||||
java.FixtureWithLastReleaseApis("mysdklibrary", "mycoreplatform"),
|
java.FixtureWithLastReleaseApis("mysdklibrary", "myothersdklibrary", "mycoreplatform"),
|
||||||
android.FixtureWithRootAndroidBp(`
|
android.FixtureWithRootAndroidBp(`
|
||||||
sdk {
|
sdk {
|
||||||
name: "mysdk",
|
name: "mysdk",
|
||||||
bootclasspath_fragments: ["mybootclasspathfragment"],
|
bootclasspath_fragments: ["mybootclasspathfragment"],
|
||||||
java_sdk_libs: ["mysdklibrary", "mycoreplatform"],
|
java_sdk_libs: [
|
||||||
|
// This is not strictly needed as it should be automatically added to the sdk_snapshot as
|
||||||
|
// a java_sdk_libs module because it is used in the mybootclasspathfragment's
|
||||||
|
// api.stub_libs property. However, it is specified here to ensure that duplicates are
|
||||||
|
// correctly deduped.
|
||||||
|
"mysdklibrary",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
bootclasspath_fragment {
|
bootclasspath_fragment {
|
||||||
name: "mybootclasspathfragment",
|
name: "mybootclasspathfragment",
|
||||||
contents: ["mybootlib"],
|
contents: [
|
||||||
|
// This should be automatically added to the sdk_snapshot as a java_boot_libs module.
|
||||||
|
"mybootlib",
|
||||||
|
// This should be automatically added to the sdk_snapshot as a java_sdk_libs module.
|
||||||
|
"myothersdklibrary",
|
||||||
|
],
|
||||||
api: {
|
api: {
|
||||||
stub_libs: ["mysdklibrary"],
|
stub_libs: ["mysdklibrary"],
|
||||||
},
|
},
|
||||||
core_platform_api: {
|
core_platform_api: {
|
||||||
|
// This should be automatically added to the sdk_snapshot as a java_sdk_libs module.
|
||||||
stub_libs: ["mycoreplatform"],
|
stub_libs: ["mycoreplatform"],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -199,6 +211,13 @@ func TestSnapshotWithBootClasspathFragment_Contents(t *testing.T) {
|
||||||
public: {enabled: true},
|
public: {enabled: true},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java_sdk_library {
|
||||||
|
name: "myothersdklibrary",
|
||||||
|
srcs: ["Test.java"],
|
||||||
|
compile_dex: true,
|
||||||
|
public: {enabled: true},
|
||||||
|
}
|
||||||
|
|
||||||
java_sdk_library {
|
java_sdk_library {
|
||||||
name: "mycoreplatform",
|
name: "mycoreplatform",
|
||||||
srcs: ["Test.java"],
|
srcs: ["Test.java"],
|
||||||
|
@ -217,7 +236,10 @@ prebuilt_bootclasspath_fragment {
|
||||||
prefer: false,
|
prefer: false,
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
apex_available: ["//apex_available:platform"],
|
apex_available: ["//apex_available:platform"],
|
||||||
contents: ["mybootlib"],
|
contents: [
|
||||||
|
"mybootlib",
|
||||||
|
"myothersdklibrary",
|
||||||
|
],
|
||||||
api: {
|
api: {
|
||||||
stub_libs: ["mysdklibrary"],
|
stub_libs: ["mysdklibrary"],
|
||||||
},
|
},
|
||||||
|
@ -234,6 +256,22 @@ java_import {
|
||||||
jars: ["java/mybootlib.jar"],
|
jars: ["java/mybootlib.jar"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java_sdk_library_import {
|
||||||
|
name: "myothersdklibrary",
|
||||||
|
prefer: false,
|
||||||
|
visibility: ["//visibility:public"],
|
||||||
|
apex_available: ["//apex_available:platform"],
|
||||||
|
shared_library: true,
|
||||||
|
compile_dex: true,
|
||||||
|
public: {
|
||||||
|
jars: ["sdk_library/public/myothersdklibrary-stubs.jar"],
|
||||||
|
stub_srcs: ["sdk_library/public/myothersdklibrary_stub_sources"],
|
||||||
|
current_api: "sdk_library/public/myothersdklibrary.txt",
|
||||||
|
removed_api: "sdk_library/public/myothersdklibrary-removed.txt",
|
||||||
|
sdk_version: "current",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
java_sdk_library_import {
|
java_sdk_library_import {
|
||||||
name: "mysdklibrary",
|
name: "mysdklibrary",
|
||||||
prefer: false,
|
prefer: false,
|
||||||
|
@ -265,7 +303,7 @@ java_sdk_library_import {
|
||||||
sdk_version: "current",
|
sdk_version: "current",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
`),
|
`),
|
||||||
checkVersionedAndroidBpContents(`
|
checkVersionedAndroidBpContents(`
|
||||||
// This is auto-generated. DO NOT EDIT.
|
// This is auto-generated. DO NOT EDIT.
|
||||||
|
|
||||||
|
@ -274,7 +312,10 @@ prebuilt_bootclasspath_fragment {
|
||||||
sdk_member_name: "mybootclasspathfragment",
|
sdk_member_name: "mybootclasspathfragment",
|
||||||
visibility: ["//visibility:public"],
|
visibility: ["//visibility:public"],
|
||||||
apex_available: ["//apex_available:platform"],
|
apex_available: ["//apex_available:platform"],
|
||||||
contents: ["mysdk_mybootlib@current"],
|
contents: [
|
||||||
|
"mysdk_mybootlib@current",
|
||||||
|
"mysdk_myothersdklibrary@current",
|
||||||
|
],
|
||||||
api: {
|
api: {
|
||||||
stub_libs: ["mysdk_mysdklibrary@current"],
|
stub_libs: ["mysdk_mysdklibrary@current"],
|
||||||
},
|
},
|
||||||
|
@ -291,6 +332,22 @@ java_import {
|
||||||
jars: ["java/mybootlib.jar"],
|
jars: ["java/mybootlib.jar"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java_sdk_library_import {
|
||||||
|
name: "mysdk_myothersdklibrary@current",
|
||||||
|
sdk_member_name: "myothersdklibrary",
|
||||||
|
visibility: ["//visibility:public"],
|
||||||
|
apex_available: ["//apex_available:platform"],
|
||||||
|
shared_library: true,
|
||||||
|
compile_dex: true,
|
||||||
|
public: {
|
||||||
|
jars: ["sdk_library/public/myothersdklibrary-stubs.jar"],
|
||||||
|
stub_srcs: ["sdk_library/public/myothersdklibrary_stub_sources"],
|
||||||
|
current_api: "sdk_library/public/myothersdklibrary.txt",
|
||||||
|
removed_api: "sdk_library/public/myothersdklibrary-removed.txt",
|
||||||
|
sdk_version: "current",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
java_sdk_library_import {
|
java_sdk_library_import {
|
||||||
name: "mysdk_mysdklibrary@current",
|
name: "mysdk_mysdklibrary@current",
|
||||||
sdk_member_name: "mysdklibrary",
|
sdk_member_name: "mysdklibrary",
|
||||||
|
@ -329,13 +386,17 @@ sdk_snapshot {
|
||||||
bootclasspath_fragments: ["mysdk_mybootclasspathfragment@current"],
|
bootclasspath_fragments: ["mysdk_mybootclasspathfragment@current"],
|
||||||
java_boot_libs: ["mysdk_mybootlib@current"],
|
java_boot_libs: ["mysdk_mybootlib@current"],
|
||||||
java_sdk_libs: [
|
java_sdk_libs: [
|
||||||
|
"mysdk_myothersdklibrary@current",
|
||||||
"mysdk_mysdklibrary@current",
|
"mysdk_mysdklibrary@current",
|
||||||
"mysdk_mycoreplatform@current",
|
"mysdk_mycoreplatform@current",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
`),
|
`),
|
||||||
checkAllCopyRules(`
|
checkAllCopyRules(`
|
||||||
.intermediates/mybootlib/android_common/javac/mybootlib.jar -> java/mybootlib.jar
|
.intermediates/mybootlib/android_common/javac/mybootlib.jar -> java/mybootlib.jar
|
||||||
|
.intermediates/myothersdklibrary.stubs/android_common/javac/myothersdklibrary.stubs.jar -> sdk_library/public/myothersdklibrary-stubs.jar
|
||||||
|
.intermediates/myothersdklibrary.stubs.source/android_common/metalava/myothersdklibrary.stubs.source_api.txt -> sdk_library/public/myothersdklibrary.txt
|
||||||
|
.intermediates/myothersdklibrary.stubs.source/android_common/metalava/myothersdklibrary.stubs.source_removed.txt -> sdk_library/public/myothersdklibrary-removed.txt
|
||||||
.intermediates/mysdklibrary.stubs/android_common/javac/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
.intermediates/mysdklibrary.stubs/android_common/javac/mysdklibrary.stubs.jar -> sdk_library/public/mysdklibrary-stubs.jar
|
||||||
.intermediates/mysdklibrary.stubs.source/android_common/metalava/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
.intermediates/mysdklibrary.stubs.source/android_common/metalava/mysdklibrary.stubs.source_api.txt -> sdk_library/public/mysdklibrary.txt
|
||||||
.intermediates/mysdklibrary.stubs.source/android_common/metalava/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
.intermediates/mysdklibrary.stubs.source/android_common/metalava/mysdklibrary.stubs.source_removed.txt -> sdk_library/public/mysdklibrary-removed.txt
|
||||||
|
|
Loading…
Reference in New Issue