Reverse merge order of resources and implementation

Merge the resources first in case one of the static libraries
merge into the implementation jars contains a duplicate resource.
Also put the manifest into the resource jar so that the default
manifest doens't override the custom manifest.

Test: m checkbuild
Change-Id: I96d117c306bc9f1346720251d3993031992cef66
This commit is contained in:
Colin Cross 2019-04-29 10:22:44 -07:00
parent 77b47fdf51
commit 08a409df2d
1 changed files with 2 additions and 2 deletions

View File

@ -1253,9 +1253,9 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
// merge implementation jar with resources if necessary
implementationAndResourcesJar := outputFile
if j.resourceJar != nil {
jars := android.Paths{implementationAndResourcesJar, j.resourceJar}
jars := android.Paths{j.resourceJar, implementationAndResourcesJar}
combinedJar := android.PathForModuleOut(ctx, "withres", jarName)
TransformJarsToJar(ctx, combinedJar, "for resources", jars, android.OptionalPath{},
TransformJarsToJar(ctx, combinedJar, "for resources", jars, manifest,
false, nil, nil)
implementationAndResourcesJar = combinedJar
}