Commit graph

129 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
Shinichiro Hamaji
e855fd6a59 Merge "Make apks depend on their certificates" am: f0a465c2cb
am: f562875d0c

* commit 'f562875d0c232b91be9a0931d30c31b1bbb98c45':
  Make apks depend on their certificates

Change-Id: I28f5f91a6265201136cdf83c18c7ada359bb4d33
2016-05-17 04:08:25 +00:00
Shinichiro Hamaji
641e61cb53 Make apks depend on their certificates
Bug: 27954979
Change-Id: I02db576cb80cbb9dd684d931da02e1b3b3efdf37
2016-05-13 16:03:24 +09:00
Sebastien Hertz
25f94a74fb Merge "Fix code coverage for apps" am: 2e8a1fc
am: 274a5a5

* commit '274a5a5efe1447ba4c13faf2f31c30d8b1dd72e5':
  Fix code coverage for apps

Change-Id: I751ee937222a76c2795f2dcdc0e2ca86ea7924d4
2016-04-05 09:27:39 +00:00
Sebastien Hertz
2319e56366 Fix code coverage for apps
When building apps with EMMA_INSTRUMENT=true, we must ensure that
jacoco is at least on the classpath (or even embedded for unbundled
branches) and that proguard will ignore jacoco classes. Otherwise
the Jack compilation would fail.

For unbundled build, we include the proguard configuration file
build/core/proguard.jacoco.flags to ignore jacoco classes.

For full build, we ensure jacoco is on the classpath during the
jack compilation.

Bug: 27607712

(cherry picked from commit d9641e01f3)

Change-Id: Ib46c91d03721f2418b15c17546d4f322f2f90a28
2016-04-04 10:48:02 +02:00
Ying Wang
81ef4714f4 Merge commit '1f07720f8518236e8438ae0f25ea7211da8c8c45' into manual_merge_1f07720
Change-Id: I5ad50aacbe99b4ebf8ae7e630f169100128b5b3c
2016-03-31 10:10:42 -07:00
Ying Wang
858657366f Remove support of disabling Jack.
We removed code and variables related to running dx on classes.jar in
this change. Also removed target emma rules (but kept the emma rules for
host java libraries), for it's now done by Jack.
We still support to build classes.jar (and javalib.jar for static Java
libraries) using javac, because tools like javadoc need class files as
input.
Removed the obsolete install-dex-debug.

Bug: 27400061
Change-Id: If0bcdfe62cb181a98754fb0dbe1c12c92e38d3e8
2016-03-30 14:03:12 -07:00
Ying Wang
6704f7e162 Merge "Set PRIVATE_TARGET_AAPT_CHARACTERISTICS even when running with the old aapt" into nyc-dev
am: 19b8145

* commit '19b81454479b2f6c438593304cd8c8f4c9ca77bc':
  Set PRIVATE_TARGET_AAPT_CHARACTERISTICS even when running with the old aapt

Change-Id: I4ebd15e849f5dd2c57c4e8679d140f184f999fa1
2016-03-29 21:39:28 +00:00
Ying Wang
19b8145447 Merge "Set PRIVATE_TARGET_AAPT_CHARACTERISTICS even when running with the old aapt" into nyc-dev 2016-03-29 21:31:24 +00:00
Ying Wang
6f9bd2a972 Set PRIVATE_TARGET_AAPT_CHARACTERISTICS even when running with the old aapt
In commit e758f9319d we switched from
TARGET_AAPT_CHARACTERISTICS to PRIVATE_TARGET_AAPT_CHARACTERISTICS in
add-assets-to-package but forgot to set the variable when we are running
the old aapt.

Bug: 27874886
Change-Id: I03ced3030dcb9f024eef5b23dbfd5d99157952ea
2016-03-29 12:41:42 -07:00
Allen Hair
0b900e7223 Merge "Only add jacocoagent if the package contains some java code." am: 616f086
am: d05fb8f

* commit 'd05fb8ff844864cf1c794ea31bc8c0b8c120c8a2':
  Only add jacocoagent if the package contains some java code.

Change-Id: I31ffd74f6b698be7e154501997de740071ec6865
2016-03-29 19:28:45 +00:00
Allen Hair
29b65c4e66 Only add jacocoagent if the package contains some java code.
Bug: 27877982
Change-Id: I8bf05d67a823402e7e488990753cc9005ec5e90b
2016-03-29 10:47:49 -07:00
Allen Hair
0f85562384 Only add jacocoagent if the package contains some java code.
Bug: 27877982
Change-Id: I8bf05d67a823402e7e488990753cc9005ec5e90b
2016-03-28 12:52:37 -07:00
Ying Wang
fbc5b9f56b Rebuild odex files in PDK fusion build.
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).

In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.

We generate prebuilt module only if it's not already defined in the
source tree.

Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
(cherry-pick from commit 3a61eeb6cb)
2016-03-25 11:06:04 -07:00
Ying Wang
c9a19779a2 resolve merge conflicts of fc16dca602 to nyc-dev-plus-aosp
Now we can remove all uses of $(ACP) in prebuilt_internal.mk.

Change-Id: I07a449f3acca9b56c6a387ff8ca1535d19c872d1
2016-03-15 14:46:12 -07:00
Ying Wang
3a61eeb6cb Rebuild odex files in PDK fusion build.
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).

In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.

We generate prebuilt module only if it's not already defined in the
source tree.

Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
2016-03-14 21:01:46 -07:00
Yohann Roussel
1501a9a8b5 Merge "Use Jack to check build" into nyc-dev 2016-03-03 08:47:41 +00:00
Ying Wang
9802ee73c5 Merge "Calls aapt2 when a static Java library has LOCAL_STATIC_ANDROID_LIBRARIES" into nyc-dev
am: 2a7af11a2c

* commit '2a7af11a2ca43768814c846cc05eec061d12e960':
  Calls aapt2 when a static Java library has LOCAL_STATIC_ANDROID_LIBRARIES
2016-03-03 01:11:11 +00:00
Yohann Roussel
57a54b4199 Merge "Use Jack to check build" am: 6a9d0f9718
am: 4fd0463191

* commit '4fd0463191b316fd80b2ec8c0ba33bb5fcf5aa16':
  Use Jack to check build
2016-03-02 09:14:20 +00:00
Yohann Roussel
6a9d0f9718 Merge "Use Jack to check build" 2016-03-02 08:46:24 +00:00
Dan Willemsen
23afb78cf9 Merge commit 'cdaf748e3abefd93a4e45393e96717fad8564c51'
Change-Id: I3c44564b08ed46f46719dbca54d4225718bb8c59
2016-03-01 15:36:08 -08:00
Dan Willemsen
7f016150a0 Remove unused dependencies on $(ACP)
Most of these are calling to copy-file-to-target or similar, which no
longer use $(ACP).

Change-Id: I62287a80c577c34df587b74e70055c2f56050ce7
2016-03-01 13:15:35 -08:00
Ying Wang
e585397497 Calls aapt2 when a static Java library has LOCAL_STATIC_ANDROID_LIBRARIES
We expect to build the module's own packare-res.apk from the
LOCAL_STATIC_ANDROID_LIBRARIES in this case.

Bug: 25958912
Change-Id: I4d0294c867f5fb636983d630493a3b188279cae9
2016-03-01 12:08:26 -08:00
Yohann Roussel
e792abc2d9 Use Jack to check build
Run jack with no outputs as a quick check for compilation errors and use
a timestamp to store that check was made.

Bug: 19069325

(cherry picked from commit 43084d9f49)

Change-Id: I9b84b503b28cfdfa245f91da0061ee3a79386b28
2016-03-01 16:57:20 +01:00
Yohann Roussel
ee57268cd7 Use Jack to check build
Run jack with no outputs as a quick check for compilation errors and use
a timestamp to store that check was made.

Bug: 19069325

(cherry picked from commit 43084d9f49)

Change-Id: I9b84b503b28cfdfa245f91da0061ee3a79386b28
2016-03-01 16:34:08 +01:00
Adam Lesinski
e758f9319d AAPT2: Enable product/config filtering and improve source ordering
- Restore old ordering of resource files to match AAPT behavior
- Change the order in which overlays are processed.

Change-Id: I9da88f6b4124e7f89a70eb485b4591d5c4c87d38
2016-02-26 16:11:20 -08:00
Ying Wang
e295c3df68 AAPT2: library resource compilation
- Switch to static library's package-res.apk as the link artifact.
- For prebuilt AAR file, build package-res.apk using aapt2's "--dir"
  option.
- New LOCAL variables:
  LOCAL_USE_AAPT2: a module can opt-in with "LOCAL_USE_AAPT2 := true".
  LOCAL_STATIC_ANDROID_LIBRARIES: static Java libraries with compiled
                   resources.
  LOCAL_SHARED_ANDROID_LIBRARIES: shared Java libraries with compiled
                   resources.

Bug: 25958912
Change-Id: I4be2d1e8137555986338c2583cb39b0c97391751
2016-02-26 10:44:56 -08:00
Sebastien Hertz
8192d3b821 Merge "Support code coverage with Jack" am: 4dad88980f
am: 7b02e64148

* commit '7b02e64148e6a1c0355d715b2a8034061f0d2837':
  Support code coverage with Jack
2016-02-02 09:13:57 +00:00
Sebastien Hertz
dfce8ad4f4 Support code coverage with Jack
Building an app with Jack and with the environment variable
EMMA_INSTRUMENT_STATIC set to true will apply code coverage
onto the app targeting Jacoco.

Bug: 20115492
Change-Id: Ief3640fa3faa466f7f6aaa9739e06d3db24110a0
2016-01-27 19:14:14 +01:00
Ying Wang
dd71c85a45 Support to build with AAPT2
To build with AAPT2, set "USE_AAPT2=true".
TODO: Support split apks and generated resources from other than renderscript.

Bug: 25958912
Change-Id: I19b1a038824ce5b2a3d3ffadbce3173c845193fc
2016-01-25 22:41:43 -08:00
Alex Klyubin
f29904e889 Merge "Do not run zipalign when building APK (except prebuilts)." am: b437f58006 am: fddfc2c604
am: 60d6e2eb00

* commit '60d6e2eb002b12c28c0f28527c020837adea9164':
  Do not run zipalign when building APK (except prebuilts).
2015-12-08 03:04:50 +00:00
Alex Klyubin
5b826ac609 Do not run zipalign when building APK (except prebuilts).
This changes the build system to no longer run zipalign except for
those prebuilts which do not need to re-signed.

Running zipalign is no longer needed because signapk takes care of
alignment. For those prebuilts which do not need to be re-signed
signapk is not invoked and thus zipalign is still needed because the
prebuilts may not have been aligned properly. This exemption will go
away once prebuilts are properly aligned.

Bug: 25794543
Change-Id: I31f10af80b9baa3c9481cb36f41e5e5046e852f9
2015-12-04 10:15:06 -08:00
Michael Wright
0fb087fc73 Add new Test API for CTS testing.
Bug: 25608286
Change-Id: I0334061b548970959e46392dc3a1feed8533548c
2015-11-25 11:38:44 +00:00
Ying Wang
3799a8a534 Merge "Tag "tests" alone doesn\'t prevent including emma.jar" am: a23a97e3bf am: 7c09c937b6
am: 1704a32d40

* commit '1704a32d40d181a659a25e2c69e51ef9b719f818':
  Tag "tests" alone doesn't prevent including emma.jar
2015-11-06 19:36:43 +00:00
Ying Wang
324ffb2785 Tag "tests" alone doesn't prevent including emma.jar
Only if an app has LOCAL_INSTRUMENTATION_FOR, it can get the emma
classes from the target app and we don't need to instrument the test app
itself.

Change-Id: If0fba50ddae757254fc58ca104d729d61603fd78
2015-11-06 11:22:28 -08:00
Ying Wang
62170e2004 Merge "Make sure R.stamp is always created" am: 47e46f7725 am: 3d7584d9c3
am: a34fb5fe34

* commit 'a34fb5fe3445bf6f185720a3f029da4d39268dc6':
  Make sure R.stamp is always created
2015-10-23 18:27:25 +00:00
Martin Arenlind
fb6985e4dc Make sure R.stamp is always created
When an app has a resource directory, but the
directory contain no resources, R.stamp is not created.

This leads to that such apps are always rebuilt,
even when there are no changes.

This patch changes so that an empty R.stamp is
created even if there are no resources.
This leads to that affected apps are not rebuilt
unless changed.

Change-Id: Ia63e5b1913a4456402700b615ba7f9d56d2da852
2015-10-23 11:07:28 -07:00