diff options
author | 2017-09-12 22:50:46 -0700 | |
---|---|---|
committer | 2017-09-20 13:20:45 -0700 | |
commit | 635acc9446c3a8c88b6599d30312c6399419f2b8 (patch) | |
tree | f46d048da7c2ac22272bcfb8f792a3db56997b80 /java/java.go | |
parent | 6eebec7414cb5940725c91bc03261c7de838b9e0 (diff) |
Rearrange manifest file handling in merge_zips and soong_zip
Jar always puts default MANIFEST.MF files in if none was specified.
Copying that behavior in soong_zip causes problems with merge_zips,
because it ends up taking the default manifest from the classes.jar
instead of the user's manifest from res.jar. We don't want the
user's manifest in the classes.jar, otherwise a change to the
manifest will cause all the class files to rebuild. Instead,
move the manifest insertion to the final merge_zips stage.
Test: m -j checkbuild
Change-Id: Id6376961dbaf743c2fb92843f9bdf2e44b963be0
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/java/java.go b/java/java.go index b4ce35ede..d7b5847d5 100644 --- a/java/java.go +++ b/java/java.go @@ -385,11 +385,9 @@ func (j *Module) compile(ctx android.ModuleContext) { } resourceJarSpecs := ResourceDirsToJarSpecs(ctx, j.properties.Resource_dirs, j.properties.Exclude_resource_dirs) - manifest := android.OptionalPathForModuleSrc(ctx, j.properties.Manifest) - - if len(resourceJarSpecs) > 0 || manifest.Valid() { + if len(resourceJarSpecs) > 0 { // Combine classes + resources into classes-full-debug.jar - resourceJar := TransformResourcesToJar(ctx, resourceJarSpecs, manifest, extraJarDeps) + resourceJar := TransformResourcesToJar(ctx, resourceJarSpecs, extraJarDeps) if ctx.Failed() { return } @@ -399,9 +397,11 @@ func (j *Module) compile(ctx android.ModuleContext) { jars = append(jars, deps.staticJars...) + manifest := android.OptionalPathForModuleSrc(ctx, j.properties.Manifest) + // Combine the classes built from sources, any manifests, and any static libraries into // classes-combined.jar. If there is only one input jar this step will be skipped. - outputFile := TransformJarsToJar(ctx, "classes-combined.jar", jars) + outputFile := TransformJarsToJar(ctx, "classes.jar", jars, manifest, false) if j.properties.Jarjar_rules != nil { jarjar_rules := android.PathForModuleSrc(ctx, *j.properties.Jarjar_rules) @@ -616,7 +616,7 @@ func (j *Import) DepsMutator(ctx android.BottomUpMutatorContext) { func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { j.classpathFiles = android.PathsForModuleSrc(ctx, j.properties.Jars) - j.combinedClasspathFile = TransformJarsToJar(ctx, "classes.jar", j.classpathFiles) + j.combinedClasspathFile = TransformJarsToJar(ctx, "classes.jar", j.classpathFiles, android.OptionalPath{}, false) } var _ Dependency = (*Import)(nil) |