Commit graph

468 commits

Author SHA1 Message Date
Colin Cross
e4936e1c2d Remove obsolete proguard options
LOCAL_PROGUARD_ENABLED := shrinktests is never set.
proguard_tests.flags is entirely comments.
proguard.emma.flags only references emma classes, but we use
jacoco now.

Test: m checkbuild
Change-Id: I84a59a8c1b66f75d7ccbaa7da8e937430b4490c8
2017-12-28 17:22:30 +00:00
Dan Willemsen
1d64623105 Export proguard flags from static android libraries and aar prebuilts
Test: m Contacts, classes-proguard.jar has same contents
Test: rm -rf out; tapas Contacts; m
Change-Id: Id7a92fb2c44913bccbfcbeae127355b4de588e4d
Merged-In: Id7a92fb2c44913bccbfcbeae127355b4de588e4d
(cherry picked from commit 1417c177ac)
2017-12-28 17:22:19 +00:00
Treehugger Robot
5ded399588 Merge changes I63eace8f,I103cbe58
* changes:
  Remove obsolete leaf names
  Remove obsolete dx --no-locals when coverage is enabled
2017-12-21 20:49:03 +00:00
Alan Leung
5eb88c0112 Add zip2zip as dependency of dexing step.
Bug: 69329508
Test: m checkbuild
Change-Id: I85f4508b6b1fee357d296bda6f0b6ba02cba70b7
2017-12-20 20:03:58 -08:00
Colin Cross
a6e878219c Remove obsolete leaf names
classes-no-debug-var.jar is incorrect, jars in coverage builds
do have debug information.  Remove full_classes_compiled_jar_leaf
and hardcode classes-full-debug.jar.

After the previous patch, all dex files have debug information,
so remove the no-local and with-local directories and replace
them with dex/.

Remove the unnecessary jarjar_leaf.

Bug: 70886092
Test: m checkbuild
Change-Id: I63eace8f8cda5ad8bc0cbd11eefda73dd063ed76
2017-12-20 17:33:01 -08:00
Colin Cross
ff812829b6 Remove obsolete dx --no-locals when coverage is enabled
We use jacoco for coverage now instead of emma, so the workaround
is no longer necessary.

Bug: 70886092
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false
Change-Id: I103cbe58590689640a0b1520d22b3d3b7cd2208d
2017-12-20 17:03:52 -08:00
Treehugger Robot
973301af79 Merge "Replace build/tools with build/make/tools" 2017-12-13 02:34:42 +00:00
Alan Leung
eaafb3cd37 Add USE_D8_DESUGAR option in build/core
Add an option to use D8's desugar instead of the standalone version.

USE_D8_DESUGAR=true m would trigger DCHECK in dex2oat unless
https://android-review.googlesource.com/c/platform/art/+/562595 is
patched in as well.

Bug: 69329508
Test: m && USE_D8_DESUGAR=false m

Change-Id: I601dada44c361e45bbc0e2227ae1544a7d9efa90
2017-12-11 14:03:09 -08:00
Colin Cross
fdea893833 Replace build/tools with build/make/tools
Test: m checkbuild
Change-Id: I8db6c27a6d2372f142d10568fe92d6f2e9a59252
2017-12-06 16:12:40 -08:00
Sundong Ahn
f3e8302088 Add LOCAL_SDK_VERSION := system_$(VER)
am: 5a44d1f069

Change-Id: Ief08f78484b654502d356c07d61063a16aad0572
2017-12-01 04:26:10 +00:00
Sundong Ahn
5a44d1f069 Add LOCAL_SDK_VERSION := system_$(VER)
The system_$(VER) can be set in LOCAL_SDK_VERSION, and the apk will use
android_system.jar at build time.
If LOCAL_SDK_VERSION is not defined and this module is installed in
vendor.img, LOCAL_SDK_VERSION is set to system_current.

Bug: 67724799
Test: 1. build && run on taimen
2. LOCAL_SDK_VERSION:=system_27 in ims.apk && build ims.apk && check
the vsdk_v27_intermediates.

Merged-In: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
(cherry picked from commit ef212cbe8d)
2017-12-01 00:39:07 +00:00
Tobias Thierer
ea43e16f60 Merge "Tweak comments for OpenJDK 9 build toolchain logic."
am: 2655e57bbb

Change-Id: I13b9520e95365dc2669d7a0c4832a322b7efca84
2017-11-17 18:25:32 +00:00
Tobias Thierer
7ef760b832 Tweak comments for OpenJDK 9 build toolchain logic.
This addresses review comments on the preceding CL
http://r.android.com/539055

Test: Treehugger
Change-Id: Icb0674190db3d638546a0ed49dbcb97d0698e549
2017-11-17 15:35:59 +00:00
Tobias Thierer
4ffaa14478 Merge "Break EXPERIMENTAL_USE_OPENJDK9 into {USE,TARGET}_OPENJDK9."
am: 446c9ba370

Change-Id: I0254955fa16e8b35396f9f350c961031272c6583
2017-11-17 15:19:30 +00:00
Tobias Thierer
f6bd495728 Break EXPERIMENTAL_USE_OPENJDK9 into {USE,TARGET}_OPENJDK9.
This CL topic breaks the single flag value EXPERIMENTAL_USE_OPENJDK9
into two flags USE_OPENJDK9 and TARGET_OPENJDK9 which are computed
independently in config.mk and config.go; this means that later
build logic no longer depends on / duplicates the semantics of an
unset EXPERIMENTAL_USE_OPENJDK9, because that later build logic
can use USE_OPENJDK9 and TARGET_OPENJDK9 instead. Thus, it becomes
slightly easier to change this default in future CLs (touching
only config.mk and config.go).

It also makes it more straightforward to convert .mk files
to .bp.

This CL also introduces a new allowed value "false" for
EXPERIMENTAL_USE_OPENJDK9. This fourth possible value currently
has the same semantics as a default/unset
EXPERIMENTAL_USE_OPENJDK9, but allows people to explicitly
switch back to the old semantics when the default changes.

Test: make showcommands core-oj (in environments with
      EXPERIMENTAL_USE_OPENJDK9 set to "", "1.8", and "true").
Bug: 38177295

Change-Id: Iaade9610b237722e5d175143808b8653b1e98996
2017-11-17 13:14:11 +00:00
Alan Leung
4eee474504 Merge "Rename r8 to r8-compat-proguard"
am: 81eeb78200

Change-Id: Ibe7c114115f627ae3f061f8087b93891af475e40
2017-11-17 03:15:09 +00:00
Alan Leung
7d6144d34b Rename r8 to r8-compat-proguard
Test: USE_R8=false USE_D8=true m -j32 && USE_R8=true USE_D8=true m -j32

Change-Id: I2610340cf75f8db5920e33fac542f0dcf294ce29
2017-11-16 17:24:01 -08:00
Xin Li
44dd4881de Merge commit '66b8b530187b129934a685bf0c4349eef00e4b0c' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: I7594bb72dd7e847292eb502edd918e41318aac29
Merged-In: Ide82473d358719f7e01cd2a4a85db954f3722f14
2017-11-14 11:36:22 -08:00
ShuJie Wang
76e93ba6cf build: clean up proguard_flag_files
we should clean up proguard_flag_files if LOCAL_PROGUARD_ENABLED
not defined in current module in case legacy proguard_flag_files
slips into current jack_all_deps dependencies.

Test: make -j8

Change-Id: I45618fc8e821ab7a8b964fa621824209e1e9894c
Signed-off-by: ShuJie Wang <wangshujie@xiaomi.com>
2017-11-09 15:26:28 +08:00
Søren Gjesse
c66d297e0a Use prebuild R8 for USE_R8=true
Instead of building R8 from external/r8 use the prebuild jar in
prebuilds/r8.

Test: m -j USE_R8=true

Change-Id: I9680ae430cdbc2b3beb910873c8eed27354f6af1
2017-11-07 16:21:50 +01:00
Tobias Thierer
89740664a5 Skip Proguard for EXPERIMENTAL_USE_OPENJDK9=true
Proguard doesn't support v53 class files. For now, this
CL simply replaces the Proguard step with a plain 'cp',
which is essentially a no-op.

To avoid apps exceeding the dex limit in this mode, this
CL also enables --multi-dex for those builds.

Test: Treehugger
Bug: 67673860
Change-Id: I17dc5d827360d606a0cac12e324f97e8dedbb630
2017-10-31 21:02:14 +00:00
Colin Cross
0239edea1d Merge changes I3bafbb2d,If30943ef
* changes:
  Desugar default methods if required
  Fix desugaring when LOCAL_SDK_VERSION is not set
2017-10-27 01:40:15 +00:00
Colin Cross
98caed6e7f Fix desugaring when LOCAL_SDK_VERSION is not set
When LOCAL_SDK_VERSION is not set, frameworks.jar is put
in the classpath for javac.  If it is also in the classpath
(as opposed to the bootclasspath) for desugar then desugar
tries to rewrite classes that implement interfaces with
default methods to contain calls to the generated companion
classes for those interfaces.  frameworks.jar will not
contain the companion classes, which causes proguard to
fail.

Move frameworks.jar to the bootclasspath, which matches more
closely with builds against the SDK stubs jars.

Also remove the static libraries from the classpath, they have
already been merged into the input jar.

Test: m checkbuild
Change-Id: If30943efcaea44b2db1b38a6c1d558113324757f
2017-10-26 13:09:07 -07:00
Søren Gjesse
2f05802a78 Merge "Define proguard dictionary output for R8" 2017-10-26 06:08:43 +00:00
Colin Cross
437bbed858 Merge changes I81796b45,Iaf585336
* changes:
  Desugar default methods if required
  Always raise proguard libraries
2017-10-25 21:44:18 +00:00
Søren Gjesse
4ab5b02e62 Define proguard dictionary output for R8
When running with R8 instead of Proguard + dx the proguard mapping is
produced together with the dex output.

Bug: 68249935
Test: m -j ahat-test
Change-Id: Ica5ef455eb3bd1eabe55c43e9e026f47cadace1c
2017-10-25 17:16:53 +02:00
Colin Cross
b5f25a257f Always raise proguard libraries
The platform build system doesn't have the concept of a "compile sdk
version", it uses the "min sdk version" throughout the compilation
process.  This means that no stage of the compilation process can
introduce references to APIs that do not exist in the selected
LOCAL_MIN_SDK_VERSION without causing problems.  Support library
worked around this by effectively making the "compile sdk version"
"current" when running proguard if support library was in the direct
dependency list.

Extend the support library hack everywhere, and always use "current"
or the full bootclasspath when running proguard.

Test: m checkbuild
Change-Id: Iaf5853361767f0ea3e9ad4ec908aadd72d639c79
2017-10-24 13:29:36 -07:00
Søren Gjesse
0c1fe64ce8 Added support for using R8 instead of Proguard + dx
With this change building with USE_R8=true will run R8 instead of Proguard + dx
for all targets that have LOCAL_PROGUARD_ENABLED set. R8 (through the
compatproguard wrapper) will use the same options as Proguard for now.

Additional Proguard configurations for R8 can be added using LOCAL_R8_FLAG_FILES
on individual targets. This makes it possible to make configuration updates
without touching the Proguard + dx configuration

Test: m -j
Test: m -j USE_D8=true USE_R8=true
Test: m -j USE_D8=true USE_R8=false
Test: m -j USE_D8=true
Change-Id: I78e8a0fd17cc5cefedccffe95b93c94a60a727f1
2017-10-23 08:58:30 +02:00
Colin Cross
c5122aee9d Merge "Use system modules generated by soong when using javac -target 1.9" am: 58cd98dc47 am: 7c381d8015
am: 3541a96d76

Change-Id: I70c1cabb3fe7f3c34c54d9b360259229d7bb6243
2017-10-17 18:57:03 +00:00
Colin Cross
f960257c14 Use system modules generated by soong when using javac -target 1.9
Soong has support for building system modules.  Use the directories
produced by Soong with --system to replace -bootclasspath arguments
when using javac -target 1.9.

Since soong can't generate current SDK stubs yet, and no existing
SDK stubs need -target, only use -target 1.9 for modules that are
not compiling against the SDK.  That means in practice the only
system modules that will be used for now is the default one,
core-system-modules.

Bug: 63986449
Test: m -j EXPERIMENTAL_USE_OPENJDK9=true makes some progress
Change-Id: I350ef50aedf36fdd72458c23d4fe8a2edf1a9a02
2017-10-16 17:55:24 -07:00
Nan Zhang
29d28e58fb Merge "Support java compilation sharding for target side." am: 60e1f8ee27 am: 72165e0c29
am: bbc5a69fc5

Change-Id: I8c65cdeb4d1fc37f86a44c82f82bfe1a10440667
2017-10-13 07:31:27 +00:00
Nan Zhang
ad818dcbea Support java compilation sharding for target side.
Add "LOCAL_JAVAC_SHARD_SIZE" to represent the number of java
source path entries in each shard.

Sharding is not allowed when "LOCAL_JAVAC_SHARD_SIZE" and
"LOCAL_JAR_PROCESSORS" are both enabled.

Limitation:
1. 0 <= LOCAL_JAVAC_SHARD_SIZE <= 8192
1. 0 < NUM(java_sources) <= 8192
2. 0 <= NUM(shards) <= 100

Performance Compare:
<Unsharded Build------------------------------------------------>
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	1m2.720s user	5m26.604s sys	0m39.552s

2. Incremental build
m out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar &&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java && time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	0m37.586s user	5m47.804s sys	0m50.388s

<Sharded Build-------------------------------------------------->
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50----real	1m10.163s user	25m59.008s sys	1m58.460s
Javac Shard Size: 100---real	1m2.115s user	21m3.600s sys	1m15.964s
Javac Shard Size: 150---real	0m59.520s user	18m10.544s sys	1m12.628s
Javac Shard Size: 200---real	0m56.894s user	15m39.244s sys	1m11.608s
Javac Shard Size: 250---real	0m55.991s user	14m38.716s sys	1m2.292s
Javac Shard Size: 300---real	0m55.114s user	13m6.568s sys	1m8.200s
Javac Shard Size: 350---real	0m53.144s user	12m7.740s sys	1m3.836s
Javac Shard Size: 400---real	0m54.929s user	12m9.324s sys	1m4.340s
Javac Shard Size: 450---real	1m30.194s user	25m31.468s sys	1m52.416s
Javac Shard Size: 500---real	0m53.976s user	10m35.500s sys	0m55.160s

2. Incremental build
m out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar &&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java && time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50-----real	0m16.322s user	1m8.648s sys	0m31.700s
Javac Shard Size: 100----real	0m16.163s user	1m22.932s sys	0m29.440s
Javac Shard Size: 150----real	0m16.611s user	1m37.828s sys	0m21.168s
Javac Shard Size: 200----real	0m16.936s user	1m49.248s sys	0m28.636s
Javac Shard Size: 250----real	0m17.509s user	1m54.944s sys	0m32.768s
Javac Shard Size: 300----real	0m18.868s user	1m54.088s sys	0m28.824s
Javac Shard Size: 350----real	0m17.629s user	1m54.108s sys	0m31.056s
Javac Shard Size: 400----real	0m18.658s user	2m7.712s sys	0m30.636s
Javac Shard Size: 450----real	0m18.874s user	2m8.808s sys	0m33.540s
Javac Shard Size: 500----real	0m19.432s user	2m24.400s sys	0m30.368s

time m nothing:
real 0m5.799s user 0m7.236s sys 0m3.068s

Test: m clean && m -j checkbuild
Bug: b/67424047
Change-Id: Id0766d2b7de7c4546d29bbc7f8a0dd0e4b9ad45b
2017-10-12 13:23:06 -07:00
Treehugger Robot
b039cf792f Merge "Delete jack support" 2017-10-03 01:17:25 +00:00
Dan Willemsen
4def685881 Merge changes I7b2fc184,I71f6fcaf am: ea655a138f am: cd4d0d4cc3
am: 6da385ffe4

Change-Id: I4f4059752411a213f84f51c2d11726f9b4fda1b2
2017-10-02 21:05:59 +00:00
Dan Willemsen
cd4d0d4cc3 Merge changes I7b2fc184,I71f6fcaf
am: ea655a138f

Change-Id: Icd7c2390a0a35777bda0a93af534d6a4254fff9b
2017-10-02 20:46:14 +00:00
Colin Cross
69ced5de5e Delete jack support am: a6bc3a8a4c
am: 37bf2b1250

Change-Id: I19133aedbfe91f7cd49588b33f517dc4bb17b91c
2017-10-02 20:00:16 +00:00
Colin Cross
e673deb280 Delete jack support
Remove all support for running jack.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
2017-10-02 11:15:19 -07:00
Colin Cross
a6bc3a8a4c Delete jack support
Remove all support for running jack.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
2017-10-02 18:06:56 +00:00
Dan Willemsen
4d99527dcd Move generated aidl/logtags java classes to a subfolder
So that they can't be generated into src/, which would be added to the
source list automatically.

Bug: 36698184
Test: m telephony-common without this change, pass
Test: m telephony-common without the cleanspec, fail with dup class
Test: m telephony-common with the cleanspec, pass
Change-Id: I7b2fc1847d52ff4a9ba8c69e76123fe152629ef8
2017-09-29 20:36:50 -07:00
Colin Cross
e3248f5eef Merge "Respect LOCAL_MIN_SDK_VERSION for dx" am: a426e0e974 am: bf7020608f
am: 01b57501d8

Change-Id: I7ac0abdd8ee4a0fe0d4d60f05a967efcbbc59688
2017-09-29 20:28:23 +00:00
Colin Cross
9deb331f20 Respect LOCAL_MIN_SDK_VERSION for dx
Follow Jack's behavior for now and pass LOCAL_MIN_SDK_VERSION to
dx.  Don't pass it to desugar for now, desugar with low
--min_sdk_version numbers enables features we haven't verified
yet, and existing apps won't be using the new language features
that require extra desugaring.

Test: examine classes.dex from an app with LOCAL_MIN_SDK_VERSION
Change-Id: Ic7d679b1b11fba98a33418a4f79d4762a91f1f9c
2017-09-28 21:40:35 -07:00
Colin Cross
ec346cf1fd Merge changes I06179fca,Ie48746c8,Ia47ebc95 am: b182ea7bcb am: 2c717745b2
am: 1e7f83bf49

Change-Id: I538de57657bfc334dc6d3d24b22baccb01d9b0d5
2017-09-27 02:48:39 +00:00
Treehugger Robot
b182ea7bcb Merge changes I06179fca,Ie48746c8,Ia47ebc95
* changes:
  Disable turbine for unbundled builds
  Allow disabling turbine
  Simplify the *-lib-* functions
2017-09-27 02:36:24 +00:00
Colin Cross
7dc9043546 Allow disabling turbine
m -j TURBINE_ENABLED=false will build without turbine.  This is
primarily useful for A/B comparisions of turbine builds, but will
also be used to temporarily disable turbine for unbundled builds
until we have turbine prebuilts.

Bug: 64308460
Test: m -j TURBINE_ENABLED=false java
Test: m -j java
Change-Id: Ie48746c8bfc60c361be9634cb1805ca1c09aa1fe
2017-09-26 16:23:00 -07:00
Dan Willemsen
f031150a03 Merge "Only define proguard dictionary as output if obfuscating" am: 96a782f1ea am: 13c0785b09
am: 73acd38175

Change-Id: Iea98bc51e8dbeba0cb15ec460d5dda9db481b133
2017-09-26 21:55:49 +00:00
Treehugger Robot
96a782f1ea Merge "Only define proguard dictionary as output if obfuscating" 2017-09-26 21:45:28 +00:00
Dan Willemsen
bdd6a756d1 Only define proguard dictionary as output if obfuscating
If we're not obfuscating, proguard doesn't generate the mapping file,
and ninja will consider the edge dirty, since one of the output files
does not exist.

Also disable it for jack, since jack writes to a different file.

Bug: 66929996
Test: m cts; m cts
Test: m ahat-test with a clean build
Change-Id: Iff6707c44cbd86cd9328bbad8322398bc9d960fd
2017-09-26 13:01:49 -07:00
Colin Cross
b0d243f336 Merge changes from topic "bootclasspath_default_libs" am: e58881ac38 am: df0c2fd298
am: 665dce738a

Change-Id: Ieb69b355cc0ad74af7ea58ccbbdb36254633f05d
2017-09-26 01:27:26 +00:00
Colin Cross
8547be2e38 Add dependencies on bootclasspath libraries am: 1d1e5ef61b am: fa4d9fbfdd
am: c70fcc848c

Change-Id: I0572197334015acc14bc2f43031ba3467228171a
2017-09-26 01:27:18 +00:00
Colin Cross
b541aae17c Remove duplication of bootclasspath in LOCAL_JAVA_LIBRARIES
The bootclasspath libraries have direct dependencies now, so
remove them from LOCAL_JAVA_LIBRARIES so they don't also end
up in the classpath.

Test: m -j checkbuild
Test: m -j ANDROID_COMPILE_WITH_JACK=true java
Test: manually inspection of build-${TARGET_PRODUCT}.ninja
      only has expected changes
Test: no changes to system.img
Change-Id: Icbc8987468f237aa351708b33c3abe5ea3d1816e
2017-09-25 16:15:10 -07:00