Commit graph

603 commits

Author SHA1 Message Date
Colin Cross
e46727a2ba Run ErrorProne in OpenJDK9
Run ErrorProne as a processor in javac from OpenJDK9.

Bug: 69485063
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I2dde597430b47c440df22d248809233a6ade1625
2018-06-20 18:49:50 -07:00
Colin Cross
b71570fc8c Merge "Revert "Revert "Remove desugar support""" am: 50ad8c97ac
am: 9f0e4a430f

Change-Id: I8ef7ec33394af7fd7afab4455f79a932ee774b92
2018-06-07 15:49:03 -07:00
Colin Cross
8bd764fc7a Merge "Revert "Remove desugar support"" am: bc965aa7a9
am: d175a15e0e

Change-Id: Ie7b75adc17b93d7a5dd6c288dcb3e7adc4b676df
2018-06-06 16:26:07 -07:00
Colin Cross
f44ef3af81 Merge "Remove desugar support" am: 541782f2b4
am: 2d744245a6

Change-Id: I62911d24463cf9c508eee0c5ffca1ebd6b4386f0
2018-06-06 15:25:22 -07:00
Colin Cross
cf010858b6 Revert "Revert "Remove desugar support""
This reverts commit cf7407ed61.

Reason for revert: includes art veridex fix this time

Change-Id: I970b51e6a6c6f377cfe793f029d9674e7ee0ed15
2018-06-06 21:46:25 +00:00
Colin Cross
cf7407ed61 Revert "Remove desugar support"
This reverts commit bfad2c070c.

Reason for revert: broke art veridex build

Change-Id: I0dcc34102ee18b054c2247ae0e2698aca645c667
2018-06-06 21:42:21 +00:00
Colin Cross
bfad2c070c Remove desugar support
Desugaring is always handled by d8 now.

Test: m checkbuild
Change-Id: I8af88522fb1280854ebb4e4957faf70ab59a74f4
2018-06-06 10:06:07 -07:00
Colin Cross
a72f7db2eb Merge "Revert "Work around incorrect R8 proguard compatibility"" am: 43aea42876
am: 9200928f8c

Change-Id: I85598e4a79220ba5b13350d4a42c3e7ce89be63e
2018-06-05 14:02:33 -07:00
Colin Cross
c8148cc001 Revert "Work around incorrect R8 proguard compatibility"
This reverts commit cf5180c198.

Reason for revert: r8 behaves more like proguard now.

Bug: 80081393
Test: m checkbuild
Test: examine attributes on com.android.stk.BootCompletedReceiver
      in out/target/common/obj/APPS/Stk_intermediates/classes.dex

Change-Id: I6cff1d7cb6b71023399db6492455f69328dd73f3
2018-06-04 17:25:56 +00:00
Colin Cross
b17a2ca7b7 Merge changes I9b67fd2a,I761f2d06 am: bcc94297e0
am: 60c80c4323

Change-Id: I6bf68590481fbd9ef6137d8c6747e8eb3f98e1a2
2018-05-25 13:46:03 -07:00
Colin Cross
cf5180c198 Work around incorrect R8 proguard compatibility
Proguard treats -dontobfuscate -keepattributes *Annotations* the
same as -dontobufscate by keeping all attributes.  R8, even in
proguard compatibility mode, discards all attributes that don't
match, including EnclosingClass attributes that may be necessary.
Pass -keepattributes * whenever passing -dontobfuscate to make R8
act more like proguard.

This isn't a complete solution, some modules may set
LOCAL_PROGUARD_ENABLED := custom and then manually specify
-dontobfuscate on the command line or in a flags file, in which
case they will see the incorrect behavior of R8.

Bug: 80081393
Test: m checkbuild
Test: examine attributes on com.android.stk.BootCompletedReceiver
      in out/target/common/obj/APPS/Stk_intermediates/classes.dex

Change-Id: I761f2d0617c5295df8fc7adfc4fd00d2aa41961e
2018-05-25 11:34:13 -07:00
Colin Cross
92e9d334ae Merge "Allow forcing AAPT2 on" am: 2b42ae8076
am: 7795002bcf

Change-Id: Ic2b3c8841f56f7f4315ba261d53fcbc5594535cc
2018-05-14 18:12:03 -07:00
Colin Cross
a3e54cd24d Merge changes Ie3d4536b,If2504b7d,I411844fb am: fc56b59db4
am: d3a1fa618f

Change-Id: Id5b5b7d398f4ee2c2acbca24f169728ae940cc61
2018-05-10 22:36:19 -07:00
Colin Cross
2029903b64 Allow forcing AAPT2 on
Building with FORCE_AAPT2=true will turn on AAPT2 for all modules
unless they set LOCAL_USE_AAPT2 := false.  The build system will
attempt to rewrite common AAPT patterns into AAPT2 patterns,
including removing --extra-packages for support library packages,
removing LOCAL_RESOURCE_DIR point to support library resources,
adding a default empty manifest file if it doesn't exist, and
converting LOCAL_STATIC_JAVA_AAR_LIBRARIES to
LOCAL_STATIC_ANDROID_LIBRARIES.

Bug: 79481102
Test: m checkbuild
Change-Id: I8d9d55fe4d5d5c965c64b0407efe74e0afc35c3a
2018-05-11 02:23:20 +00:00
Colin Cross
c27df2b71b Fix a missed rename to my_proguard_sdk_raise
Patch Iaf5853361767f0ea3e9ad4ec908aadd72d639c79 missed one rename
of my_support_library_sdk_raise to my_proguard_sdk_raise.

Test: m checkbuild
Change-Id: Ie3d4536bd80654a7eb4f209ef6d6a8de502a6cdc
2018-05-11 02:23:07 +00:00
Anton Hansson
65b0210fd0 Merge "Update make rules to use new android.jar location." am: a22472315f
am: 636d569336

Change-Id: Ibed1095363d49ff5d8ad321392b2419594a3715c
2018-04-30 05:29:52 -07:00
Anton Hansson
66d47b884e Update make rules to use new android.jar location.
This file has been copied into a 'public' subdir. Use that, so that
the old file can be deleted. Also introduce a new macro to avoid
duplicating this path in a bunch of places.

Bug: 77525052
Test: m checkbuild
Change-Id: Ifcf59c6fb357769b2765e417c8dd56d2ad9b97aa
2018-04-27 16:39:44 +01:00
Anton Hansson
703ab28b58 Merge "Switch make over to use the new prebuilt modules." am: 2944c11b1f
am: 424ee8d748

Change-Id: I25e8350db92ad48b848a9bd364fdb4aff1f3c473
2018-04-19 02:01:27 -07:00
Anton Hansson
9235faa9a4 Switch make over to use the new prebuilt modules.
There are a couple more places throughout the tree that use the old
modules, and I will update those next before deleting the old module
definitions.

Bug: 77525052
Test: make droid
Change-Id: I9385ae34cc1646cbd4e249d9e96a0116296f139a
2018-04-18 16:15:05 +01:00
Søren Gjesse
6e65019a45 Merge "Keep the collected Proguard configuration" am: 0c2a796853
am: a246c6a84a

Change-Id: I2eae581750bdb3fa51649c7b130e3169fa80877f
2018-04-17 00:13:15 -07:00
Søren Gjesse
9fbdd9ec5a Keep the collected Proguard configuration
This will work for both R8 and Proguard

Test: m -j Settings && "manually check .../proguard_coniguration file"
Change-Id: I1da7c3426b3511e2d5ad69852da8cec3245d7e54
2018-04-16 09:16:35 +02:00
Anton Hansson
395092db03 Merge "Consolidate the logic for the sdk prebuilt module names." am: 9b72b53a24
am: 762e03ad41

Change-Id: I79ba2766028f2f26836a3a6d99eb5e8311f31921
2018-04-11 02:27:37 -07:00
Anton Hansson
400673cf1e Consolidate the logic for the sdk prebuilt module names.
I'm making some changes to it, and found the names are scattered
in various places. Make a macro and re-use the logic instead.

Bug: 77525052
Test: make droid
Change-Id: I0f2da80b8b4d427353509b27ec720d024eee7a6e
2018-04-10 18:53:30 +01:00
Jeff Gaston
e7479b7c5d Merge "Run jetifier against prebuilts directly rather than classes.jar" into pi-dev
am: 51eff801ad

Change-Id: I8d2f4aa6739a908a0591384121686976cb6516c8
2018-03-30 22:02:10 +00:00
Jeff Gaston
db6557e490 Run jetifier against prebuilts directly rather than classes.jar
It turns out that the resource files inside the .aar files may
need rewriting too

Bug: 72552006
Test: Set LOCAL_JETIFIED_ENABLED for a prebuilt and built it
      See also one of the patches after this one and its topic
      which contains a sample for testing
Change-Id: I89d0b4aa8d5c6ae3abc2344dd05222cf9672d5c0
(cherry picked from commit ed170e7296)
2018-03-28 23:00:02 +00:00
Colin Cross
3d480add49 Merge changes I54b8ec9c,Ibef28507,Ia858de22,Ide3050ec,Ib6e00be4, ... into pi-dev
am: 8060af2e78

Change-Id: I0936c8e8d0f0b9da22d20eb8afed0bbff56af81a
2018-03-21 20:26:56 +00:00
Colin Cross
8a33456e7d Move aapt2.mk before java.mk
aapt2.mk will export a srcjar that will be compiled by java.mk, so
it needs to be evaluated first.  Also move java_renderscript.mk
before aapt2.mk so that the generated resoures are available.

Bug: 73885582
Test: m checkbuild
Test: rm -rf out/target/common/obj/APPS/RsHelloCompute_intermediates &&
      m out/target/common/obj/APPS/RsHelloCompute_intermediates/src/R.stamp
Change-Id: Ide3050ec993a945f7077b75e952c3b3532306ede
Merged-In: Ide3050ec993a945f7077b75e952c3b3532306ede
(cherry picked from commit 8528eabbba)
2018-03-20 15:47:45 -07:00
Colin Cross
b4ee77aefb Move java renderscript support to java_renderscript.mk
Move java renderscript support to java_renderscript.mk in
preparation to moving it before aapt.  Filter *.rs files
out of LOCAL_SRC_FILES and forbid them in java_common.mk
so that using *.rs files is an error if java_renderscript.mk
was not included.

Bug: 73885582
Test: m checkbuild
Change-Id: Ib37ce89daee58b025dec98f733c5a08149641afd
Merged-In: Ib37ce89daee58b025dec98f733c5a08149641afd
(cherry picked from commit 71822d6fb9)
2018-03-20 15:47:45 -07:00
Colin Cross
ec7be103d0 Use srcjar and resource zip as output of renderscript rules
Replace RenderScript.stamp with a srcjar, with a resource zip as
an implicit output.  This makes the renderscript rules self contained,
which will make it easier to move them before aapt.

Bug: 73885582
Test: m checkbuild
Change-Id: I12d33e52019aebac6ea33271939228e4690a4173
Merged-In: I12d33e52019aebac6ea33271939228e4690a4173
(cherry picked from commit e00e2fae52)
2018-03-20 15:47:45 -07:00
Colin Cross
a73ea16f95 Replace extract_srcjars.sh with zipsync
Use zipsync instead of extract_srcjars.sh.

Also fixes an issue where unzipping a resource zip would
ignore anything that wasn't a *.java file.

Bug: 73885582
Test: m checkbuild
Change-Id: I1c25f65afa196614879071c8655866febebac185
Merged-In: I1c25f65afa196614879071c8655866febebac185
(cherry picked from commit 3f99cd5933)
2018-03-20 15:47:45 -07:00
Colin Cross
f13eb55448 Add LOCAL_SRCJARS support
Allow java modules to take jars containing .java files as an input.
For turbine, pass them directly to turbine.  For javac, extract them
to a directory and pass a list of the files to javac.

Bug: 73885582
Test: m checkbuild
Change-Id: Ib4351a5b4b165a55e5fb02ee2680466db368983a
Merged-In: Ib4351a5b4b165a55e5fb02ee2680466db368983a
(cherry picked from commit 11e2d55c0f)
2018-03-20 15:47:45 -07:00
Colin Cross
ecabf53bee Remove unused .fs file suppport
.fs files are obsolete.

Bug: 73885582
Test: m checkbuild
Change-Id: I74b618099333fe565c7b235994be64e6466d2da6
Merged-In: I74b618099333fe565c7b235994be64e6466d2da6
(cherry picked from commit 93d6550c53)
2018-03-20 15:47:45 -07:00
Colin Cross
35e31b65bd Remove sharding support from make
Sharding is not used in make any more, the large java modules
(libcore and framework) have moved to Soong.  Keeping sharding
support complicates java compiling, so remove it.

Bug: 73885582
Test: m checkbuild
Change-Id: I2932f9e96bfc8f2ebf82095b16d6c0b3c51613f0
Merged-In: I2932f9e96bfc8f2ebf82095b16d6c0b3c51613f0
(cherry picked from commit 5ef6e79c21)
2018-03-20 15:47:45 -07:00
Colin Cross
7a28158b90 Move aapt2.mk before java.mk
aapt2.mk will export a srcjar that will be compiled by java.mk, so
it needs to be evaluated first.  Also move java_renderscript.mk
before aapt2.mk so that the generated resoures are available.

Bug: 73885582
Test: m checkbuild
Test: rm -rf out/target/common/obj/APPS/RsHelloCompute_intermediates &&
      m out/target/common/obj/APPS/RsHelloCompute_intermediates/src/R.stamp
Change-Id: Ide3050ec993a945f7077b75e952c3b3532306ede
Merged-In: Ide3050ec993a945f7077b75e952c3b3532306ede
(cherry picked from commit 8528eabbba)
2018-03-20 15:26:27 -07:00
Colin Cross
1e047d39a5 Move java renderscript support to java_renderscript.mk
Move java renderscript support to java_renderscript.mk in
preparation to moving it before aapt.  Filter *.rs files
out of LOCAL_SRC_FILES and forbid them in java_common.mk
so that using *.rs files is an error if java_renderscript.mk
was not included.

Bug: 73885582
Test: m checkbuild
Change-Id: Ib37ce89daee58b025dec98f733c5a08149641afd
Merged-In: Ib37ce89daee58b025dec98f733c5a08149641afd
(cherry picked from commit 71822d6fb9)
2018-03-20 15:26:27 -07:00
Colin Cross
dc1e028994 Use srcjar and resource zip as output of renderscript rules
Replace RenderScript.stamp with a srcjar, with a resource zip as
an implicit output.  This makes the renderscript rules self contained,
which will make it easier to move them before aapt.

Bug: 73885582
Test: m checkbuild
Change-Id: I12d33e52019aebac6ea33271939228e4690a4173
Merged-In: I12d33e52019aebac6ea33271939228e4690a4173
(cherry picked from commit e00e2fae52)
2018-03-20 15:25:51 -07:00
Colin Cross
61acd8295c Merge "Replace extract_srcjars.sh with zipsync" am: c9907cc8f6
am: f434e35a47

Change-Id: I8304134f6b48ba57572b41cf6c4fc7cecd4d0dcc
2018-03-19 21:01:49 +00:00
Colin Cross
3f99cd5933 Replace extract_srcjars.sh with zipsync
Use zipsync instead of extract_srcjars.sh.

Also fixes an issue where unzipping a resource zip would
ignore anything that wasn't a *.java file.

Bug: 73885582
Test: m checkbuild
Change-Id: I1c25f65afa196614879071c8655866febebac185
2018-03-15 16:40:05 -07:00
Colin Cross
a9aa74ca38 Merge changes I97ea3ff3,Ib4351a5b,I74b61809,If2653f84,I2932f9e9, ... am: 34af6a41ff
am: 3d8c0a2c9e

Change-Id: I310c37dd5ef95e94f64630194c9aed1effa4818e
2018-03-14 23:48:21 +00:00
Colin Cross
34af6a41ff Merge changes I97ea3ff3,Ib4351a5b,I74b61809,If2653f84,I2932f9e9, ...
* changes:
  Allow aapt2 rules to take zipped resource files
  Add LOCAL_SRCJARS support
  Remove unused .fs file suppport
  Remove unused file lists
  Remove sharding support from make
  Move aapt flags from java_common.mk to aapt_flags.mk
2018-03-14 23:29:49 +00:00
Colin Cross
475475ca3a Merge "Allow locally disabling R8" am: 017a894c6e
am: 391a95da7e

Change-Id: I3c0a0d0eef90b3c824cce9c2e350714c0d00761f
2018-03-14 19:28:15 +00:00
Colin Cross
11e2d55c0f Add LOCAL_SRCJARS support
Allow java modules to take jars containing .java files as an input.
For turbine, pass them directly to turbine.  For javac, extract them
to a directory and pass a list of the files to javac.

Bug: 73885582
Test: m checkbuild
Change-Id: Ib4351a5b4b165a55e5fb02ee2680466db368983a
2018-03-14 12:05:04 -07:00
Colin Cross
93d6550c53 Remove unused .fs file suppport
.fs files are obsolete.

Bug: 73885582
Test: m checkbuild
Change-Id: I74b618099333fe565c7b235994be64e6466d2da6
2018-03-14 12:05:01 -07:00
Colin Cross
5ef6e79c21 Remove sharding support from make
Sharding is not used in make any more, the large java modules
(libcore and framework) have moved to Soong.  Keeping sharding
support complicates java compiling, so remove it.

Bug: 73885582
Test: m checkbuild
Change-Id: I2932f9e96bfc8f2ebf82095b16d6c0b3c51613f0
2018-03-14 12:04:55 -07:00
Colin Cross
5c66c2864a Allow locally disabling R8
Bug: 74746744
Test: m checkbuild
Change-Id: I5741f15821cf8de5df494ed8ad31d32a44657514
2018-03-14 17:00:23 +00:00
Jeff Gaston
7752903259 Merge "Clearer error if module doesn't declare any source files" am: c4343864ed am: cf9d0cf4dd
am: 0aeef2a0db

Change-Id: Ifc6fe286a6147794ffb3c1d428fb6051800f8399
2018-02-28 16:48:49 +00:00
Jeff Gaston
960acf1b88 Clearer error if module doesn't declare any source files
Bug: 72552006
Test: Make a module with no source files,
      run `m -j nothing`, notice that the error tells
      which module has no sources

Change-Id: Ib169e7b3cb86d840a3acd644e42cd1f9f65e1304
2018-02-27 20:52:53 -05:00
hansson
1b7700340c Merge "Add support for LOCAL_PRIVATE_PLATFORM_APIS." am: 3c76d02668 am: ab8f5d74f2
am: 1f903cce0c

Change-Id: I6558665d9488b462fd00ad89a570817f0a03c23d
2018-02-22 12:03:30 +00:00
Anton Hansson
7ff32d2734 Add support for LOCAL_PRIVATE_PLATFORM_APIS.
The only enforcement right now is that modules don't specify both
LOCAL_SDK_VERSION and LOCAL_PRIVATE_PLATFORM_APIS, but a warning
can be turned on by setting the JAVA_SDK_ENFORCEMENT_WARNING variable.

Bug: 73535841
Test: make w/ and wo/ flag.
Change-Id: I3cc720bf060e2bc789e10884ff888d527b91cb50
2018-02-21 18:10:59 +00:00
TreeHugger Robot
0710ca2056 Merge "Add rule to enable running Jetifier within Make against Java modules" 2018-02-20 23:35:10 +00:00
Jeff Gaston
d2ba724f7f Add rule to enable running Jetifier within Make against Java modules
The only case where we expect to actually enable this behavior is for
modules that are just an unpacking of a prebuilt, because those are
the only cases for which we can't conveniently just change the source

Bug: 72552006
Test: ./build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm 'build/make:work^' \
      'build/make:work'
Test: cherry-pick the following patch that depends on this one and
      the rest of that patch's topic, and then do `m -j jeffapp`

Change-Id: I62e231900d6d87673ddf19c7fc2686fef2828590
2018-02-20 22:25:23 +00:00
Colin Cross
e7bbfb145f Merge "Disable duplicates warnings when merging jars" am: 2a519d5a9b am: 87eba4a9ba
am: 51b559abfa

Change-Id: Idd0ab1653340dcba6dd37fa80168cffcb66eb452
2018-02-14 21:43:37 +00:00
Colin Cross
5b73ab34ed Disable duplicates warnings when merging jars
There are too many duplicates warnings, disable them until someone
is actually looking at them.

Bug: 69316739
Test: m checkbuild
Change-Id: Ifb67dbf7734b5f53941d110f578c4fe642e36005
2018-02-14 18:35:37 +00:00
Jiyong Park
1f4e7fbe9d Merge "Support LOCAL_SDK_VERSION := core_current" am: c82c0a81ec am: d2e7e0d33d
am: efc3f4d130

Change-Id: I13ab7399a47443dd1aa8766416ad30efcb443d7e
2018-02-07 01:30:05 +00:00
Treehugger Robot
c82c0a81ec Merge "Support LOCAL_SDK_VERSION := core_current" 2018-02-06 22:37:16 +00:00
David Brazdil
8c4d521d0d Merge "Revert "Revert "Apply hiddenapi build tool on boot jars""" am: edd4716ff9 am: bc05d3f846
am: 3264b568f3

Change-Id: I21ce7dc6f2d50a96722a197f52e48f13899ede7d
2018-02-01 23:27:09 +00:00
Jiyong Park
5ebca30d21 Support LOCAL_SDK_VERSION := core_current
core_current is a pseudo SDK version which is a core Java API subset of
the Android API. It is expected to be mainly used for external Java
projects which are agnostic to Android; such as junit, guava, etc.

A module built with this SDK version can only link to java modules of
the same kind. It can't depend on modules built with LOCAL_SDK_VERSION
:= current or without LOCAL_SDK_VERSION.

Bug: 72206056
Test: m -j
Change-Id: I34a9696393aa6704fd6684a40ea5b05d3fb46b23
2018-02-01 17:14:55 +09:00
David Brazdil
b8fa6dd104 Revert "Revert "Apply hiddenapi build tool on boot jars""
This reverts commit 4a2926a44e.

Reason for revert: The original CL caused two issues:
1) Increased app startup because `profman` failed to verify boot
jars and created an empty profile for the boot image. All methods
in the framework therefore ran interpreted/JITed. New flag
"--skip-apk-verification" has been added to `profman` to fix
the issue in CL Iad614e47feada293218c11cff985a8012ca49a0f.
2) Caused a crash in Mockito CTS tests because jvmti did not
remove hiddenapi access flags from boot jars before using them.
This has been fixed with CL Ibc9a96a6b541c06844f276db009ac29514f7a3bb.

Bug: 64382372
Bug: 72550707
Test: make test-art-host
Change-Id: Ie8c58714455662f042f56b2977b01b75c5ec7d2f
2018-01-30 18:25:46 +00:00
Alex Light
e66c468790 Merge "Revert "Apply hiddenapi build tool on boot jars"" am: 9f1e629503 am: 67bf2d712a
am: 393453d761

Change-Id: I4e69247e2add400d6dad997cca04b1969384bb4f
2018-01-26 19:54:13 +00:00
Alex Light
4a2926a44e Revert "Apply hiddenapi build tool on boot jars"
This reverts commit b7f00ed2af.

Bug: 72550707
Bug: 64382372
Test: atest CtsInlineMockingTestCases

Reason for revert: Causing invalid dex files to be passed to jvmti
                   agents. This causes CtsInlineMockingTestCases and
                   other tests to fail.

Change-Id: I50129e94791b9e2bef919fe398b4250ae461195b
2018-01-26 18:16:52 +00:00
David Brazdil
5f97aef277 Merge "Apply hiddenapi build tool on boot jars" am: 221848b181 am: b1831cf27e
am: 74f173806b

Change-Id: I60a5482f2a04429e3dcbf47ed82441cb3c702cdc
2018-01-26 00:16:38 +00:00
David Brazdil
b7f00ed2af Apply hiddenapi build tool on boot jars
Restrictions on usage of private APIs require encoding new information
into the dex files of the boot class path. ART now contains a new build
tool called `hiddenapi` which takes three lists of class member
signatures (blacklist, light and dark greylist), finds the class members
in their respective dex files and modifies their access flags in place.

This patch invokes the `hiddenapi` tool on all JARs in
PRODUCT_BOOT_JARS. For Java libraries built with Makefiles the tool is
invoked after the dexer directly on DEX files. For Soong-built
libraries, the build system has to unzip the JAR produced by Soong,
apply `hiddenapi` and rezip again. This is due to the fact that the
PRODUCT_BOOT_JARS variable is not available to Soong.

Bug: 64382372
Test: m
Change-Id: I6ce897d204459c8b6f46ed49e0909ff76c08a9ed
2018-01-25 09:22:08 +00:00
Paul Duffin
f492ebdbd1 Revert "Filter JUnit and android.test classes from applications using proguard"
This reverts commit f22aca1e47.

Switching to use -systemjars instead of -libraryjars means that it is no longer
necessary to filter out the junit and android.test classes from jars to which
Proguard is being applied.

Bug: 30188076
Bug: 69156675
Test: make checkbuild
Change-Id: I36e14d28e01517927b458d69ade8ccb2c79a3340
2018-01-19 08:16:34 +00:00
Paul Duffin
47970225d2 Use Proguard -systemjars instead of -libraryjars
Proguard -systemjars will correctly use the system libraries version
of a duplicate class rather than the program's version.

If USE_R8=true then use -libraryjars as R8's proguard emulation layer
does not support -systemjars and it is unnecessary because R8 does not
fail like proguard does when it comes across duplicate classes.

Bug: 30188076
Bug: 69156675
Test: make checkbuild
Change-Id: I99f0cb7a816ce34e5fa209803b7c538fd931d8a7
2018-01-19 08:16:34 +00:00
Colin Cross
57d291ecca Merge "Remove LOCAL_PROGUARD_ENABLED := nosystem" am: 2c2cb33830 am: d61a376ec4
am: b9f8265d08

Change-Id: Ifcc17a929f3218fe4052e648d8677ba9e5d471f3
2018-01-03 22:35:57 +00:00
Colin Cross
268504d237 Merge "Move jacoco before desugar" am: f9a1e6a72a am: c06ecd9a99
am: 2fec0b5d97

Change-Id: Ib71f1bb65b1a2d995a57dc18ff5e384db2fc7cb3
2018-01-03 21:07:29 +00:00
Colin Cross
e616f34431 Remove LOCAL_PROGUARD_ENABLED := nosystem
None of the system options are controversial, and there are no
longer any users of nosystem, so remove it.

Test: m checkbuild
Change-Id: Id1b946d83688d266ca2942c02c97e8b404c3755b
2018-01-02 13:18:04 -08:00
Colin Cross
96873482b0 Move jacoco before desugar
R8 will replace desugar+proguard+dx, which will mean jacoco has to
run before desugar.  In preparation, move jacoco before desugar now.

Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false tests
Change-Id: I0627a79ba2f0b26a113d5d8bcc5cb1fda08295a1
2017-12-28 09:39:15 -08:00
Colin Cross
127e7e43d0 Merge changes I84a59a8c,Id7a92fb2 am: 9c2b798143 am: b2b378e007
am: c819a3008a

Change-Id: Ied52a144b5d3ff07b6f0a5a26e5407794dd0cffb
2017-12-28 17:35:09 +00:00
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
Colin Cross
3e4ad40ab7 Merge changes I63eace8f,I103cbe58 am: 5ded399588 am: 0714643816
am: db2cc74d5c

Change-Id: I3522e3922aa95c7be13b5afac10415a06d290b45
2017-12-21 21:16:16 +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
d43b45b994 Merge "Add zip2zip as dependency of dexing step." am: f0971be1b6 am: 7269770b28
am: af233a4dcf

Change-Id: If15cb28fa50d8f9398f300ee7b5df92fe2649210
2017-12-21 18:35:41 +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
Paul Duffin
6b0cf89c18 Merge "Remove android.test.** and c.a.i.u.* injar filters" 2017-12-13 07:24:32 +00:00
Colin Cross
426ecd0f60 Merge "Replace build/tools with build/make/tools" am: 973301af79 am: e6dc6b2026
am: eb6c8444a6

Change-Id: I14d033658d219e81790ab1e730b7e477c70f4a13
2017-12-13 03:03:47 +00:00
Treehugger Robot
973301af79 Merge "Replace build/tools with build/make/tools" 2017-12-13 02:34:42 +00:00
Paul Duffin
8fe958d0b9 Remove android.test.** and c.a.i.u.* injar filters
These were added to work around Proguard problems caused by duplicate
classes in the APK and libraries. Unfortunately, that work around
caused other Proguard problems when trying to remove classes from
android.jar.

Bug: 30188076
Test: make checkbuild
Change-Id: I59345e60073faf3337215ecaa62cf640e19495c8
2017-12-12 15:24:56 +00:00
Alan Leung
e8f23f11e9 Merge "Add USE_D8_DESUGAR option in build/core" am: 78b99fefd3 am: c2847897ff
am: 8de45264f6

Change-Id: I7fedd53bd581c3ed221aea1c7ce8b1d337bd003a
2017-12-12 00:24:40 +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
Sundong Ahn
ef212cbe8d 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.

Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
2017-11-30 10:04:09 +09:00
TreeHugger Robot
6b005dc0d3 Merge "Export proguard flags from static android libraries and aar prebuilts" 2017-11-21 04:03:35 +00:00
Dan Willemsen
1417c177ac 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
2017-11-17 13:11:26 -08: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
53d6df9c25 Merge "build: clean up proguard_flag_files" am: 7cd5386b51
am: 95f4a845d4

Change-Id: I87f54711150bcdd315b31e469cd2aba490f1de61
2017-11-09 19:28:08 +00: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
3ae1b684b3 Merge "Use prebuild R8 for USE_R8=true" am: 8639879e60
am: 58c6122f44

Change-Id: Ic0d489cf48c5fc0881df824c4a70c753b1bf0a5c
2017-11-08 07:56:56 +00: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