summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2023-01-24 11:48:08 -0800
committer Cole Faust <colefaust@google.com> 2023-01-27 15:43:38 -0800
commit5c503d1c434603370c442fbe29f330cc3f77e439 (patch)
treecb25cdf667a9995bbf0674d774fadb1e7d8cc0bd /java/java_test.go
parent3420d978cf2d5fe614f12256595ff67be2ee6f98 (diff)
Precompile python sources
This signifigantly improves the startup time of soong-built python binaries. For example, running `m apexer && time out/host/linux-x86/bin/apexer` gives 0.734s before this cl, and 0.094s after. Fixes: 259718110 Test: Presubmits Change-Id: Ib19e83e2c60c39a849525be117279c318de3afa7
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 04a112c0a..21993eccf 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -30,7 +30,6 @@ import (
"android/soong/cc"
"android/soong/dexpreopt"
"android/soong/genrule"
- "android/soong/python"
)
// Legacy preparer used for running tests within the java package.
@@ -49,7 +48,6 @@ var prepareForJavaTest = android.GroupFixturePreparers(
// Include all the default java modules.
PrepareForTestWithJavaDefaultModules,
PrepareForTestWithOverlayBuildComponents,
- python.PrepareForTestWithPythonBuildComponents,
android.FixtureRegisterWithContext(func(ctx android.RegistrationContext) {
ctx.RegisterPreSingletonType("sdk_versions", sdkPreSingletonFactory)
}),
@@ -1440,24 +1438,26 @@ func TestAidlEnforcePermissionsException(t *testing.T) {
}
func TestDataNativeBinaries(t *testing.T) {
- ctx, _ := testJava(t, `
+ ctx := android.GroupFixturePreparers(
+ prepareForJavaTest,
+ android.PrepareForTestWithAllowMissingDependencies).RunTestWithBp(t, `
java_test_host {
name: "foo",
srcs: ["a.java"],
data_native_bins: ["bin"]
}
- python_binary_host {
+ cc_binary_host {
name: "bin",
- srcs: ["bin.py"],
+ srcs: ["bin.cpp"],
}
- `)
+ `).TestContext
buildOS := ctx.Config().BuildOS.String()
test := ctx.ModuleForTests("foo", buildOS+"_common").Module().(*TestHost)
entries := android.AndroidMkEntriesForTest(t, ctx, test)[0]
- expected := []string{"out/soong/.intermediates/bin/" + buildOS + "_x86_64_PY3/bin:bin"}
+ expected := []string{"out/soong/.intermediates/bin/" + buildOS + "_x86_64/bin:bin"}
actual := entries.EntryMap["LOCAL_COMPATIBILITY_SUPPORT_FILES"]
android.AssertStringPathsRelativeToTopEquals(t, "LOCAL_COMPATIBILITY_SUPPORT_FILES", ctx.Config(), expected, actual)
}