Commit graph

412 commits

Author SHA1 Message Date
Nan Zhang
c128894560 Merge "Move private_manifest file insertion to jars merging phase." am: 3d6aaa2f56 am: d43952b8f8
am: abbb6a1fa1

Change-Id: I3fa4dd88b143119aa5692a437a9da6e9aa535542
2017-09-21 03:26:18 +00:00
Nan Zhang
b88011768d Move private_manifest file insertion to jars merging phase.
By doing this, the change of private_manifest file won't trigger
Javac to re-run during re-build.

Bug: b/65455145
Test: m clean && m -j32
Change-Id: Ib90d56daf0be5f31b51e07b7714a933bc5cf4496
2017-09-20 14:56:48 -07:00
Nan Zhang
6cdb1f8bc7 Merge "Use merge_zips to merge jars during Java build in Make." am: 39bbfe217a am: d9001d2733
am: 177e7ffb20

Change-Id: I2178aa1eb4a0e74a3057758f4651ad569bdd6257
2017-09-20 20:00:46 +00:00
Nan Zhang
39bbfe217a Merge "Use merge_zips to merge jars during Java build in Make." 2017-09-20 19:48:27 +00:00
Nan Zhang
9bd540594d Use merge_zips to merge jars during Java build in Make.
1. Use merge_zips to merge jars without unzipping/rezipping static Java
libraries. And seperate merging process as a independent Make target so
that Javac can only depend on Turbine.

2. Remove duplicate vars: "full_java_lib_deps" in droiddoc.mk

3. Also use classes-header.jar for link_apk & link_instr

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

Change-Id: I7b0307664a6b86075c983284fce099bd3946318c
2017-09-19 18:49:33 -07:00
Colin Cross
1fe8e3c66d Merge "Move jacocoagent into the bootclasspath" am: 68dad73d34 am: a6af8ef91f
am: e9a7688567

Change-Id: I8941916da85a2c221c5ac7d6bb5217bd9b79baef
2017-09-18 20:32:10 +00:00
Treehugger Robot
68dad73d34 Merge "Move jacocoagent into the bootclasspath" 2017-09-18 19:57:53 +00:00
Nan Zhang
0d3dcc62c7 Merge "Move classes.jar generation right below JarJar phase." am: 729a221a16 am: 32fc9a5c46
am: 46010dda39

Change-Id: Iea2acd5e5fc736ef933b1d50e1ca39c7c7890e19
2017-09-15 22:47:03 +00:00
Colin Cross
69b7f3f0b1 Move jacocoagent into the bootclasspath
Move jacocoagent out of core-libart and into its own jar on the
bootclasspath.

Test: m -j EMMA_INSTRUMENT=true
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L19400000103297394&nodeType=Trybot
Change-Id: I9e6e3dc59dba8b93685d59b258d4ebc7835eab8b
2017-09-15 22:27:35 +00:00
Nan Zhang
870025f89b Move classes.jar generation right below JarJar phase.
By doing this, we don't need run desugar/Jacoco/proguard twice for
static java libraries(one for their self build, another for downstream
dependents).

Test: m clean && m java
Bug: b/65455145
Change-Id: I87aee34940937dbde33a977f55d1faf2c8054561
2017-09-14 14:44:40 -07:00
Nan Zhang
d1bbc2b26c Merge changes from topic "turbine" am: 872246de0f am: fa8b66f5cc
am: 5d52f85261

Change-Id: I6e71c2e2874bba64f2105c8cf26647ae5c9af25b
2017-09-01 00:37:45 +00:00
Nan Zhang
b3ec534bd1 Revert "Revert "Add Turbine as part of java build toolchain in Make.""
This reverts commit 33dcd0c5eb.

Reason for revert: <stub.jar.toc needs classes.jar.toc which is no longer existed after Turbine was introduced. So use classes.jar to represent stub.jar.toc>

Bug: b/64308460
Test: m clean && time m -j32 ANDROID_COMPILE_WITH_JACK=true
Change-Id: If618993f1e0c789d93cc15664212603f994fd460
2017-08-31 14:56:54 -07:00
Colin Cross
9a594e05af Remove GLOBAL_JAVAC_DEBUG_FLAGS
GLOBAL_JAVAC_DEBUG_FLAGS is no longer set, -g is already included
in the javac command line.  Jack is on its way out, just use -g
directly there for now.

Test: m -j checkbuild
Change-Id: Ib99c248bbb8b65fa2cd2b55449a502fc20deffa8
2017-08-31 14:48:31 -07:00
Nan Zhang
3b202bde3f Merge "Revert "Add Turbine as part of java build toolchain in Make."" am: 91ffbf2fbe am: 2c82a22d96
am: 40403cdded

Change-Id: Ib9a5a8506bb85b6582421ed20fa1c11d9aba4375
2017-08-31 20:47:54 +00:00
Nan Zhang
33dcd0c5eb Revert "Add Turbine as part of java build toolchain in Make."
This reverts commit 0739155c86.

Reason for revert: <sdk_google_aw_x86-sdk (linux) build 4310016 in git_master is broken>

Change-Id: I525d48557bd0425917e61a85f596663ccc63c887
2017-08-31 19:56:59 +00:00
Nan Zhang
672898977f Merge "Add Turbine as part of java build toolchain in Make." am: 0b23748128 am: 2764a16085
am: 3c30f84e2d

Change-Id: I3e42a07747ffb09b10ab07785d761ddc84574ae0
2017-08-31 18:25:44 +00:00
Nan Zhang
0739155c86 Add Turbine as part of java build toolchain in Make.
1. Bundle static_java_header_libs during turbine-classes.jar if
necessary. This can be improved if we have the ability to merge jars on
the fly.

2. Copy sdk/stubs-classes.jar to sdk/stubs-classes-header.jar, and Use
.KATI_RESTAT to cut un-necessary targets rebuilt.

3. Copy prebuilt-classes.jar to prebuilt-classes-header.jar since
Turbine doesn't apply to prebuilt.

4. Run jarjar after Turbine compilation, otherwise downstream targets
won't find corresponding symbols.

5. Change classes.jar in -classpath used in Desugar to
classes-header.jar.

6. Change legacy-libs in Proguard from classes.jar to
classes-header.jar.

7. Add .KATI_RESTAT for turbine-classes.jar, and remove IJAR.

8.boot.art is re-generated during the incremental rebuild since
javalib.jar got re-generated. Then boot.art re-triggered lots of
downstream targets to be rebuilt. So we add .KATI_RESTAT for javalib.jar
to prevent downstream to be rebuilt. The ziptime & commit-change-to-toc
operation for javalib.jar(small) didn't bring too much overhead when we build
from clean state.

Next step: specify static_java_header_libs in -classpath, and merge jars
at the end.

touch frameworks/base/core/java/com/google/android/util/Procedure.java &&
time m
time: 1m58s (794 -> 49 targets)

m clean && time m java
time: 9m34s

Bug: b/64308460

Test: m clean && m checkbuild

Change-Id: Iefcc234405b9f461b6882c06bba15e21fa783d28
2017-08-30 16:01:39 -07:00
Colin Cross
c1ca2cfbf4 Merge "Separate java source list generation into its own rule" am: f61712fbf1 am: bf386cafec
am: 1770c0cc2b

Change-Id: I4644762f6094922044c46be94ca5e368736db81a
2017-08-30 20:15:43 +00:00
Colin Cross
dfc45ec337 Separate java source list generation into its own rule
Move the java source list generation step into its own rule.  This
has a couple of advantages.  It consolidates the source list
generation so that it only has to run once for javac, jack, and
jack-check.  It also massively reduces the length of the javac
command line, so that error messages are significantly shorter,
and allows easily rerunning the failing build command because
the file list is still on disk.

The primary disadvantage is that javac error messages no longer
include the list of files passed to javac, but the list is
available earlier in the build long when the file list was written,
and is still available on disk.

Test: m -j javac-check
Change-Id: I9730b352b33a060e08221b61c11c617d23320d67
2017-08-29 16:50:11 -07:00
Narayan Kamath
bfd42129d3 Merge "dex_preopt: Use the unstripped jar file for generating profiles." into oc-mr1-dev
am: afb81de1f2

Change-Id: I1795eb230b2c3388b5c2daa8a710d6e1c678b418
2017-08-29 08:52:59 +00:00
Narayan Kamath
bbcdc07d12 dex_preopt: Use the unstripped jar file for generating profiles.
We were previously using LOCAL_BUILT_MODULE, which wouldn't work in the
case that "nostripping" wasn't specified (i.e when we stripped).

The issue is that the built module has its classes.dex entry stripped,
which means that profman can't do anything meaningful with it.

In this change, we use the right set of files for JAVA_LIBRARIES as well
as prebuilt PACKAGES. Fixing apps built from source is a larger task and
has been left for a future change. Depending on ART changes, we might
need to disable stripping for all apps and/or align userdebug and user
builds with each other. This will be tackled separately.

Test: make
Bug: 64896089
Change-Id: I4fd256d187b66763f354cc6001953469c2cd8fbb
2017-08-24 11:31:03 +01:00
Colin Cross
604a2423b6 Merge "Sort files in directories passed to jar"
am: 966ed15a1d

Change-Id: If01ba7d294e4308a28580b157b9efdb6c860bb35
2017-08-17 01:00:13 +00:00
Colin Cross
128800f2c8 Sort files in directories passed to jar
jar -C <dir> . produces a jar containing files in filesystem order,
which can vary between builds.  Manually find and sort the list of
files, and convert them into a list of -C <dir> <file> pairs.

Fixes: 64634025
Test: m -j checkbuild
Test: m -j out/target/product/sailfish/system/framework/ext.jar, check
      that entries are sorted
Test: m -j out/target/product/generic_arm64/system/framework/ext.jar on mac
Change-Id: I7dced6acbe621a60cd49daf17872941485602732
2017-08-16 13:37:00 -07:00
Colin Cross
4cea760106 Merge "Revert "Use dx.jar directly""
am: c7e3e962f8

Change-Id: Icd5402f7cc789224753537c070a91cbf6267ee66
2017-07-18 07:14:26 +00:00
Treehugger Robot
c7e3e962f8 Merge "Revert "Use dx.jar directly"" 2017-07-18 07:08:19 +00:00
Colin Cross
e44e75aa89 Revert "Use dx.jar directly"
This reverts commit e37a3c959a.

Reason for revert: breaks art test runner

Change-Id: Ice0cd3020ddec7f31eb789867a45f047a75a05d0
2017-07-18 05:22:59 +00:00
Colin Cross
4828fcad41 Merge "Use dx.jar directly"
am: c68434c971

Change-Id: Ief2c88d3ba0e93c7eb7bb9db0ac2b0a0b886bcea
2017-07-17 20:45:31 +00:00
Jeff Gaston
6264b662f3 Merge "Update to latest jacoco usage"
am: 483fae7430

Change-Id: Ibc94d5ba6db7690441825dd655b6cb26d989b78d
2017-07-17 20:44:10 +00:00
Colin Cross
c68434c971 Merge "Use dx.jar directly" 2017-07-17 20:40:13 +00:00
Jeff Gaston
483fae7430 Merge "Update to latest jacoco usage" 2017-07-17 20:36:39 +00:00
Colin Cross
06f8dec6e0 Merge "Fix LOCAL_JAR_PROCESSOR dependency"
am: 126e625fed

Change-Id: Ibe2786aa8853ea34513903728ae06fb5c5c39101
2017-07-14 23:10:57 +00:00
Jeff Gaston
aaae43cd24 Update to latest jacoco usage
Bug: 36792868
Test: EMMA_INSTRUMENT_STATIC=true m -j

Change-Id: I419b543283b52be9a72f5c6b10e4cbea68782174
2017-07-14 13:04:05 -07:00
Colin Cross
89b802b994 Fix LOCAL_JAR_PROCESSOR dependency
The LOCAL_JAR_PROCESSOR rule should depend on the path to the
processor jar and not the module name.

Test: m -j && m -j
Change-Id: I5ebd4cd3ad4429918edfd0a8cb5cb9a4e7e86ca7
2017-07-13 19:25:47 -07:00
Colin Cross
e37a3c959a Use dx.jar directly
Use $(JAVA) to invoke dx.jar instead of the dx wrapper script.
Also allow the dx command line or the dx jar to be specified on
the command line.  Allows better dependencies on dx.jar, and
doesn't rely on having java on the path.

Bug: 62956999
Test: m -j checkbuild
Change-Id: I5f265132690ad28b3139954fea44eb0c4a43393a
2017-07-07 13:34:33 -07:00
Przemyslaw Szczepaniak
8c485b6b0c Merge "Enable stripping of java debug information when required."
am: d659f806e5

Change-Id: I25facf64b176ae26db07d43cef92c522bf92e79a
2017-07-07 15:29:40 +00:00
Treehugger Robot
d659f806e5 Merge "Enable stripping of java debug information when required." 2017-07-07 15:24:32 +00:00
Przemyslaw Szczepaniak
2e81b3c49f Enable stripping of java debug information when required.
We're removing LocalVariableType / LocalVariableType in order to
save space. Enabling stripping reduces AOSP  image size save
by ~12MB.

Bug: 38224820
Test: CtsLibcoreTestCases
Change-Id: I3168d73ec6825aa5879db7e1135d7ed61d488d72
2017-07-06 08:31:14 +00:00
Colin Cross
e885ccf0df Merge "Provide make variables for java binaries"
am: 5e19557eb9

Change-Id: Ib1be7da98214e3b6c27867b80005e18cc68a0d33
2017-07-01 01:36:14 +00:00
Colin Cross
0851df8c82 Provide make variables for java binaries
Replace java -> $(JAVA), etc. to prepare for moving java binaries
out of the path and using full paths to them.

Test: builds
Bug: 62956999
Change-Id: I5dfcd0d4e855ecde69cd127169e9545e59723d12
2017-07-01 01:03:14 +00:00
Paul Duffin
b61544dd73 Merge "Add junit/textui/** to the proguard filter" am: 3b3bffc0d0
am: 5022a346c7

Change-Id: I5ba99c3e20a0aeee1c8a6c5bd6119a1615112cb5
2017-06-15 09:12:50 +00:00
Paul Duffin
54747a7f09 Add junit/textui/** to the proguard filter
Fixes build breakage caused by having duplicate versions of
a class in the application and in the API. This workaround will
be removed once junit classes have been removed from the API.

Bug: 30188076
Test: make Browser2 ANDROID_FORCE_JACK_ENABLED=disabled
Change-Id: I9a9031d3ef6d82f35413b229d588a605f9ed39dc
2017-06-15 08:42:23 +01:00
Colin Cross
a1b843c2b6 Merge "Add LOCAL_JAR_PROCESSOR" am: 9f52f0d17d am: abcbe9ab86
am: dcc9240a71

Change-Id: I21ecc09b9f5678746b8bb02056583f10e90e71ee
2017-05-23 02:12:43 +00:00
Colin Cross
f8a49c5a37 Add LOCAL_JAR_PROCESSOR
Allow using a host java library as an intermediate processor step
after javac but before desugar, proguard, or dx.

Test: manual
Change-Id: I7fb843e10d96c0167f6e4371582fabcc1454521f
2017-05-22 17:30:13 -07:00
Paul Duffin
29cdd2d433 Merge "Add c/a/i/u/* to the list of injar filters" am: 9198da8c21 am: 23eb5019bc
am: c4977665f1

Change-Id: I5673a8604c4fbfe4efaedd750863d5a757e33977
2017-05-15 15:54:51 +00:00
Paul Duffin
e949585a62 Add c/a/i/u/* to the list of injar filters
Previous change that moved com.android.internal.util.Predicate
to the legacy-android-test JAR caused a proguard build breakage
due to duplicate classes in the application and library. This
fixes it in the same way as previous issues with junit and
android.test classes were resolved by excluding those classes
from the application JAR.

Bug: 30188076
Test: make checkbuild and make -j ANDROID_FORCE_JACK_ENABLED=disabled checkbuild
Change-Id: Ica0089607187f970251ddba339a1f71d4cad80cc
2017-05-15 15:17:55 +01:00
Colin Cross
5730186686 Merge "Make javac checkbuilds match jack" am: cb8077df16 am: 9f1e58aab9
am: 2e2758b69d

Change-Id: I7d62da41492c2a4aae39d5f29b9b6086be9f58e6
2017-05-02 23:10:30 +00:00
Colin Cross
761d673df4 Merge "Support LOCAL_JACK_ENABLED := javac_frontend" am: 64ed2f2478 am: d6a3273faa
am: eb2457b89e

Change-Id: I98104d161dcc709a764cb86750d3217538863fdb
2017-05-02 18:15:12 +00:00
Colin Cross
9eff830fa2 Make javac checkbuilds match jack
Building all java to dex is very slow.  Make javac checkbuilds act
like jack checkbuilds and only build to class files for unused
modules, and add a java-dex target that can be used to build
everything to dex.

Test: m -j checkbuild
Change-Id: Idcf9c9e0223b9dd88aaa53beb0cb50a230034b0f
2017-04-28 13:39:16 -07:00
Colin Cross
b17f285169 Support LOCAL_JACK_ENABLED := javac_frontend
Allow working around Jack bugs by using javac to compile *.java
to class files, and then pass through Jack for desugaring,
proguarding, and dexing.

Also make ANDROID_COMPILE_WITH_JACK=false override LOCAL_JACK_ENABLED.

Bug: 37483961
Test: m -j checkbuild
Test: Add LOCAL_JACK_ENABLED := javac_frontend to a target
Change-Id: I2189055aac9deccc36b8eab8e949796dddadf7a1
2017-04-28 13:39:12 -07:00
Colin Cross
bb7ba04031 Merge "Filter and colorize javac output V3" am: c8387929d1 am: f4ef1db272
am: 2f1488ae86

Change-Id: I73b5ca7a919c299aa062e5814f9f6b165f8c6527
2017-04-18 23:13:27 +00:00