2020-08-06 00:40:41 +02:00
|
|
|
// Copyright 2020 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package java
|
|
|
|
|
|
|
|
import (
|
2020-07-03 16:31:32 +02:00
|
|
|
"fmt"
|
2021-03-12 22:44:02 +01:00
|
|
|
"path/filepath"
|
2020-08-06 00:40:41 +02:00
|
|
|
"testing"
|
2020-07-03 16:31:32 +02:00
|
|
|
|
2021-02-04 18:49:33 +01:00
|
|
|
"android/soong/android"
|
2020-07-03 16:31:32 +02:00
|
|
|
"github.com/google/blueprint/proptools"
|
2020-08-06 00:40:41 +02:00
|
|
|
)
|
|
|
|
|
2021-04-21 15:10:42 +02:00
|
|
|
// TODO(b/177892522): Move these tests into a more appropriate place.
|
|
|
|
|
2021-03-12 22:44:02 +01:00
|
|
|
func fixtureSetPrebuiltHiddenApiDirProductVariable(prebuiltHiddenApiDir *string) android.FixturePreparer {
|
|
|
|
return android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
|
|
|
variables.PrebuiltHiddenApiDir = prebuiltHiddenApiDir
|
|
|
|
})
|
2020-07-03 16:31:32 +02:00
|
|
|
}
|
|
|
|
|
2021-04-21 15:10:42 +02:00
|
|
|
var prepareForTestWithDefaultPlatformBootclasspath = android.FixtureAddTextFile("frameworks/base/boot/Android.bp", `
|
|
|
|
platform_bootclasspath {
|
|
|
|
name: "platform-bootclasspath",
|
|
|
|
}
|
|
|
|
`)
|
|
|
|
|
2021-03-22 16:36:52 +01:00
|
|
|
var hiddenApiFixtureFactory = android.GroupFixturePreparers(
|
|
|
|
prepareForJavaTest, PrepareForTestWithHiddenApiBuildComponents)
|
2020-08-06 00:40:41 +02:00
|
|
|
|
|
|
|
func TestHiddenAPISingleton(t *testing.T) {
|
2021-03-29 03:16:14 +02:00
|
|
|
result := android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
2021-04-12 21:02:36 +02:00
|
|
|
FixtureConfigureBootJars("platform:foo"),
|
2021-04-21 15:10:42 +02:00
|
|
|
prepareForTestWithDefaultPlatformBootclasspath,
|
2021-03-12 22:44:02 +01:00
|
|
|
).RunTestWithBp(t, `
|
2020-08-06 00:40:41 +02:00
|
|
|
java_library {
|
|
|
|
name: "foo",
|
|
|
|
srcs: ["a.java"],
|
|
|
|
compile_dex: true,
|
2021-02-04 18:49:33 +01:00
|
|
|
}
|
2021-03-12 22:44:02 +01:00
|
|
|
`)
|
2020-08-06 00:40:41 +02:00
|
|
|
|
2021-04-21 15:10:42 +02:00
|
|
|
hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
|
|
|
|
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
|
2021-03-22 17:24:49 +01:00
|
|
|
want := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, want)
|
2020-08-06 00:40:41 +02:00
|
|
|
}
|
|
|
|
|
2021-02-25 16:34:13 +01:00
|
|
|
func TestHiddenAPISingletonWithSourceAndPrebuiltPreferredButNoDex(t *testing.T) {
|
2021-05-14 08:52:42 +02:00
|
|
|
expectedErrorMessage := "module prebuilt_foo{os:android,arch:common} does not provide a dex jar"
|
2021-03-12 22:44:02 +01:00
|
|
|
|
2021-03-29 03:16:14 +02:00
|
|
|
android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
2021-04-12 21:02:36 +02:00
|
|
|
FixtureConfigureBootJars("platform:foo"),
|
2021-04-21 15:10:42 +02:00
|
|
|
prepareForTestWithDefaultPlatformBootclasspath,
|
2021-03-12 22:44:02 +01:00
|
|
|
).ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(expectedErrorMessage)).
|
|
|
|
RunTestWithBp(t, `
|
2021-02-25 16:34:13 +01:00
|
|
|
java_library {
|
|
|
|
name: "foo",
|
|
|
|
srcs: ["a.java"],
|
|
|
|
compile_dex: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
java_import {
|
|
|
|
name: "foo",
|
|
|
|
jars: ["a.jar"],
|
|
|
|
prefer: true,
|
|
|
|
}
|
2021-03-12 22:44:02 +01:00
|
|
|
`)
|
2021-02-25 16:34:13 +01:00
|
|
|
}
|
|
|
|
|
2020-08-06 00:40:41 +02:00
|
|
|
func TestHiddenAPISingletonWithPrebuilt(t *testing.T) {
|
2021-03-29 03:16:14 +02:00
|
|
|
result := android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
2021-04-12 21:02:36 +02:00
|
|
|
FixtureConfigureBootJars("platform:foo"),
|
2021-04-21 15:10:42 +02:00
|
|
|
prepareForTestWithDefaultPlatformBootclasspath,
|
2021-03-12 22:44:02 +01:00
|
|
|
).RunTestWithBp(t, `
|
2020-08-06 00:40:41 +02:00
|
|
|
java_import {
|
|
|
|
name: "foo",
|
|
|
|
jars: ["a.jar"],
|
|
|
|
compile_dex: true,
|
|
|
|
}
|
2021-03-12 22:44:02 +01:00
|
|
|
`)
|
2020-08-06 00:40:41 +02:00
|
|
|
|
2021-04-21 15:10:42 +02:00
|
|
|
hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
|
|
|
|
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
|
2021-03-22 17:24:49 +01:00
|
|
|
want := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, want)
|
2020-08-06 00:40:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestHiddenAPISingletonWithPrebuiltUseSource(t *testing.T) {
|
2021-03-29 03:16:14 +02:00
|
|
|
result := android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
2021-04-12 21:02:36 +02:00
|
|
|
FixtureConfigureBootJars("platform:foo"),
|
2021-04-21 15:10:42 +02:00
|
|
|
prepareForTestWithDefaultPlatformBootclasspath,
|
2021-03-12 22:44:02 +01:00
|
|
|
).RunTestWithBp(t, `
|
2020-08-06 00:40:41 +02:00
|
|
|
java_library {
|
|
|
|
name: "foo",
|
|
|
|
srcs: ["a.java"],
|
|
|
|
compile_dex: true,
|
2021-02-04 18:49:33 +01:00
|
|
|
}
|
2020-08-06 00:40:41 +02:00
|
|
|
|
|
|
|
java_import {
|
|
|
|
name: "foo",
|
|
|
|
jars: ["a.jar"],
|
|
|
|
compile_dex: true,
|
|
|
|
prefer: false,
|
2021-02-04 18:49:33 +01:00
|
|
|
}
|
2021-03-12 22:44:02 +01:00
|
|
|
`)
|
2020-08-06 00:40:41 +02:00
|
|
|
|
2021-04-21 15:10:42 +02:00
|
|
|
hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
|
|
|
|
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
|
2021-03-22 17:24:49 +01:00
|
|
|
fromSourceJarArg := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, fromSourceJarArg)
|
2020-08-06 00:40:41 +02:00
|
|
|
|
2021-03-22 17:24:49 +01:00
|
|
|
prebuiltJarArg := "--boot-dex=out/soong/.intermediates/foo/android_common/dex/foo.jar"
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesNotContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, prebuiltJarArg)
|
2020-08-06 00:40:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestHiddenAPISingletonWithPrebuiltOverrideSource(t *testing.T) {
|
2021-03-29 03:16:14 +02:00
|
|
|
result := android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
2021-04-12 21:02:36 +02:00
|
|
|
FixtureConfigureBootJars("platform:foo"),
|
2021-04-21 15:10:42 +02:00
|
|
|
prepareForTestWithDefaultPlatformBootclasspath,
|
2021-03-12 22:44:02 +01:00
|
|
|
).RunTestWithBp(t, `
|
2020-08-06 00:40:41 +02:00
|
|
|
java_library {
|
|
|
|
name: "foo",
|
|
|
|
srcs: ["a.java"],
|
|
|
|
compile_dex: true,
|
2021-02-04 18:49:33 +01:00
|
|
|
}
|
2020-08-06 00:40:41 +02:00
|
|
|
|
|
|
|
java_import {
|
|
|
|
name: "foo",
|
|
|
|
jars: ["a.jar"],
|
|
|
|
compile_dex: true,
|
|
|
|
prefer: true,
|
2021-02-04 18:49:33 +01:00
|
|
|
}
|
2021-03-12 22:44:02 +01:00
|
|
|
`)
|
2020-08-06 00:40:41 +02:00
|
|
|
|
2021-04-21 15:10:42 +02:00
|
|
|
hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
|
|
|
|
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
|
2021-03-22 17:24:49 +01:00
|
|
|
prebuiltJarArg := "--boot-dex=out/soong/.intermediates/prebuilt_foo/android_common/dex/foo.jar"
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, prebuiltJarArg)
|
2020-08-06 00:40:41 +02:00
|
|
|
|
2021-03-22 17:24:49 +01:00
|
|
|
fromSourceJarArg := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesNotContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, fromSourceJarArg)
|
2020-08-06 00:40:41 +02:00
|
|
|
}
|
2020-07-03 16:31:32 +02:00
|
|
|
|
|
|
|
func TestHiddenAPISingletonSdks(t *testing.T) {
|
|
|
|
testCases := []struct {
|
|
|
|
name string
|
|
|
|
unbundledBuild bool
|
|
|
|
publicStub string
|
|
|
|
systemStub string
|
|
|
|
testStub string
|
|
|
|
corePlatformStub string
|
2021-03-13 09:28:35 +01:00
|
|
|
|
|
|
|
// Additional test preparer
|
|
|
|
preparer android.FixturePreparer
|
2020-07-03 16:31:32 +02:00
|
|
|
}{
|
|
|
|
{
|
|
|
|
name: "testBundled",
|
|
|
|
unbundledBuild: false,
|
|
|
|
publicStub: "android_stubs_current",
|
|
|
|
systemStub: "android_system_stubs_current",
|
|
|
|
testStub: "android_test_stubs_current",
|
|
|
|
corePlatformStub: "legacy.core.platform.api.stubs",
|
2021-03-13 09:28:35 +01:00
|
|
|
preparer: android.GroupFixturePreparers(),
|
2020-07-03 16:31:32 +02:00
|
|
|
}, {
|
|
|
|
name: "testUnbundled",
|
|
|
|
unbundledBuild: true,
|
|
|
|
publicStub: "sdk_public_current_android",
|
|
|
|
systemStub: "sdk_system_current_android",
|
|
|
|
testStub: "sdk_test_current_android",
|
|
|
|
corePlatformStub: "legacy.core.platform.api.stubs",
|
2021-03-13 09:28:35 +01:00
|
|
|
preparer: PrepareForTestWithPrebuiltsOfCurrentApi,
|
2020-07-03 16:31:32 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
|
|
t.Run(tc.name, func(t *testing.T) {
|
2021-03-29 03:16:14 +02:00
|
|
|
result := android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
2021-03-13 09:28:35 +01:00
|
|
|
tc.preparer,
|
2021-04-21 15:10:42 +02:00
|
|
|
prepareForTestWithDefaultPlatformBootclasspath,
|
2021-03-12 22:44:02 +01:00
|
|
|
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
|
|
|
variables.Always_use_prebuilt_sdks = proptools.BoolPtr(tc.unbundledBuild)
|
|
|
|
}),
|
|
|
|
).RunTest(t)
|
2020-07-03 16:31:32 +02:00
|
|
|
|
2021-04-21 15:10:42 +02:00
|
|
|
hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
|
|
|
|
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
|
2020-07-03 16:31:32 +02:00
|
|
|
wantPublicStubs := "--public-stub-classpath=" + generateSdkDexPath(tc.publicStub, tc.unbundledBuild)
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantPublicStubs)
|
2020-07-03 16:31:32 +02:00
|
|
|
|
|
|
|
wantSystemStubs := "--system-stub-classpath=" + generateSdkDexPath(tc.systemStub, tc.unbundledBuild)
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantSystemStubs)
|
2020-07-03 16:31:32 +02:00
|
|
|
|
|
|
|
wantTestStubs := "--test-stub-classpath=" + generateSdkDexPath(tc.testStub, tc.unbundledBuild)
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantTestStubs)
|
|
|
|
|
|
|
|
wantCorePlatformStubs := "--core-platform-stub-classpath=" + generateDexPath(defaultJavaDir, tc.corePlatformStub)
|
|
|
|
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantCorePlatformStubs)
|
2020-07-03 16:31:32 +02:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func generateDexedPath(subDir, dex, module string) string {
|
2021-03-22 17:24:49 +01:00
|
|
|
return fmt.Sprintf("out/soong/.intermediates/%s/android_common/%s/%s.jar", subDir, dex, module)
|
2020-07-03 16:31:32 +02:00
|
|
|
}
|
|
|
|
|
2021-03-12 22:44:02 +01:00
|
|
|
func generateDexPath(moduleDir string, module string) string {
|
|
|
|
return generateDexedPath(filepath.Join(moduleDir, module), "dex", module)
|
2020-07-03 16:31:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func generateSdkDexPath(module string, unbundled bool) string {
|
|
|
|
if unbundled {
|
|
|
|
return generateDexedPath("prebuilts/sdk/"+module, "dex", module)
|
|
|
|
}
|
2021-03-12 22:44:02 +01:00
|
|
|
return generateDexPath(defaultJavaDir, module)
|
2020-07-03 16:31:32 +02:00
|
|
|
}
|
2021-01-08 18:34:44 +01:00
|
|
|
|
|
|
|
func TestHiddenAPISingletonWithPrebuiltCsvFile(t *testing.T) {
|
|
|
|
|
|
|
|
// The idea behind this test is to ensure that when the build is
|
|
|
|
// confugured with a PrebuiltHiddenApiDir that the rules for the
|
|
|
|
// hiddenapi singleton copy the prebuilts to the typical output
|
|
|
|
// location, and then use that output location for the hiddenapi encode
|
|
|
|
// dex step.
|
|
|
|
|
|
|
|
// Where to find the prebuilt hiddenapi files:
|
|
|
|
prebuiltHiddenApiDir := "path/to/prebuilt/hiddenapi"
|
|
|
|
|
2021-03-29 03:16:14 +02:00
|
|
|
result := android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
2021-04-12 21:02:36 +02:00
|
|
|
FixtureConfigureBootJars("platform:foo"),
|
2021-03-12 22:44:02 +01:00
|
|
|
fixtureSetPrebuiltHiddenApiDirProductVariable(&prebuiltHiddenApiDir),
|
|
|
|
).RunTestWithBp(t, `
|
2021-01-08 18:34:44 +01:00
|
|
|
java_import {
|
|
|
|
name: "foo",
|
|
|
|
jars: ["a.jar"],
|
|
|
|
compile_dex: true,
|
|
|
|
}
|
2021-03-12 22:44:02 +01:00
|
|
|
`)
|
2021-01-08 18:34:44 +01:00
|
|
|
|
|
|
|
expectedCpInput := prebuiltHiddenApiDir + "/hiddenapi-flags.csv"
|
2021-03-22 17:24:49 +01:00
|
|
|
expectedCpOutput := "out/soong/hiddenapi/hiddenapi-flags.csv"
|
|
|
|
expectedFlagsCsv := "out/soong/hiddenapi/hiddenapi-flags.csv"
|
2021-01-08 18:34:44 +01:00
|
|
|
|
2021-03-12 22:44:02 +01:00
|
|
|
foo := result.ModuleForTests("foo", "android_common")
|
2021-01-08 18:34:44 +01:00
|
|
|
|
2021-03-12 22:44:02 +01:00
|
|
|
hiddenAPI := result.SingletonForTests("hiddenapi")
|
2021-01-08 18:34:44 +01:00
|
|
|
cpRule := hiddenAPI.Rule("Cp")
|
|
|
|
actualCpInput := cpRule.BuildParams.Input
|
|
|
|
actualCpOutput := cpRule.BuildParams.Output
|
2021-03-29 01:42:57 +02:00
|
|
|
encodeDexRule := foo.Rule("hiddenAPIEncodeDex")
|
2021-01-08 18:34:44 +01:00
|
|
|
actualFlagsCsv := encodeDexRule.BuildParams.Args["flagsCsv"]
|
|
|
|
|
2021-03-22 17:24:49 +01:00
|
|
|
android.AssertPathRelativeToTopEquals(t, "hiddenapi cp rule input", expectedCpInput, actualCpInput)
|
2021-01-08 18:34:44 +01:00
|
|
|
|
2021-03-22 17:24:49 +01:00
|
|
|
android.AssertPathRelativeToTopEquals(t, "hiddenapi cp rule output", expectedCpOutput, actualCpOutput)
|
2021-01-08 18:34:44 +01:00
|
|
|
|
2021-03-12 22:44:02 +01:00
|
|
|
android.AssertStringEquals(t, "hiddenapi encode dex rule flags csv", expectedFlagsCsv, actualFlagsCsv)
|
2021-01-08 18:34:44 +01:00
|
|
|
}
|
2021-05-14 16:03:30 +02:00
|
|
|
|
|
|
|
func TestHiddenAPIEncoding_JavaSdkLibrary(t *testing.T) {
|
|
|
|
|
|
|
|
result := android.GroupFixturePreparers(
|
|
|
|
hiddenApiFixtureFactory,
|
|
|
|
FixtureConfigureBootJars("platform:foo"),
|
|
|
|
PrepareForTestWithJavaSdkLibraryFiles,
|
|
|
|
FixtureWithLastReleaseApis("foo"),
|
|
|
|
|
|
|
|
// Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
|
|
|
|
// is disabled.
|
|
|
|
android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
|
|
|
|
).RunTestWithBp(t, `
|
|
|
|
java_sdk_library {
|
|
|
|
name: "foo",
|
|
|
|
srcs: ["a.java"],
|
|
|
|
shared_library: false,
|
|
|
|
compile_dex: true,
|
|
|
|
public: {enabled: true},
|
|
|
|
}
|
|
|
|
`)
|
|
|
|
|
|
|
|
checkDexEncoded := func(t *testing.T, name, unencodedDexJar, encodedDexJar string) {
|
|
|
|
moduleForTests := result.ModuleForTests(name, "android_common")
|
|
|
|
|
|
|
|
encodeDexRule := moduleForTests.Rule("hiddenAPIEncodeDex")
|
|
|
|
actualUnencodedDexJar := encodeDexRule.Input
|
|
|
|
|
|
|
|
// Make sure that the module has its dex jar encoded.
|
|
|
|
android.AssertStringEquals(t, "encode embedded java_library", unencodedDexJar, actualUnencodedDexJar.String())
|
|
|
|
|
|
|
|
// Make sure that the encoded dex jar is the exported one.
|
|
|
|
exportedDexJar := moduleForTests.Module().(UsesLibraryDependency).DexJarBuildPath()
|
|
|
|
android.AssertPathRelativeToTopEquals(t, "encode embedded java_library", encodedDexJar, exportedDexJar)
|
|
|
|
}
|
|
|
|
|
|
|
|
// 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"
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|