Commit graph

165 commits

Author SHA1 Message Date
Treehugger Robot
b039cf792f Merge "Delete jack support" 2017-10-03 01:17:25 +00:00
Dan Willemsen
f439c334da Fix incremental aapt builds
If a resource was moved / removed without any other timestamp updates,
ninja would not re-run aapt. To fix this, add a list of resource files
into the same command as aapt (echo ... >/dev/null). That way if the
list changes, ninja will recognize the command line changing and rerun
aapt.

Bug: 67315436
Test: mmma cts/tests/autofillservice
Test: mv cts/tests/autofillservice/res/layout/welcome_activity.xml \
      cts/tests/autofillservice/res/layout/welcome_activity_test.xml
Test: mmma cts/tests/autofillservice

Change-Id: Ia93ac4ff48910fed74a1f1539ce4e1f5a9db023f
2017-10-02 14:22:02 -07: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
Dan Willemsen
ba9b0fbc05 Fix multiple output file generation for AAPT2
Make R.stamp actually part of the same rule that creates R.java.
Otherwise if the generated sources directory is removed, we don't
regenerate R.java / Manifest.java.

Also move the package-export.apk and proguard options file into the same
rule.

Test: m telephony-common; rm out/target/common/obj/*/*_intermediates/src; m telephony-common
Change-Id: I71f6fcaf20593ca23271d52d15537aaa9ef4cc77
2017-09-29 20:35:32 -07:00
Nicolas Geoffray
b06c30b480 Revert "Revert "Make privileged apps always keep uncompressed dex files.""
bug: 30972906
bug: 63920015

Test: doing zipinfo on the produced apks after build.
Test: fugu build

This reverts commit f69441b76b.

Change-Id: I6b029f2044385f3e3fa332091a9244cec79d2474
2017-09-19 13:09:27 +01:00
Nicolas Geoffray
f69441b76b Revert "Make privileged apps always keep uncompressed dex files."
Broke Fugu build. Will work on a workaround for it.

bug: 30972906
bug: 63920015

This reverts commit 09dfe6739a.

Change-Id: I5a8b8de4ec98ae44808762ca1ba974ce89bebb05
2017-09-18 15:07:26 +00:00
Nicolas Geoffray
09dfe6739a Make privileged apps always keep uncompressed dex files.
To ensure the verified boot work does not make ART run
dex code uncompressed in memory, make the build system
generate uncompressed dex files in APKs.

The alignment of STORE files in an APK is already handled.

bug: 30972906
bug: 63920015

Test: doing zipinfo on the produced apks after build.
Change-Id: I0ccdeae5d674b2a409a1343c4a14699c7bf0defb
2017-09-15 21:49:05 +01:00
Jaekyun Seok
ccee95e6ec Support excluding overlays when enforcing RRO
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS will be used to specify overlays
to be excluded from enforcing RRO.

The excluded overlays will be applied into the original package.

Bug: 63600240
Bug: 65001751
Test: succeeded building with
PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := \
    vendor/google/google_overlay/static_only \
    vendor/google/nexus_overlay/common/static_only
and confirmed that config_webview_packages existed in framework-res.apk
with the overlayed value, but not in framework-res__auto_generated_rro.apk.

Change-Id: I0bfb44fc7726710bb78d9100404bc6dd29d06a73
2017-09-08 10:00:46 +09: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
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
a4e638689b Merge "Revert "Revert "Copy resources from classes.jar when using AAPT2"""
am: e2b98ace94

Change-Id: Id0850fff121beab0920e06440c7271d7622387b0
2017-08-04 21:02:35 +00:00
Colin Cross
303567c922 Revert "Revert "Copy resources from classes.jar when using AAPT2""
This reverts commit a7e336d17a.

Reapplies I6649f7f2fbf63ff5001f4731e22960f857726c70 with fix
for jack builds.

Bug: 64272170
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L93000000088657848&nodeType=Trybot
Change-Id: Id66aebfc2c26a4467e6cf25e4372080882f0b286
Merged-In: Id66aebfc2c26a4467e6cf25e4372080882f0b286
(cherry picked from commit 6fedebf936)
2017-08-04 09:35:13 -07:00
Jeff Gaston
6264b662f3 Merge "Update to latest jacoco usage"
am: 483fae7430

Change-Id: Ibc94d5ba6db7690441825dd655b6cb26d989b78d
2017-07-17 20:44:10 +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
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
Dan Willemsen
0cf52d84d3 Start deprecating OVERRIDE_BUILT_MODULE_PATH
We no longer need to use $PRODUCT_OUT/obj/lib as a linker path, we can
directly specify the shared libraries to the linker.

So install both into the standard built module path, and declare a copy
rule to the old OVERRIDE_BUILT_MODULE_PATH location. This way we can
incrementally move users from the old location to the standard path.

Test: m -j
Change-Id: I3c6140ac26e5e5ca486337ce0192e15e530da32c
Merged-In: I3c6140ac26e5e5ca486337ce0192e15e530da32c
2017-05-16 21:16:20 +00:00
Dan Willemsen
f72308af83 Start deprecating OVERRIDE_BUILT_MODULE_PATH
We no longer need to use $PRODUCT_OUT/obj/lib as a linker path, we can
directly specify the shared libraries to the linker.

So install both into the standard built module path, and declare a copy
rule to the old OVERRIDE_BUILT_MODULE_PATH location. This way we can
incrementally move users from the old location to the standard path.

Test: m -j
Change-Id: I3c6140ac26e5e5ca486337ce0192e15e530da32c
2017-05-16 21:16:06 +00:00
Dan Willemsen
0d1967d571 Merge changes Id0d167e6,I290a02b0 am: 90573e75a8 am: 9efa174836
am: a4d4cf335c

Change-Id: Ia59d32b0d533c4d37ac6f8950fbfb179c34b5db3
2017-05-10 02:52:21 +00:00
Dan Willemsen
fa7ecfb752 Clean LOCAL_RESOURCE_DIR paths
With LOCAL_USE_AAPT2, resource directories like a/b/../res cause
problems, since ninja will canonicalize the path before creating the
intermediate resource directory, so it creates <intermediates>/a/res
while we give AAPT2 <intermediates>/a/b/../res, which fails to open.

Bug: 37716307
Test: Switch LOCAL_USE_AAPT2:=true for TelecommUnitTests, mma
Test: lunch aosp_marlin-userdebug; m -j
Change-Id: Id0d167e68185a119390e7b7e3c344895e77ca0e3
2017-05-05 20:50:54 -07:00
Yang Ni
6b68da0625 Do not package res unless RS target API < 21
Bug: 37626838

Since Lollipop, RS generated bitcode is embedded as strings in
generated Java files, and no longer needed in the resources.
This CL makes packaging resources conditional on RS target API, and
not do so unless it is below 21.

Test: mm in frameworks/rs/tests/java_api/Refocus, ImageProcessing2, and
      ImageProcessing_jb
Change-Id: I79a90ed4b96cb78b22a64a35b539d9d67351f4c4
(cherry picked from commit e2c0901918)
2017-05-01 20:07:45 -07:00
Yang Ni
e2c0901918 Do not package res unless RS target API < 21
Bug: 37626838

Since Lollipop, RS generated bitcode is embedded as strings in
generated Java files, and no longer needed in the resources.
This CL makes packaging resources conditional on RS target API, and
not do so unless it is below 21.

Test: mm in frameworks/rs/tests/java_api/Refocus, ImageProcessing2, and
      ImageProcessing_jb
Change-Id: I79a90ed4b96cb78b22a64a35b539d9d67351f4c4
2017-05-01 21:41:14 +00:00
Colin Cross
ffbf0a66d8 Move proguard before classes.jar
Downstream users of a library always link against javalib.jar, which
is either the dex jar for java libraries or a copy of
proguard.classes.jar for static java libraries.  In preparation for
making java libraries a superset of static java libraries, make
classes.jar always be the final class-containing jar for use
downstream, and always create a classes-pre-proguard.jar for
users that need a jar without shrinking or obfuscation.

Also rename the intermediates to be consitent: classes-<tool>.jar

Bug: 36902714
Test: m -j ANDROID_COMPILE_WITH_JACK=false java
Change-Id: I3df8b9a4edcd5db996f1fedc54c8a782d4f36a92
(cherry picked from commit 6fabefa88e)
2017-04-11 17:00:02 +00:00
Colin Cross
950f1efbbc Move proguard before classes.jar
Downstream users of a library always link against javalib.jar, which
is either the dex jar for java libraries or a copy of
proguard.classes.jar for static java libraries.  In preparation for
making java libraries a superset of static java libraries, make
classes.jar always be the final class-containing jar for use
downstream, and always create a classes-pre-proguard.jar for
users that need a jar without shrinking or obfuscation.

Also rename the intermediates to be consitent: classes-<tool>.jar

Test: m -j ANDROID_COMPILE_WITH_JACK=false java
Change-Id: I3df8b9a4edcd5db996f1fedc54c8a782d4f36a92
Merged-In: I3df8b9a4edcd5db996f1fedc54c8a782d4f36a92
(cherry picked from commit 6fabefa88e)
2017-04-06 00:46:23 +00:00
Jaekyun Seok
1b2242895e Use product-based inclusive rule for enforcing RRO
Board-based rule can cause unexpected regression because build-time overlays
are different among products. So each product should be tested with its own
product-based rule considering its build-time overlays before applying
enforcing RRO.

Additionally RRO conversion is mandatory only for overlays of which target is
included in AOSP system image and is critical for CTS/VTS tests with AOSP
system image. So inclusive rule is more suitable instead of exclusive rule
to avoid unexpected regression due to unnecessary RRO conversion.

Note that we still support conversion for all the overlays by specifying
PRODUCT_ENFORCE_RRO_TARGETS as "*".

Test: building succeeded and tested with auto-generated RROs.
Bug: 36231603
Change-Id: I8e1d701d4f78b818c89ef3e7638110105370c5bc
(cherry picked from commit 2a209997e8)
2017-04-04 11:31:24 +09:00
Jaekyun Seok
2a209997e8 Use product-based inclusive rule for enforcing RRO
Board-based rule can cause unexpected regression because build-time overlays
are different among products. So each product should be tested with its own
product-based rule considering its build-time overlays before applying
enforcing RRO.

Additionally RRO conversion is mandatory only for overlays of which target is
included in AOSP system image and is critical for CTS/VTS tests with AOSP
system image. So inclusive rule is more suitable instead of exclusive rule
to avoid unexpected regression due to unnecessary RRO conversion.

Note that we still support conversion for all the overlays by specifying
PRODUCT_ENFORCE_RRO_TARGETS as "*".

Test: building succeeded and tested with auto-generated RROs.
Bug: 36231603
Change-Id: I8e1d701d4f78b818c89ef3e7638110105370c5bc
2017-03-31 07:11:09 +09:00
Jaekyun Seok
39f97ae22a Enforce RROs for all the build-time ROs
This CL is to generate every static RRO package for its target package
automatically at build-time.

BOARD_ENFORCE_RRO build variable is added to specify whether enforcing
RRO is required or not.

BOARD_ENFORCE_RRO_EXEMPT_SOURCES build variable is added to specify
the module list of which item should be exempt from enforcing RRO.

Test: tested on bullhead and sailfish
Bug: 34097942
Change-Id: I455b2ce34e66c57a540c299b5e378b7c4e78d5b8
(cherry picked from commit 3070610b72)
2017-03-30 10:43:38 +09:00
Adam Lesinski
15c6791d76 Merge "Add LOCAL_ASSET_DIR support (-A) to aapt2" 2017-03-16 21:56:23 +00:00
Adam Lesinski
981de838d4 Add LOCAL_ASSET_DIR support (-A) to aapt2
Although performing the inclusion of assets/ at a later stage is
preferable, (since aapt just copies the files) do the easy thing and
support what aapt did. In the future perhaps we can zip up the
assets/ directories when also merging in the classes.dex.

Bug: 35461578
Change-Id: I7d7fde43333ea6455c4a1b9113bd25e1d88b7dd5
Test: manual
2017-03-16 04:53:05 +00:00
Adam Lesinski
7932676215 Revert "Add LOCAL_ASSET_DIR support (-A) to aapt2"
This reverts commit 996bc3ce7b.

Reason for revert: Need to update prebuilts, but prebuilts not built by server yet...

Change-Id: I87deb3ed9512278ff40c185059230dbd66524989
2017-03-15 07:00:41 +00:00
Adam Lesinski
996bc3ce7b Add LOCAL_ASSET_DIR support (-A) to aapt2
Although performing the inclusion of assets/ at a later stage is
preferable, (since aapt just copies the files) do the easy thing and
support what aapt did. In the future perhaps we can zip up the
assets/ directories when also merging in the classes.dex.

Bug: 35461578
Test: manual
Change-Id: I7cd36585e7c292e43b5528969900c6ead2b80c0b
2017-03-14 12:28:09 -07:00
Jaekyun Seok
3070610b72 Enforce RROs for all the build-time ROs
This CL is to generate every static RRO package for its target package
automatically at build-time.

BOARD_ENFORCE_RRO build variable is added to specify whether enforcing
RRO is required or not.

BOARD_ENFORCE_RRO_EXEMPT_SOURCES build variable is added to specify
the module list of which item should be exempt from enforcing RRO.

Test: tested on bullhead and sailfish
Bug: 34097942
Change-Id: I455b2ce34e66c57a540c299b5e378b7c4e78d5b8
2017-03-14 23:55:50 +09:00
Simran Basi
fdf88008d7 Merge "Add support for multiple LOCAL_COMPATIBILITY_SUITES & undefined testcase directories." am: 6abedc9b3e am: 22cc401165
am: 7fa662af82

Change-Id: I010caf27bae2b65f47c9d92c37f3d5b456fa6397
2017-02-28 23:50:39 +00:00
Simran Basi
6bea37c7fa Add support for multiple LOCAL_COMPATIBILITY_SUITES & undefined testcase directories.
1) Updates the LOCAL_COMPATIBILITY_SUITE line to allow for a
   testcase to belong to multiple suites.
2) Building testcases no longer fails if
   COMPATIBILITY_TESTCASES_OUT_<suite> is not defined. This
   testcase will just not output to that directory.
   This will be utilized by the device-tests and general-tests
   suites that don't require any extra output besides the common
   testcase directory.

Bug: 35394351
Test: 1) Added multiple *TS testcases to cts & vts and verified they
       ended up in the common directory and each suite's testcase
       directory. Specifically tested CtsSplitApp to ensure the
       split usecase still works as well.
      2) Added a CTS testcase to the device-tests suite, built
       device-tests and verified the cts/android-cts/testcases
       copy was not produced.

Change-Id: Ic4c4e87e62be4fc0c5e394d88cc359518346dffa
2017-02-28 12:41:40 -08:00
Colin Cross
8b0034c435 Merge "Pass min sdk version to dx and desugar" am: bbad7c3e1f am: 4a4325d313
am: 14fce4b072

Change-Id: If9ac3b69957689bd451fc97fe968d79f42a751e9
2017-02-23 18:24:46 +00:00
Colin Cross
536ef4e35a Pass min sdk version to dx and desugar
Test: make checkbuild
Change-Id: Idde9712508571ea623126c7d25d2fa67eccf4833
2017-02-22 11:10:37 -08:00
Colin Cross
9256be1822 Merge changes I7e8fcd2e,Ie12d743c am: 547f7393d7 am: 8283b186be
am: 7d8a028cd3

Change-Id: Ife691c9e00e766293e3648348e3c86b92f96fd56
2017-02-17 22:45:38 +00:00
Colin Cross
79e2f73b6c Re-enable dx support
This is a partial revert of commits:
858657366f Remove support of disabling Jack.
3ae7861252 Remove javac support in host dex rules.
22313f2b2a Remove rules for building dex with dx

Test: builds
Change-Id: Ie12d743cbe978bdeb030910848b67f5945a4fec8
2017-02-16 14:08:45 -08:00
Simran Basi
050b557b63 Merge "Output *TS testcases to their own subdir in the common testcase folders." am: 4d49966ce3 am: ddb4256322 am: e50b42a578
am: 52224ac185

Change-Id: I9e5e2cff39543641ff99646320af86c8016f47a7
2017-02-10 21:38:41 +00:00
Simran Basi
3fb354cca0 Output *TS testcases to their own subdir in the common testcase folders.
Instead of dumping all *TS testcases into the common testcase
directory directly, place them all in their own subdirectory.

Bug: 35153177
Test: `make cts -j` and checked the contents of both:
out/host/linux-x86/testcases/ &
out/host/linux-x86/cts/android-cts/testcases/

Change-Id: I22a768dba58d40be1e61885534fb813e7ff08c99
2017-02-08 15:53:32 -08:00
Simran Basi
5c36c2e329 Merge "Output *TS testcases to common testcase folders." am: 469c458279 am: 040b876e3e am: d006a8be91
am: e9f1a266c9

Change-Id: I86bcda4b7727d9cde8a2aedea25f1e30f0628817
2017-02-08 20:20:15 +00:00
Simran Basi
7166d1f43a Output *TS testcases to common testcase folders.
Aggregates the different *TS testcases into two common folders,
one under each the host and product hierarchies.

Bug: 34715822
Test: `make cts -j` and checked the contents of both:
out/host/linux-x86/testcases/ &
out/host/linux-x86/cts/android-cts/testcases/

Change-Id: I7d5201998ddcb011ecc687c272a0d0a36da248b7
2017-02-07 14:49:06 -08:00
Colin Cross
d9aae72d14 Merge "Fix warning with AAPT2 and LOCAL_STATIC_ANDROID_LIBRARIES" am: 1498712a6b am: 51c1eeefb3 am: 04158fac7c
am: c2e68615e7

Change-Id: I883c75d41f89d19317fce27135d87de7eef0b6ba
2016-12-02 22:48:02 +00:00
Colin Cross
fe10963496 Fix warning with AAPT2 and LOCAL_STATIC_ANDROID_LIBRARIES
Building with LOCAL_STATIC_ANDROID_LIBARIES and LOCAL_USE_APPT2
causes a warning:
build/core/package_internal.mk:143: Empty argument supplied to find-subdir-assets

Only call find-subdir-assets if my_res_dir is not empty.

Also improve the warning message to make it easier to find the module
that caused it.

Test: m -j
Change-Id: I9a71162c7e2ed82f64d6844baca256968ac77317
2016-11-29 11:12:56 -08:00
Colin Cross
b6e788ff89 Merge "Replace usages of my_register_name with my_all_targets" am: 077d9d5fe7 am: e373117cac am: 1f351ad75c
am: fba6042e11

Change-Id: Id807306cce8447e7170e9c344ce07eb6e03fda52
2016-09-21 02:56:39 +00:00
Colin Cross
3388670e78 Replace usages of my_register_name with my_all_targets
A few module types add extra dependencies on $(my_register_name), move
them to $(my_all_targets) so that they are built for mm and mma too.

Bug: 31526036
Test: mmm framework
Change-Id: I2e594ce771451a99691739b963f4ce517e9dd595
2016-09-20 16:03:50 -07:00
Dan Willemsen
4cb7686365 resolve merge conflicts of 8dadc2d to nyc-mr1-dev-plus-aosp
am: d111debc18

Change-Id: If1706cc449750030bedb56ecf1f2e60a91105ea3
2016-09-14 03:05:49 +00:00
Dan Willemsen
8e6e6fdba9 Remove incremental workaround for aapt overlays
This workaround to clean package intermediates is no longer necessary,
as ninja reruns commands whose command line changes.

Test: switch between product overlays that use add-resource, verify
      R.java is regenerated.
Change-Id: Icb1f76360e39882e4401180414a031956777b020
2016-09-12 20:30:12 -07:00
Adam Lesinski
4c45205c99 Add split support for AAPT2
AAPT2 allows the declaration of a split path, so that build systems
don't need to guess the auto-generated name.

Construct the split path we want from the configurations passed in to
LOCAL_PACKAGE_SPLITS.

Bug:30445078
Change-Id: I06a4148b283d0c6751751ba116e9482c3a6eae5d
2016-08-15 13:13:23 -07:00