Touch up manifest if there's no source code.
The new package manager behavior requires packages without source code to have an application element with hasCode attribute set to false in their manifest. With this change, Soong can now automatically insert one for codeless apps. Test: app_test.go, manifest_fixer_test.py Fixes: 124375490 Change-Id: Ied89a8d07c63805ab910859a4f7c45fc1c60bb73
This commit is contained in:
13
java/java.go
13
java/java.go
@@ -966,8 +966,6 @@ func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB
|
||||
|
||||
func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
||||
|
||||
hasSrcs := false
|
||||
|
||||
j.exportAidlIncludeDirs = android.PathsForModuleSrc(ctx, j.deviceProperties.Aidl.Export_include_dirs)
|
||||
|
||||
deps := j.collectDeps(ctx)
|
||||
@@ -982,9 +980,6 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
||||
}
|
||||
|
||||
srcFiles = j.genSources(ctx, srcFiles, flags)
|
||||
if len(srcFiles) > 0 {
|
||||
hasSrcs = true
|
||||
}
|
||||
|
||||
srcJars := srcFiles.FilterByExt(".srcjar")
|
||||
srcJars = append(srcJars, deps.srcJars...)
|
||||
@@ -1181,7 +1176,6 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
||||
|
||||
if len(deps.staticJars) > 0 {
|
||||
jars = append(jars, deps.staticJars...)
|
||||
hasSrcs = true
|
||||
}
|
||||
|
||||
manifest := j.overrideManifest
|
||||
@@ -1293,7 +1287,7 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) {
|
||||
|
||||
j.implementationAndResourcesJar = implementationAndResourcesJar
|
||||
|
||||
if ctx.Device() && hasSrcs &&
|
||||
if ctx.Device() && j.hasCode(ctx) &&
|
||||
(Bool(j.properties.Installable) || Bool(j.deviceProperties.Compile_dex)) {
|
||||
// Dex compilation
|
||||
var dexOutputFile android.ModuleOutPath
|
||||
@@ -1498,6 +1492,11 @@ func (j *Module) CompilerDeps() []string {
|
||||
return jdeps
|
||||
}
|
||||
|
||||
func (j *Module) hasCode(ctx android.ModuleContext) bool {
|
||||
srcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Srcs, j.properties.Exclude_srcs)
|
||||
return len(srcFiles) > 0 || len(ctx.GetDirectDepsWithTag(staticLibTag)) > 0
|
||||
}
|
||||
|
||||
//
|
||||
// Java libraries (.jar file)
|
||||
//
|
||||
|
Reference in New Issue
Block a user