Commit graph

603 commits

Author SHA1 Message Date
nelsonli
9009311630 Build System: Add variable for copying test config
If LOCAL_TEST_CONFIG is set, it will be the default test config
and ignore the local AndroidTest.xml.

BUG: 110982517
Test: vi art/tools/ahat/Android.mk
      set LOCAL_TEST_CONFIG := ahat_test.xml
      add ahat_test.xml in local
      m -j ahat;
      Then, out/host/linux-x86/testcases/ahat/ahat.config
      and ahat_test.xml should be the same.

Change-Id: I2f4ef735fca7d523bb637a18075512bdebf9826f
2018-08-05 01:35:06 +08:00
Nan Zhang
28af1e7484 Merge "Copy annotations.zip to out/target/common/obj/PACKAGING/" 2018-07-24 22:44:12 +00:00
Dario Freni
5f681e1dd7 Add support for /product-services partition
This CL is largely an adaptation of Change-Id
I774e6a38003734421591e51bed103802ff84f432

It adds the following variables:

- BOARD_AVB_PRODUCT_SERVICES_KEY_PATH
- BOARD_AVB_PRODUCT_SERVICES_ALGORITHM
- BOARD_AVB_PRODUCT_SERVICES_ROLLBACK_INDEX_LOCATION
- BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
- BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT
- BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT
- BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT
- BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN
- BOARD_PREBUILT_PRODUCT_SERVICESIMAGE
- BOARD_USES_PRODUCT_SERVICESIMAGE
- LOCAL_PRODUCT_SERVICES_MODULE
- PRODUCT_PRODUCT_SERVICES_BASE_FS_PATH
- PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION
- PRODUCT_PRODUCT_SERVICES_PROPERTIES
- TARGET_COPY_OUT_PRODUCT_SERVICES
- TARGET_OUT_PRODUCT_SERVICES
- TARGET_OUT_PRODUCT_SERVICES_*

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and flashed
on device. Also successfully built image with /system/product-services directory
and no /product-services partition.
Change-Id: I5d229f6ac729ea6df9ff1f14cee2e28972cd9b4d
2018-07-19 11:15:11 +01:00
Nan Zhang
77a8b394ee Copy annotations.zip to out/target/common/obj/PACKAGING/
Test: m out/target/common/obj/PACKAGING/metalava-api-stubs-docs_annotations.zip
Bug: b/78245848
Change-Id: I283e046afb0c6e420d251e9c974835a4ec2fbad4
2018-06-26 13:25:18 -07:00
Jiyong Park
1cf8ee619b Export SDK library names
A java module exports SDK library names that it is using directly or
indirectly via its dependencies. Manifest fixer uses the SDK lib names
to automatically add <uses-library> tags for the apk.

The SDK library names are exported via exported-sdk-libs file in make.
From Soong, they are exported via LOCAL_EXPORT_SDK_LIBRARIES flag.

Bug: 77575606
Test: m -j

Change-Id: I4e7a9bdc5bf845af85168abf55f8063900bacc72
2018-06-20 11:50:06 +09:00
Colin Cross
1d46e8abb4 Add LOCAL_DONT_MERGE_MANIFESTS
Some modules have manifests that ManifestMerger doesn't like, and
don't need manifest merging.  Skip manifest merger if
LOCAL_DONT_MERGE_MANIFESTS is set.

Bug: 78447299
Test: m checkbuild
Change-Id: If1a58253c62e0194a6acfd79930b9bb10978abe5
2018-06-14 14:38:54 -07:00
Colin Cross
1c3d83b64c Don't recompute location of AndroidManifest.xml
The location of AndroidManifest.xml has already been computed
by android_manifest.mk, don't duplicate the logic.  Fixes an
extra regeneration triggered by $(wildcard $(my_android_manifest))
when LOCAL_FULL_MANIFEST_FILE points to a generated file, which
will not exist on the first run of kati.

Test: m
Change-Id: Ia56693a4dbbc7d78900019b887f766938dc55dab
2018-05-17 15:09:17 -07:00
Mathieu Chartier
d022b65c98 Add support for preopt with uses-libraries
Required libraries are specified with LOCAL_USES_LIBRARIES
Optional libraries are specified with LOCAL_OPTIONAL_USES_LIBRARIES

The make rule cross references the libraries against what's stored
in the manifest.

Verification is enabled if LOCAL_ENFORCE_USES_LIBRARIES is true. This
defaults to true if either of LOCAL_USES_LIBRARIES or
LOCAL_OPTIONAL_USES_LIBRARIES are specified.

Bug: 70934104
Bug: 67345922
Test: manual

(cherry picked from commit 09f3b97f4b)

Merged-In: Ifca7d1a993620e9d0e42dc497a4a5d7a6c3f4172
Change-Id: I670431f938c31115a7812c1857c31b9f71675632
2018-05-10 11:52:26 -07:00
Alan Viverette
fb8f5baae4 Move Support Library dependencies to their own var with resolution
Bug: 73250914
Test: make checkbuild
Change-Id: Ibdbe2fd140133202b266ca4f233c4d42292fa3df
Merged-In: Ibdbe2fd140133202b266ca4f233c4d42292fa3df
(cherry picked from commit 53f6b2a80b)
2018-05-03 16:47:11 -07:00
Colin Cross
43c247e181 Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES
If a static android library lib1 has LOCAL_STATIC_ANDROID_LIBRARIES
lib2, then the R.class files for packages in lib2 will be merged
into the jar for lib1.  If an app has lib1 in its
LOCAL_STATIC_ANDROID_LIBRARIES it will get the R.class files from
lib2 through lib1, instead of regenerating the R.java files with
numbering that matches the resource table of the app.

This was worked around for support libraries by keeping a
fix_dependencies.mk that added transitive static support libraries
to the direct static dependencies of apps.  Instead, propagate
the packages that aapt2 generated R.java files for up as
--extra-packages arguments to the next aapt2 invocation, which
will force aapt2 to regenerate the R.java files for those packages.

Bug: 78300023
Test: m checkbuild
Change-Id: I7375e13241b4c4f2933032409fb7935abe133bfc
2018-05-02 13:11:08 -07:00
Treehugger Robot
2338a70f90 Merge "build/make: auto generate Test config file for Google Benchmark Test" 2018-04-20 21:16:00 +00:00
Anton Hansson
4ad0be36e3 Merge "Add support for specifying LOCAL_SDK_LIBRARIES for prebuilts." 2018-04-20 08:17:20 +00:00
Treehugger Robot
4c7d849a1b Merge "Allow tests to be disabled for presubmit check" 2018-04-19 20:43:54 +00:00
Anton Hansson
f5cefdcefb Add support for specifying LOCAL_SDK_LIBRARIES for prebuilts.
This new variable allows specifying libraries like this:
LOCAL_SDK_VERISON := 25
LOCAL_SDK_LIBRARIES := org.apache.http.legacy,
which would automatically pick up the prebuilt OAHL prebuilt
from prebuilts/sdk/25/public/org.apache.http.legacy.jar

Test: In master with uiautomator.
Bug: 77575476
Change-Id: Id8d92176f5b608c2bcea622b6aed4aa27c32e000
2018-04-19 15:18:55 +01:00
Nelson Li
eec9529de8 build/make: auto generate Test config file for Google Benchmark Test
BUG: 74844131
Test: cd bionic/; mm (auto generating the test config in out/)
      atest bionic-benchmarks (full testing in atest)
Change-Id: I0497eed876640893d0b82d4cde384d3608cf4875
2018-04-19 09:16:54 +00:00
Dan Shi
639c6ccf7a Allow tests to be disabled for presubmit check
A test can be disabled in two ways:
1. Add the test name to ALL_DISABLED_PRESUBMIT_TESTS variable.
   Integration tests (tests inside TradeFed) can only be disabled in
   this way.
2. In module config, set LOCAL_PRESUBMIT_DISABLED to true. This works
   for tests with build target.

This change allows tests to be skipped in presubmit check to be saved in
a list that's included in test-mappings.zip build artifact.

Bug: 74971025
Test: m dist -j test-mapping
Change-Id: I6e3016b017ce1ade024dc4ded72a10c778b88e7f
2018-04-17 12:07:31 -07:00
Chih-Hung Hsieh
32427d6903 Add USE_CLANG_LLD and LOCAL_USE_CLANG_LLD
* Current default is not using lld.
* When USE_CLANG_LLD or LOCAL_USE_CLANG_LLD is true or 1,
  * Use *GLOBAL_LLDFLAGS instead of *GLOBAL_LDFLAGS.
    GLOBAL_LLDFLAGS should call lld and with correct lld flags.
  * set my_pack_module_relocations to false.

Bug: 73768157
Test: make checkbuild
Change-Id: I3e63cf8ae0865d01d2bc1f36e9304f4a5d092cb8
2018-04-12 11:00:06 -07:00
Steven Moreland
3629aa77da Support manifest fragments.
LOCAL_VINTF_FRAGMENTS/vintf_fragments are
used to specify what manifest fragments should be installed
by a target.

Test: fragments get installed to the right location
Test: broken fragment gets detected
Test: boot device and verify service is working and manifest is updated
Test: verify OTA package contains fragments
Bug: 66917623
Change-Id: I21abe65a31b8c3d255c8ccd80e102ff3acb23105
2018-04-05 11:26:35 -07: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
Treehugger Robot
d3547d9d5b Merge "Enable apps to build with resource namespaces" 2018-03-14 21:05:55 +00: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
Adam Lesinski
960de8efcd Enable apps to build with resource namespaces
Setting LOCAL_AAPT_NAMESPACES := true enables
namespaces for an app and requires any library resources
to be fully qualified by their package.

Test: manual
Bug: 73885582
Change-Id: Ia6bfc82ee8b8d6335f8e7c2abe94ce36467a012d
Merged-In: Ia6bfc82ee8b8d6335f8e7c2abe94ce36467a012d
2018-03-14 12:04:01 -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
Nan Zhang
ccdecc7e02 Fix droiddoc variable name in clear_vars.mk
Test: m -j
Bug: b/70351683
Change-Id: I8cb4429a7e6bebde541a09f0328dddb937c0aced
2018-03-09 12:39:34 -08:00
Colin Cross
7874138a8a Allow soong java libraries to include exported resources and proguard flags
Test: m checkbuild
Change-Id: Ia02f816084d0eb1c0e0f20e1ecd57aaf3778874c
2018-03-07 09:48:33 -08:00
Treehugger Robot
5d7ec6bdf8 Merge "Export Make config vars to Soong to support Droiddoc" 2018-02-22 22:11:07 +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
Nan Zhang
cf9d50302a Export Make config vars to Soong to support Droiddoc
export Android.mk config vars to Soong, and export stubs.jar to Make
after compiling Droiddoc from Soong.

Bug: b/70351683
Test: Convert libcore docs Android.mk to Soong manually.

Change-Id: I749b4b3e1e50abce8a757130987c18d7135a3859
2018-02-15 16:10:21 -08:00
Treehugger Robot
9ffbc10126 Merge "LOCAL_HOST_REQUIRED_MODULES support" 2018-02-07 01:57:18 +00:00
Simran Basi
893098b06c LOCAL_HOST_REQUIRED_MODULES support
Allows target modules to directly request host modules they
require to be built and installed as well.

Bug: 72761631
Test: Added LOCAL_HOST_REQUIRED_MODULES to a target apk test and
      the host module was built.

Change-Id: I5aca11b3ba8b54676f068d337f1c9ba0e0b01997
2018-02-06 14:18:45 -08:00
James Lemieux
bb426739ce Clear local robolectric testing variables
This prevents them from mistakenly bleeding between test targets.

Bug: 72384841
Test: make Run_TeleService_robotests
Change-Id: Ie2c047be1450420f8e27b8b45e9416e96b477b45
2018-02-05 15:39:18 -08:00
Jaekyun Seok
b7735d8105 Support /product partition
This CL adds the following build flags to support building product partition
from Android build system.
- BOARD_AVB_PRODUCT_ADD_HASHTREE_FOOTER_ARGS
- BOARD_AVB_PRODUCT_KEY_PATH
- BOARD_AVB_PRODUCT_ALGORITHM
- BOARD_AVB_PRODUCT_ROLLBACK_INDEX_LOCATION
- BOARD_PREBUILT_PRODUCTIMAGE
- BOARD_PRODUCTIMAGE_EXTFS_INODE_COUNT
- BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
- BOARD_PRODUCTIMAGE_PARTITION_SIZE
- BOARD_PRODUCTIMAGE_SQUASHFS_BLOCK_SIZE
- BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR
- BOARD_PRODUCTIMAGE_SQUASHFS_COMPRESSOR_OPT
- BOARD_PRODUCTIMAGE_SQUASHFS_DISABLE_4K_ALIGN
- BOARD_USES_PRODUCTIMAGE
- LOCAL_PRODUCT_MODULE
- PRODUCT_FOOTER_ARGS
- PRODUCT_PRODUCT_BASE_FS_PATH
- PRODUCT_PRODUCT_VERITY_PARTITION
- TARGET_COPY_OUT_PRODUCT
- TARGET_OUT_PRODUCT*

And PRODUCT_PRODUCT_PROPERTIES is added to save product-specific
properties in /product/build.prop.

Bug: 64195575
Test: succeeded building product.img with BOARD_PRODUCTIMAGE_PARTITION_SIZE,
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE and PRODUCT_PRODUCT_VERITY_PARTITION.

Change-Id: I774e6a38003734421591e51bed103802ff84f432
2018-01-25 09:33:58 +09:00
Tobias Thierer
4bb18a8a2e Merge "Experimental feature: LOCAL_PATCH_MODULE option in .mk files." 2018-01-22 11:34:18 +00:00
Dan Shi
2035abfb8d Add a flag to disable auto-generating test configs.
Bug: 71714007
Test: m -j <module for *ts suite>
m -j NotificationStressTests
confirm NotificationStressTests.config generated

Change-Id: I372a227a07633ab8d335a8435baf5dd6081bb27e
2018-01-11 11:22:52 -08:00
Tobias Thierer
f795dcb767 Experimental feature: LOCAL_PATCH_MODULE option in .mk files.
Specifying this option causes the make target's sources
and classpath dependencies to be patched into the specified
module via --patch-module (if the build toolchain implements
the module system, ie. when targeting 1.9). This allows tests
to compile that have classes in packages under test.

Currently, only java.base is on the module path (everything
else is on the classpath), and only when using -target 1.9
(ie. EXPERIMENTAL_USE_OPENJDK9=true).

Bug: 71699916
Test: Treehugger
Test: Checked that I was able to compile some ojluni & icu
      test sources that had classes in (libcore) packages
      under test.

Change-Id: I044fb9d904754ed281f574ab3dd52235cf0d7fec
2018-01-11 01:13:13 +00:00
Colin Cross
5e0986cb51 Add R8 support to Soong.
Move R8_COMPAT_PROGUARD definition to Soong.
Copy the proguard_dictionary file so that the find
command that builds proguard_dict.zip can find it.

Test: m checkbuild
Change-Id: I28b2fce26ccb6225be0bd71802a43fe63df85daa
2018-01-03 14:21:35 -08: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
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
75a698b394 Export app implementation and header jars
Also fix a missing dependency on the jacoco-report-classes.jar

Test: m checkbuild
Change-Id: I67e924051e1029a409b82f2220811a27d5401db9
2017-12-15 13:41:24 -08:00
Xin Li
5f03da0404 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:30 +00:00
Treehugger Robot
0765d53239 Merge "Add build script to generate TF test XML file with filters" 2017-12-06 22:51:43 +00:00
Colin Cross
94b0dd3236 Merge "Add support for RRO in soong app prebuilts"
am: cd127ac860

Change-Id: I935b2f35e3642f2c8a4bf6f4e0b7ea8882df0bbc
2017-12-01 22:11:18 +00:00
Colin Cross
8c5ef24107 Add support for RRO in soong app prebuilts
Let soong pass overlay directories that were not used because
of enforced RROs and use the make rules to convert them to
the auto generated RRO package.

Bug: 69917341
Test: m checkbuild
Change-Id: I9db37e0bf65c19cef91428477713e3d7f1941b83
2017-11-30 20:22:12 -08:00
Colin Cross
863dcf07d4 Merge "Add support for jacoco in soong"
am: 9798690282

Change-Id: I47534d7346e637aff019b10bfc395254c618d29c
2017-11-28 21:18:48 +00:00
Colin Cross
7ae502ff64 Merge "Add LOCAL_SRCJARS to clear_vars.mk"
am: edd5f3810f

Change-Id: I894b5d2f2ac84eef65e6fdcf22c968317d4072b2
2017-11-28 19:45:40 +00:00
Colin Cross
3fec81d978 Add support for jacoco in soong
Use jacoco values exported from soong and copy
jacoco-report-classes.jar to where the jacoco-report-classes-all.jar
rule can find it.

Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false
Change-Id: If05381f415fb52a575746b8be0bfcd03d55b2153
2017-11-24 20:23:36 -08:00
Colin Cross
98341ab6d6 Add LOCAL_SRCJARS to clear_vars.mk
I064889c9063b642835d9f668e2568b61d0fabe35 added LOCAL_SRCJARS but
forgot to clear it in clear_vars.mk.

Test: m checkbuild
Change-Id: I7d4e6a3821db0eccb25042091aa599cab381a1b0
2017-11-24 11:26:43 -08:00
Dan Willemsen
9b0a730b14 Merge "Add LOCAL_AAPT2_ONLY"
am: da5fbe3c38

Change-Id: I0105575b63e8dca60fad8661443089d168cc0c0e
2017-11-18 02:23:30 +00:00
Dan Willemsen
bb6393c5a4 Add LOCAL_AAPT2_ONLY
This allows modules to specify that they may only be used from modules
using aapt2. Using aapt2 removes absolute path references to modules, so
this can be useful if a module is preparing to move its sources, or
replace itself with a prebuilt aar.

Test: m
Test: Label frameworks/support/design; m
Test: Label frameworks/support/v4; m
Test: build/soong/build_test.bash
Change-Id: Icfb3d4b19a6a0e3a3bb00091d2a97a4d88c0c761
2017-11-17 15:54:15 -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