Commit graph

579 commits

Author SHA1 Message Date
Colin Cross
aebe1e9fe9 Clean up LOCAL_DONT_DELETE_JAR_META_INF
Allow setting it for host modules, it is necessary for
RoboLectric.

Remove some unused PRIVATE_DONT_DELETE_JAR_META_INF variables.

Remove unzip-jar-files, it is obsolete since merge_zips was
introduced.

Test: m checkbuild
Change-Id: I3f2fc466321904eace31525cbac99ad524f39188
2019-04-23 13:05:11 -07:00
Colin Cross
e6210f6eb2 Remove AAPT1 support
AAPT2 is used everywhere now, remove support for AAPT1.  Also
removes dpi_specific_apk.mk, it was never updated to use AAPT2
and has been generating bad APKs (resource ID mismatch between
the dex files and the resources) since AAPT2 was made the default
in May 2018 (I9b67fd2a9b3234798b2aac879b5242c2097b3863).

Bug: 80450981
Test: m checkbuild
Change-Id: I2ff768897360ff866dbae5562455bab22be270f7
Merged-In: I2ff768897360ff866dbae5562455bab22be270f7
2019-04-17 16:50:30 -07:00
Jiyong Park
eadd1bdb8e Don't feed framework.jar to proguard for vendor apks
We used to add framework.jar to proguard via -systemjars option even
for the apks building againsd SDK. This was because the app might have
references to hidden APIs via static libraries, etc.

However, for vendor apks, the use of hidden API is strictly prohibited.
So it is fine to not include framework.jar. Furthermore, including
framework.jar even causes problems in some cases; if a java library
(e.g., android.hidl.base-V1.0-java) is statically linked to both the app
and the framework.jar, -systemjars frameworks.jar forcibly removes
classes in the library from the app to have references to the non-public
classes in framework.jar. This could fail some compliance tests.

Fixing the problem by not raising SDK for apks located in vendor or odm
partitions.

Bug: 128574081
Test: m
Change-Id: If2b658fead5b4bb4d8c023a37eb57a37ad9b741d
2019-04-03 22:35:34 +09:00
Colin Cross
a27f42aa5d Consolidate sdk version handling
Share the logic that converts LOCAL_SDK_VERSION, LOCAL_MIN_SDK_VERSION
and the global config values into minSdkVersion, targetSdkVersion,
and compileSdkVersion.

Test: m checkbuild
Change-Id: Id038673662b23cffc9e57978ac55a3f35ef8237a
2019-02-07 08:55:48 -08:00
Treehugger Robot
6d1ae7a015 Merge "Move hiddenapi singleton rules to Soong" 2019-02-07 07:27:33 +00:00
Colin Cross
485c9cd400 Move hiddenapi singleton rules to Soong
Hiddenapi rules are now in build/soong/java/hiddenapi_singleton.go.
This effectively requires any module in PRODUCT_BOOT_JARS to be
defined in Soong.

Bug: 123645297
Test: m checkbuild
Change-Id: If72bd1c20b2014d0a3d400624d37fdb0a3052245
2019-02-05 21:38:55 -08:00
Steven Moreland
e0c38893ff Remove '-b' from AIDL.
An empty file will be emitted for parcel declarations. Now sources may
include parcel definitions.

Bug: 70046217
Test: manual
Change-Id: Ib4bfaf52101956a543738d50ea699f9232f5bb91
2019-02-06 04:58:06 +00:00
Colin Cross
8e0ff1c370 Add a flag to allow unbundled builds to build SDKs from source
Mainline modules are tightly coupled to the platform, and should
build against the current SDK from source and not prebuilts. Add
a flag UNBUNDLED_BUILD_SDKS_FROM_SOURCE to specify that a
TARGET_BUILD_APPS build should build the current SDK instead of
using the prebuilts.

Bug: 121194841
Bug: 121231426
Test: no change to out/build-aosp_sailfish.ninja
Test: forrest unbundled build
Test: forrest master apps build
Test: forrest mainline modules build
Change-Id: I9ebc08745409a817d831817cb282aba1de6d81bb
2018-12-18 22:43:16 -08:00
David Brazdil
59b6fd541d Replace hidden API lists with a single CSV
Combine existing hiddenapi-* txt files into a single CSV containing
a list of all class members and their corresponding flags.

Test: m, phone boots
Change-Id: I67f1b5f331b262e9b681d9a3c78c9e4cbb5ea082
2018-11-29 15:48:56 +00:00
Mathew Inwood
8c96298a92 Write greylist annotation metadata to a csv file.
Also add support for merging these into a single file elsewhere in the
build.

Test: m, inspect generated greylist.csv
Bug: 117314178
Change-Id: If28110fc1ed090222e55c274e8363110753d10f1
2018-10-16 12:06:02 +01:00
patricktu
b23d8e6502 aidegen: Collect all java sources from makefile system.
Bug: 117129969
Test: make -j64 out/target/product/generic_x86_64/module-info.json
Change-Id: I4bc6cab8e56a1ed6485ad2f5f22fe9b8149b25d0
2018-10-05 14:55:36 +08:00
Colin Cross
ec17af3364 Pass classpath to d8
d8 requires the full classpath if --min-api requires default method
or try-with-resources desugaring.  Always pass the full classpath,
since it will already have been built to generate the input jar.

Bug: 116243313
Test: m checkbuild
Change-Id: I363b4d3145e23d4eed77455c1897430206f3ac22
2018-09-21 12:36:53 -07:00
Mathew Inwood
edb1c84f03 Support for adding dark greylist members from annotations.
Currently, we support maxTargetSdk values of 26 & 28, corresponding to
the P blacklist (existing dark grey list) and upcoming Q blacklist.

For now, just put the two into the same list, as the runtime support to
distinguish between the two does not exist yet.

Bug: 114361293
Test: m
Change-Id: I2f8d206e8dd22afc6c0e98fb5e53b1d78a534125
2018-09-07 16:52:16 +01:00
David Brazdil
7c76579e7a Merge "Support hidden API whitelist generated by class2greylist" 2018-08-27 21:41:04 +00:00
Søren Gjesse
b22934382f Ensure that the R8 minification map (ProGuard dictionary) file exists
R8 no longer outputs an empty map file when minification
(obfuscation) is turned off.

Test: m -j PRODUCT-aosp_x86-eng
Change-Id: I3bd3f2900225dca05a972f46a3b882041e17ba49
2018-08-27 11:19:35 +02:00
David Brazdil
b67402ecce Support hidden API whitelist generated by class2greylist
Libcore has support for annotating a virtual method which is known
to change its return type in a future release. This annotation is
recognized by the dexer and a future-proof bridge method is created.
This patch integrates changes in class2greylist to support this
annotation into the build system and generation of hidden API lists.

Calling class2greylist on each boot classpath module now produces two
text files instead of one: signatures for greylisting and now also
whitelisting. They are passed on to the hidden API list generating rules
in frameworks/base.

Bug: 112186571
Test: m appcompat, diff public-list.txt whitelist.txt
Change-Id: I9861203e6e07a17d50850892ec13880971457d11
2018-08-23 10:38:03 +01:00
Colin Cross
3ebfe7309f Remove proguard support
R8 is always used now.

Bug: 111885749
Test: m checkbuild
Change-Id: I9ae586c6360f2e3050422090b4e08f27ae167758
2018-08-07 11:22:17 -07:00
Colin Cross
1ef3c64906 Merge changes from topic "manifest_fixer_targetSdkVersion"
am: 7b21221d2a

Change-Id: I23336d8a71e2b42877606989d330aa68efb57d5e
2018-07-26 15:10:59 -07:00
Colin Cross
7b21221d2a Merge changes from topic "manifest_fixer_targetSdkVersion"
* changes:
  Pass --library to manifest_fixer.py for android libraries
  Fix dependencies for obfuscated instrumentation tests
  Move manifest fixing to a separate rule
2018-07-26 22:02:36 +00:00
Mathew Inwood
50f59655ba Merge "Build rules to derive greylists from annotations."
am: 48a7929962

Change-Id: I029776a9e31923b87e125ab0054b398d9c935bce
2018-07-26 01:37:29 -07:00
Mathew Inwood
48a7929962 Merge "Build rules to derive greylists from annotations." 2018-07-26 07:37:29 +00:00
Colin Cross
fcb441b2b7 Fix dependencies for obfuscated instrumentation tests
This path is never used, otherwise the dependency on
proguard.classes.jar would have triggered the checkbuild
dangling rules errors.  Remove the dependency on the
proguarded classes, which don't exist any more, and depend
on the proguard_options and proguard_dictionary files
instead.

Test: none
Change-Id: Ia3ebc3bc71f0d6fdfa4a7a6850e2f7021adfdd1a
2018-07-25 14:30:10 -07:00
Dan Willemsen
76f0441dc0 Merge "Mark more targets as PHONY"
am: 6708f9507b

Change-Id: I4a23ba6f0043cef1406e40752d40b1228d0c8774
2018-07-24 15:37:00 -07:00
Mathew Inwood
04c58dea0b Build rules to derive greylists from annotations.
Uses the new class2greylist tool to extract API descriptors from .class
files.

Also add these generated greylist.txt files as dependencies of
INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST so they can be merged later in
the build.

Bug: 110868826
Test: m
Change-Id: I406587732b537f9b56768ad9909039dfab34c334
2018-07-24 15:48:42 +01:00
Dan Willemsen
7a1da0e43e Mark more targets as PHONY
So that we can start restricting non-phony targets to $OUT_DIR and
$DIST_DIR.

Test: add --writable=out/, see fewer warnings
Change-Id: I411fe4af732b1bce35d4a4c1e2a47b5f8a15e6b8
2018-07-24 01:21:12 -07:00
Colin Cross
2e51d73d2b Merge "Run ErrorProne in OpenJDK9"
am: 264bc07791

Change-Id: I3ce7202cdcfd3e86fbccb359f56ca59581855a04
2018-06-21 13:57:20 -07:00
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