blob: 147f326c7020575d216fc471b17a40559ea6485d [file] [log] [blame]
Liz Kammer5ca3a622020-08-05 15:40:41 -07001// Copyright 2020 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package java
16
17import (
Anton Hanssona2adc372020-07-03 15:31:32 +010018 "fmt"
Paul Duffin175947f2021-03-12 21:44:02 +000019 "path/filepath"
Liz Kammer5ca3a622020-08-05 15:40:41 -070020 "testing"
Anton Hanssona2adc372020-07-03 15:31:32 +010021
Paul Duffin01289a22021-02-04 17:49:33 +000022 "android/soong/android"
Martin Stjernholm8be1e6d2021-09-15 03:34:04 +010023
Anton Hanssona2adc372020-07-03 15:31:32 +010024 "github.com/google/blueprint/proptools"
Liz Kammer5ca3a622020-08-05 15:40:41 -070025)
26
Paul Duffin74431d52021-04-21 14:10:42 +010027// TODO(b/177892522): Move these tests into a more appropriate place.
28
Paul Duffin175947f2021-03-12 21:44:02 +000029func fixtureSetPrebuiltHiddenApiDirProductVariable(prebuiltHiddenApiDir *string) android.FixturePreparer {
30 return android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
31 variables.PrebuiltHiddenApiDir = prebuiltHiddenApiDir
32 })
Liz Kammer5ca3a622020-08-05 15:40:41 -070033}
34
Paul Duffin74431d52021-04-21 14:10:42 +010035var prepareForTestWithDefaultPlatformBootclasspath = android.FixtureAddTextFile("frameworks/base/boot/Android.bp", `
36 platform_bootclasspath {
37 name: "platform-bootclasspath",
38 }
39`)
40
Paul Duffin71ae5942021-03-22 15:36:52 +000041var hiddenApiFixtureFactory = android.GroupFixturePreparers(
Jiakai Zhangb95998b2023-05-11 16:39:27 +010042 PrepareForTestWithJavaDefaultModules,
43 PrepareForTestWithHiddenApiBuildComponents,
44)
Liz Kammer5ca3a622020-08-05 15:40:41 -070045
46func TestHiddenAPISingleton(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -080047 t.Parallel()
Paul Duffin79abe572021-03-29 02:16:14 +010048 result := android.GroupFixturePreparers(
49 hiddenApiFixtureFactory,
Paul Duffin60264a02021-04-12 20:02:36 +010050 FixtureConfigureBootJars("platform:foo"),
Paul Duffin74431d52021-04-21 14:10:42 +010051 prepareForTestWithDefaultPlatformBootclasspath,
Paul Duffin175947f2021-03-12 21:44:02 +000052 ).RunTestWithBp(t, `
Liz Kammer5ca3a622020-08-05 15:40:41 -070053 java_library {
54 name: "foo",
55 srcs: ["a.java"],
56 compile_dex: true,
Paul Duffin01289a22021-02-04 17:49:33 +000057 }
Paul Duffin175947f2021-03-12 21:44:02 +000058 `)
Liz Kammer5ca3a622020-08-05 15:40:41 -070059
Colin Cross90607e92025-02-11 14:58:07 -080060 hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
Paul Duffin74431d52021-04-21 14:10:42 +010061 hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
Paul Duffin2f9e71e2021-03-22 16:24:49 +000062 want := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
Paul Duffin175947f2021-03-12 21:44:02 +000063 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, want)
Liz Kammer5ca3a622020-08-05 15:40:41 -070064}
65
Paul Duffinec0fe172021-02-25 15:34:13 +000066func TestHiddenAPISingletonWithSourceAndPrebuiltPreferredButNoDex(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -080067 t.Parallel()
Paul Duffinb6f53c02021-05-14 07:52:42 +010068 expectedErrorMessage := "module prebuilt_foo{os:android,arch:common} does not provide a dex jar"
Paul Duffin175947f2021-03-12 21:44:02 +000069
Paul Duffin79abe572021-03-29 02:16:14 +010070 android.GroupFixturePreparers(
71 hiddenApiFixtureFactory,
Paul Duffin60264a02021-04-12 20:02:36 +010072 FixtureConfigureBootJars("platform:foo"),
Paul Duffin74431d52021-04-21 14:10:42 +010073 prepareForTestWithDefaultPlatformBootclasspath,
Paul Duffin175947f2021-03-12 21:44:02 +000074 ).ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern(expectedErrorMessage)).
75 RunTestWithBp(t, `
Paul Duffinec0fe172021-02-25 15:34:13 +000076 java_library {
77 name: "foo",
78 srcs: ["a.java"],
79 compile_dex: true,
80 }
81
82 java_import {
83 name: "foo",
84 jars: ["a.jar"],
85 prefer: true,
86 }
Paul Duffin175947f2021-03-12 21:44:02 +000087 `)
Paul Duffinec0fe172021-02-25 15:34:13 +000088}
89
Liz Kammer5ca3a622020-08-05 15:40:41 -070090func TestHiddenAPISingletonWithPrebuilt(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -080091 t.Parallel()
Paul Duffin79abe572021-03-29 02:16:14 +010092 result := android.GroupFixturePreparers(
93 hiddenApiFixtureFactory,
Paul Duffin60264a02021-04-12 20:02:36 +010094 FixtureConfigureBootJars("platform:foo"),
Paul Duffin74431d52021-04-21 14:10:42 +010095 prepareForTestWithDefaultPlatformBootclasspath,
Paul Duffin175947f2021-03-12 21:44:02 +000096 ).RunTestWithBp(t, `
Liz Kammer5ca3a622020-08-05 15:40:41 -070097 java_import {
98 name: "foo",
99 jars: ["a.jar"],
100 compile_dex: true,
101 }
Paul Duffin175947f2021-03-12 21:44:02 +0000102 `)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700103
Colin Cross90607e92025-02-11 14:58:07 -0800104 hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
Paul Duffin74431d52021-04-21 14:10:42 +0100105 hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000106 want := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
Paul Duffin175947f2021-03-12 21:44:02 +0000107 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, want)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700108}
109
110func TestHiddenAPISingletonWithPrebuiltUseSource(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -0800111 t.Parallel()
Paul Duffin79abe572021-03-29 02:16:14 +0100112 result := android.GroupFixturePreparers(
113 hiddenApiFixtureFactory,
Paul Duffin60264a02021-04-12 20:02:36 +0100114 FixtureConfigureBootJars("platform:foo"),
Paul Duffin74431d52021-04-21 14:10:42 +0100115 prepareForTestWithDefaultPlatformBootclasspath,
Paul Duffin175947f2021-03-12 21:44:02 +0000116 ).RunTestWithBp(t, `
Liz Kammer5ca3a622020-08-05 15:40:41 -0700117 java_library {
118 name: "foo",
119 srcs: ["a.java"],
120 compile_dex: true,
Paul Duffin01289a22021-02-04 17:49:33 +0000121 }
Liz Kammer5ca3a622020-08-05 15:40:41 -0700122
123 java_import {
124 name: "foo",
125 jars: ["a.jar"],
126 compile_dex: true,
127 prefer: false,
Paul Duffin01289a22021-02-04 17:49:33 +0000128 }
Paul Duffin175947f2021-03-12 21:44:02 +0000129 `)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700130
Colin Cross90607e92025-02-11 14:58:07 -0800131 hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
Paul Duffin74431d52021-04-21 14:10:42 +0100132 hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000133 fromSourceJarArg := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
Paul Duffin175947f2021-03-12 21:44:02 +0000134 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, fromSourceJarArg)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700135
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000136 prebuiltJarArg := "--boot-dex=out/soong/.intermediates/foo/android_common/dex/foo.jar"
Paul Duffin175947f2021-03-12 21:44:02 +0000137 android.AssertStringDoesNotContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, prebuiltJarArg)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700138}
139
140func TestHiddenAPISingletonWithPrebuiltOverrideSource(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -0800141 t.Parallel()
Paul Duffin79abe572021-03-29 02:16:14 +0100142 result := android.GroupFixturePreparers(
143 hiddenApiFixtureFactory,
Paul Duffin60264a02021-04-12 20:02:36 +0100144 FixtureConfigureBootJars("platform:foo"),
Paul Duffin74431d52021-04-21 14:10:42 +0100145 prepareForTestWithDefaultPlatformBootclasspath,
Paul Duffin175947f2021-03-12 21:44:02 +0000146 ).RunTestWithBp(t, `
Liz Kammer5ca3a622020-08-05 15:40:41 -0700147 java_library {
148 name: "foo",
149 srcs: ["a.java"],
150 compile_dex: true,
Paul Duffin01289a22021-02-04 17:49:33 +0000151 }
Liz Kammer5ca3a622020-08-05 15:40:41 -0700152
153 java_import {
154 name: "foo",
155 jars: ["a.jar"],
156 compile_dex: true,
157 prefer: true,
Paul Duffin01289a22021-02-04 17:49:33 +0000158 }
Paul Duffin175947f2021-03-12 21:44:02 +0000159 `)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700160
Colin Cross90607e92025-02-11 14:58:07 -0800161 hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
Paul Duffin74431d52021-04-21 14:10:42 +0100162 hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000163 prebuiltJarArg := "--boot-dex=out/soong/.intermediates/prebuilt_foo/android_common/dex/foo.jar"
Paul Duffin175947f2021-03-12 21:44:02 +0000164 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, prebuiltJarArg)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700165
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000166 fromSourceJarArg := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
Paul Duffin175947f2021-03-12 21:44:02 +0000167 android.AssertStringDoesNotContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, fromSourceJarArg)
Liz Kammer5ca3a622020-08-05 15:40:41 -0700168}
Anton Hanssona2adc372020-07-03 15:31:32 +0100169
170func TestHiddenAPISingletonSdks(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -0800171 t.Parallel()
Anton Hanssona2adc372020-07-03 15:31:32 +0100172 testCases := []struct {
173 name string
174 unbundledBuild bool
175 publicStub string
176 systemStub string
177 testStub string
178 corePlatformStub string
Paul Duffindc92abb2021-03-13 08:28:35 +0000179
180 // Additional test preparer
181 preparer android.FixturePreparer
Anton Hanssona2adc372020-07-03 15:31:32 +0100182 }{
183 {
184 name: "testBundled",
185 unbundledBuild: false,
Jihoon Kangbd093452023-12-26 19:08:01 +0000186 publicStub: "android_stubs_current_exportable",
187 systemStub: "android_system_stubs_current_exportable",
188 testStub: "android_test_stubs_current_exportable",
189 corePlatformStub: "legacy.core.platform.api.stubs.exportable",
Paul Duffindc92abb2021-03-13 08:28:35 +0000190 preparer: android.GroupFixturePreparers(),
Anton Hanssona2adc372020-07-03 15:31:32 +0100191 }, {
192 name: "testUnbundled",
193 unbundledBuild: true,
194 publicStub: "sdk_public_current_android",
195 systemStub: "sdk_system_current_android",
196 testStub: "sdk_test_current_android",
Jihoon Kangbd093452023-12-26 19:08:01 +0000197 corePlatformStub: "legacy.core.platform.api.stubs.exportable",
Paul Duffindc92abb2021-03-13 08:28:35 +0000198 preparer: PrepareForTestWithPrebuiltsOfCurrentApi,
Anton Hanssona2adc372020-07-03 15:31:32 +0100199 },
200 }
201 for _, tc := range testCases {
202 t.Run(tc.name, func(t *testing.T) {
Paul Duffin79abe572021-03-29 02:16:14 +0100203 result := android.GroupFixturePreparers(
204 hiddenApiFixtureFactory,
Paul Duffindc92abb2021-03-13 08:28:35 +0000205 tc.preparer,
Paul Duffin74431d52021-04-21 14:10:42 +0100206 prepareForTestWithDefaultPlatformBootclasspath,
Spandan Das81fe4d12024-05-15 18:43:47 +0000207 // Make sure that we have atleast one platform library so that we can check the monolithic hiddenapi
208 // file creation.
209 FixtureConfigureBootJars("platform:foo"),
Paul Duffin175947f2021-03-12 21:44:02 +0000210 android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
211 variables.Always_use_prebuilt_sdks = proptools.BoolPtr(tc.unbundledBuild)
212 }),
Colin Crossa66b4632024-08-08 15:50:47 -0700213 android.PrepareForTestWithBuildFlag("RELEASE_HIDDEN_API_EXPORTABLE_STUBS", "true"),
Spandan Das81fe4d12024-05-15 18:43:47 +0000214 ).RunTestWithBp(t, `
215 java_library {
216 name: "foo",
217 srcs: ["a.java"],
218 compile_dex: true,
219 }
220 `)
Anton Hanssona2adc372020-07-03 15:31:32 +0100221
Colin Cross90607e92025-02-11 14:58:07 -0800222 hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
Paul Duffin74431d52021-04-21 14:10:42 +0100223 hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
Anton Hanssona2adc372020-07-03 15:31:32 +0100224 wantPublicStubs := "--public-stub-classpath=" + generateSdkDexPath(tc.publicStub, tc.unbundledBuild)
Paul Duffin175947f2021-03-12 21:44:02 +0000225 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantPublicStubs)
Anton Hanssona2adc372020-07-03 15:31:32 +0100226
227 wantSystemStubs := "--system-stub-classpath=" + generateSdkDexPath(tc.systemStub, tc.unbundledBuild)
Paul Duffin175947f2021-03-12 21:44:02 +0000228 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantSystemStubs)
Anton Hanssona2adc372020-07-03 15:31:32 +0100229
230 wantTestStubs := "--test-stub-classpath=" + generateSdkDexPath(tc.testStub, tc.unbundledBuild)
Paul Duffin175947f2021-03-12 21:44:02 +0000231 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantTestStubs)
Anton Hanssona2adc372020-07-03 15:31:32 +0100232
Paul Duffin175947f2021-03-12 21:44:02 +0000233 wantCorePlatformStubs := "--core-platform-stub-classpath=" + generateDexPath(defaultJavaDir, tc.corePlatformStub)
234 android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantCorePlatformStubs)
Anton Hanssona2adc372020-07-03 15:31:32 +0100235 })
236 }
237}
238
239func generateDexedPath(subDir, dex, module string) string {
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000240 return fmt.Sprintf("out/soong/.intermediates/%s/android_common/%s/%s.jar", subDir, dex, module)
Anton Hanssona2adc372020-07-03 15:31:32 +0100241}
242
Paul Duffin175947f2021-03-12 21:44:02 +0000243func generateDexPath(moduleDir string, module string) string {
244 return generateDexedPath(filepath.Join(moduleDir, module), "dex", module)
Anton Hanssona2adc372020-07-03 15:31:32 +0100245}
246
247func generateSdkDexPath(module string, unbundled bool) string {
248 if unbundled {
249 return generateDexedPath("prebuilts/sdk/"+module, "dex", module)
250 }
Paul Duffin175947f2021-03-12 21:44:02 +0000251 return generateDexPath(defaultJavaDir, module)
Anton Hanssona2adc372020-07-03 15:31:32 +0100252}
Bill Peckhambae47492021-01-08 09:34:44 -0800253
254func TestHiddenAPISingletonWithPrebuiltCsvFile(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -0800255 t.Parallel()
Bill Peckhambae47492021-01-08 09:34:44 -0800256
257 // The idea behind this test is to ensure that when the build is
258 // confugured with a PrebuiltHiddenApiDir that the rules for the
259 // hiddenapi singleton copy the prebuilts to the typical output
260 // location, and then use that output location for the hiddenapi encode
261 // dex step.
262
263 // Where to find the prebuilt hiddenapi files:
264 prebuiltHiddenApiDir := "path/to/prebuilt/hiddenapi"
265
Paul Duffin79abe572021-03-29 02:16:14 +0100266 result := android.GroupFixturePreparers(
267 hiddenApiFixtureFactory,
Paul Duffin60264a02021-04-12 20:02:36 +0100268 FixtureConfigureBootJars("platform:foo"),
Paul Duffin175947f2021-03-12 21:44:02 +0000269 fixtureSetPrebuiltHiddenApiDirProductVariable(&prebuiltHiddenApiDir),
270 ).RunTestWithBp(t, `
Bill Peckhambae47492021-01-08 09:34:44 -0800271 java_import {
272 name: "foo",
273 jars: ["a.jar"],
274 compile_dex: true,
275 }
Paul Duffin175947f2021-03-12 21:44:02 +0000276 `)
Bill Peckhambae47492021-01-08 09:34:44 -0800277
278 expectedCpInput := prebuiltHiddenApiDir + "/hiddenapi-flags.csv"
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000279 expectedCpOutput := "out/soong/hiddenapi/hiddenapi-flags.csv"
280 expectedFlagsCsv := "out/soong/hiddenapi/hiddenapi-flags.csv"
Bill Peckhambae47492021-01-08 09:34:44 -0800281
Colin Cross90607e92025-02-11 14:58:07 -0800282 foo := result.ModuleForTests(t, "foo", "android_common")
Bill Peckhambae47492021-01-08 09:34:44 -0800283
Colin Cross90607e92025-02-11 14:58:07 -0800284 hiddenAPI := result.SingletonForTests(t, "hiddenapi")
Bill Peckhambae47492021-01-08 09:34:44 -0800285 cpRule := hiddenAPI.Rule("Cp")
286 actualCpInput := cpRule.BuildParams.Input
287 actualCpOutput := cpRule.BuildParams.Output
Paul Duffina71a67a2021-03-29 00:42:57 +0100288 encodeDexRule := foo.Rule("hiddenAPIEncodeDex")
Bill Peckhambae47492021-01-08 09:34:44 -0800289 actualFlagsCsv := encodeDexRule.BuildParams.Args["flagsCsv"]
290
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000291 android.AssertPathRelativeToTopEquals(t, "hiddenapi cp rule input", expectedCpInput, actualCpInput)
Bill Peckhambae47492021-01-08 09:34:44 -0800292
Paul Duffin2f9e71e2021-03-22 16:24:49 +0000293 android.AssertPathRelativeToTopEquals(t, "hiddenapi cp rule output", expectedCpOutput, actualCpOutput)
Bill Peckhambae47492021-01-08 09:34:44 -0800294
Paul Duffin175947f2021-03-12 21:44:02 +0000295 android.AssertStringEquals(t, "hiddenapi encode dex rule flags csv", expectedFlagsCsv, actualFlagsCsv)
Bill Peckhambae47492021-01-08 09:34:44 -0800296}
Paul Duffin0d586582021-05-14 15:03:30 +0100297
298func TestHiddenAPIEncoding_JavaSdkLibrary(t *testing.T) {
Colin Cross844cb6a2025-01-29 15:53:21 -0800299 t.Parallel()
Paul Duffin0d586582021-05-14 15:03:30 +0100300
301 result := android.GroupFixturePreparers(
302 hiddenApiFixtureFactory,
303 FixtureConfigureBootJars("platform:foo"),
304 PrepareForTestWithJavaSdkLibraryFiles,
305 FixtureWithLastReleaseApis("foo"),
306
307 // Make sure that the frameworks/base/Android.bp file exists as otherwise hidden API encoding
308 // is disabled.
309 android.FixtureAddTextFile("frameworks/base/Android.bp", ""),
310 ).RunTestWithBp(t, `
311 java_sdk_library {
312 name: "foo",
313 srcs: ["a.java"],
314 shared_library: false,
315 compile_dex: true,
316 public: {enabled: true},
317 }
318 `)
319
320 checkDexEncoded := func(t *testing.T, name, unencodedDexJar, encodedDexJar string) {
Colin Cross90607e92025-02-11 14:58:07 -0800321 moduleForTests := result.ModuleForTests(t, name+".impl", "android_common")
Paul Duffin0d586582021-05-14 15:03:30 +0100322
323 encodeDexRule := moduleForTests.Rule("hiddenAPIEncodeDex")
324 actualUnencodedDexJar := encodeDexRule.Input
325
326 // Make sure that the module has its dex jar encoded.
327 android.AssertStringEquals(t, "encode embedded java_library", unencodedDexJar, actualUnencodedDexJar.String())
328
329 // Make sure that the encoded dex jar is the exported one.
Spandan Das59a4a2b2024-01-09 21:35:56 +0000330 errCtx := moduleErrorfTestCtx{}
331 exportedDexJar := moduleForTests.Module().(UsesLibraryDependency).DexJarBuildPath(errCtx).Path()
Paul Duffin0d586582021-05-14 15:03:30 +0100332 android.AssertPathRelativeToTopEquals(t, "encode embedded java_library", encodedDexJar, exportedDexJar)
333 }
334
Colin Cross844cb6a2025-01-29 15:53:21 -0800335 expectedUnencodedDexJar := "out/soong/.intermediates/foo.impl/android_common/aligned/foo.jar"
336 expectedEncodedDexJar := "out/soong/.intermediates/foo.impl/android_common/hiddenapi/foo.jar"
337 checkDexEncoded(t, "foo", expectedUnencodedDexJar, expectedEncodedDexJar)
Paul Duffin0d586582021-05-14 15:03:30 +0100338}