Remove compilation actions from java sdk library
This change modifies the build actions of java_sdk_library module type so that it does not perform any compilation actions (i.e. does not create the top level java_sdk_library jar file). Instead, it delegates the build actions the top level jar file was performing to the dynamically created ".impl"-suffixed java library module. The build actions that are delegated to the impl library module include hiddenapi processing, dexing, and dexpreopt. Test: m nothing --no-skip-soong-tests Bug: 332785297 Change-Id: I7534f9eaacf6d9f72fbf8d540b1e26af84106c20
This commit is contained in:
@@ -303,7 +303,7 @@ func TestHiddenAPIEncoding_JavaSdkLibrary(t *testing.T) {
|
||||
`)
|
||||
|
||||
checkDexEncoded := func(t *testing.T, name, unencodedDexJar, encodedDexJar string) {
|
||||
moduleForTests := result.ModuleForTests(name, "android_common")
|
||||
moduleForTests := result.ModuleForTests(name+".impl", "android_common")
|
||||
|
||||
encodeDexRule := moduleForTests.Rule("hiddenAPIEncodeDex")
|
||||
actualUnencodedDexJar := encodeDexRule.Input
|
||||
@@ -319,18 +319,8 @@ func TestHiddenAPIEncoding_JavaSdkLibrary(t *testing.T) {
|
||||
|
||||
// The java_library embedded with the java_sdk_library must be dex encoded.
|
||||
t.Run("foo", func(t *testing.T) {
|
||||
expectedUnencodedDexJar := "out/soong/.intermediates/foo/android_common/aligned/foo.jar"
|
||||
expectedEncodedDexJar := "out/soong/.intermediates/foo/android_common/hiddenapi/foo.jar"
|
||||
expectedUnencodedDexJar := "out/soong/.intermediates/foo.impl/android_common/aligned/foo.jar"
|
||||
expectedEncodedDexJar := "out/soong/.intermediates/foo.impl/android_common/hiddenapi/foo.jar"
|
||||
checkDexEncoded(t, "foo", expectedUnencodedDexJar, expectedEncodedDexJar)
|
||||
})
|
||||
|
||||
// The dex jar of the child implementation java_library of the java_sdk_library is not currently
|
||||
// dex encoded.
|
||||
t.Run("foo.impl", func(t *testing.T) {
|
||||
fooImpl := result.ModuleForTests("foo.impl", "android_common")
|
||||
encodeDexRule := fooImpl.MaybeRule("hiddenAPIEncodeDex")
|
||||
if encodeDexRule.Rule != nil {
|
||||
t.Errorf("foo.impl is not expected to be encoded")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user