Commit graph

7 commits

Author SHA1 Message Date
Colin Cross
5c6ecc179f Don't panic in turbine with no classes
ALLOW_MISSING_DEPENDENCIES=true can cause missing dependencies to be
hidden from GenerateAndroidBuildActions, which is triggering the
len(jars) == 0 check in compileJavaHeader.  For the
ALLOW_MISSING_DEPENDENCIES=true case the check is unnecessary, as the
build rules will be replaced with runtime errors.  On the off chance
the check would have been hit in a real build, allow merge_zips to
create an empty zip file if it is asked to.

Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: I3171f921d51229ddf38a1a647d32566658c673fa
2017-10-24 16:01:44 -07:00
Colin Cross
0cf45cdc1e Add -stripFile argument to merge_zips
Putting resources in dex jars is going to need to pull files from
classpath jars that do not match *.class.

Test: m -j checkbuild
Change-Id: Ia37b8b9387e5f5636769afc6937b9aa3c9ec1ced
2017-10-04 17:19:43 -07:00
Colin Cross
635acc9446 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
2017-09-20 13:20:45 -07:00
Nan Zhang
13f4cf5c9e Add -stripDir and -zipToNotStrip option in merge_zips.
In some cases, we need delete META-INF dir to void mis-using some
classes files in the Java runtime.

For now, when we delete META-INF, we need keep Manifest file in the jar
since merge_zips doesn't have ability to add a default one.

Bug: b/65455145
Test: m clean && m -j

Change-Id: Iea44b1a98d348cd8df1fa7374907733b1add6935
2017-09-19 18:44:43 -07:00
Nan Zhang
d5998cce7d Don't add data_descripters when merging uncompress zip entries for merge_zips.
Also filter out META-INF/TRANSITIVE dir, and report warnings when
merge_zips see duplicates entries with different CRC hash.

Bug: b/65455145
Test: m clean && m -j java (locally)

Change-Id: I47172ffa27df71f3280f35f6b540a7b5a0c14550
2017-09-13 23:01:49 -07:00
Colin Cross
34540315a0 Allow some duplicates in merged jars
Only take the first MANIFEST.MF or module-info.class file.

Test: m -j checkbuild
Change-Id: Ifbf9fe272437ef2c2bd51ab4849ac8d7ef37b6fc
2017-09-06 15:01:07 -07:00
Jeff Gaston
8bab5f2015 Implement merge_zips
For merging .zip and/or .jar files

Bug: 64691570
Test: merge_zips merged.zip in1.zip in2.zip
Change-Id: I9a080d25b92a506c9b5451670c4786895b2722ab
2017-09-01 13:52:13 -07:00