diff options
| author | 2020-02-13 22:21:45 +0000 | |
|---|---|---|
| committer | 2020-02-13 22:21:45 +0000 | |
| commit | c9f9ab89a98c9f551b5c1305315942a50f368139 (patch) | |
| tree | 5a94bb68234ceec14c9496df69e37fd94d939289 /java/java.go | |
| parent | 8744cdffebeb0ff58e48eebae5b82541b8c90307 (diff) | |
| parent | 6d415273c04e5b5fd449b14094c0fe4431b94a43 (diff) | |
Merge changes from topic "dex2oat-soong-dep-2"
* changes:
Do all dexpreoptDisabled checks before registering a dex2oat host dep.
Pass dexpreopt config structs by reference.
Reland: Get the dex2oat host tool path from module dependency on the binary module.
Reland: Move the Once cache for dexpreopt.GlobalConfig into the dexpreopt package.
Reland: Separate dexpreopt.GlobalSoongConfig to allow independent caching of it.
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/java/java.go b/java/java.go index d84d16272..ceedd8971 100644 --- a/java/java.go +++ b/java/java.go @@ -76,6 +76,10 @@ func RegisterJavaBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("java_host_for_device", HostForDeviceFactory) ctx.RegisterModuleType("dex_import", DexImportFactory) + ctx.FinalDepsMutators(func(ctx android.RegisterMutatorsContext) { + ctx.BottomUp("dexpreopt_tool_deps", dexpreoptToolDepsMutator).Parallel() + }) + ctx.RegisterSingletonType("logtags", LogtagsSingleton) ctx.RegisterSingletonType("kythe_java_extract", kytheExtractJavaFactory) } @@ -105,7 +109,7 @@ func DexpreoptedSystemServerJars(config android.Config) *[]string { // order (which is partial and non-deterministic). This pass adds additional dependencies between // jars, making the order total and deterministic. It also constructs a global ordered list. func systemServerJarsDepsMutator(ctx android.BottomUpMutatorContext) { - jars := dexpreopt.NonUpdatableSystemServerJars(ctx, dexpreoptGlobalConfig(ctx)) + jars := dexpreopt.NonUpdatableSystemServerJars(ctx, dexpreopt.GetGlobalConfig(ctx)) name := ctx.ModuleName() if android.InList(name, jars) { dexpreoptedSystemServerJarsLock.Lock() @@ -1781,6 +1785,10 @@ func (j *Module) JacocoReportClassesFile() android.Path { return j.jacocoReportClassesFile } +func (j *Module) IsInstallable() bool { + return Bool(j.properties.Installable) +} + // // Java libraries (.jar file) // @@ -1818,7 +1826,6 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.checkSdkVersion(ctx) j.dexpreopter.installPath = android.PathForModuleInstall(ctx, "framework", j.Stem()+".jar") j.dexpreopter.isSDKLibrary = j.deviceProperties.IsSDKLibrary - j.dexpreopter.isInstallable = Bool(j.properties.Installable) j.dexpreopter.uncompressedDex = shouldUncompressDex(ctx, &j.dexpreopter) j.deviceProperties.UncompressDex = j.dexpreopter.uncompressedDex j.compile(ctx, nil) @@ -2575,13 +2582,16 @@ func (j *DexImport) Stem() string { return proptools.StringDefault(j.properties.Stem, j.ModuleBase.Name()) } +func (j *DexImport) IsInstallable() bool { + return true +} + func (j *DexImport) GenerateAndroidBuildActions(ctx android.ModuleContext) { if len(j.properties.Jars) != 1 { ctx.PropertyErrorf("jars", "exactly one jar must be provided") } j.dexpreopter.installPath = android.PathForModuleInstall(ctx, "framework", j.Stem()+".jar") - j.dexpreopter.isInstallable = true j.dexpreopter.uncompressedDex = shouldUncompressDex(ctx, &j.dexpreopter) inputJar := ctx.ExpandSource(j.properties.Jars[0], "jars") |