Commit Graph

1585 Commits

Author SHA1 Message Date
Nelson Li ed516e293d Merge "Revert "Revert "Build System: Solve dependency problem for test""" am: 795721ac2a am: 3c4c86943c
am: fd71578493

Change-Id: I369b55cbd93ff3dd679fdbc67cb05c712ca3ed5f
2019-03-13 21:43:13 -07:00
Nelson Li 1f8357fe7d Revert "Revert "Build System: Solve dependency problem for test""
This reverts commit 6fe7f194b9.

Reason for revert: Fixed all build break.

Change-Id: I0a4842df1225399752515a4cd7a7c14173a5bf7b
2019-03-14 01:05:36 +00:00
Nelson Li f5a4af9e91 Merge "Revert "Build System: Solve dependency problem for test"" am: 8924400a8a am: abc1617463
am: 87a4a179e1

Change-Id: I9e4095865afd148d7e7aec163d0430dd2e497d3d
2019-03-11 15:32:57 -07:00
Nelson Li 6fe7f194b9 Revert "Build System: Solve dependency problem for test"
This reverts commit 224e103308.

Reason for revert: Build Breakage in git_pi-dev-plus-aosp/docs @5366136
make -j110 docs showcommands dist DIST_DIR=/buildbot/dist_dirs/git_pi-dev-plus-aosp-linux-docs/5366136 checkbuild
FAILED:
 Dependencies in out found with no rule to create them:
 out/target/product/generic/data/app/CtsVerifierTester/CtsVerifierTester.apk
 out/target/product/generic/data/app/TradeFedTestApp/TradeFedTestApp.apk
 out/target/product/generic/data/app/TradeFedUiTestApp/TradeFedUiTestApp.apk
 15:53:46 stopping
and
make -j50 showcommands dist TARGET_PRODUCT=cf_x86_phone DIST_DIR=/buildbot/dist_dirs/git_master-linux-ndk_translation_all/5366149 ndk_translation_all
FAILED: ninja: 'out/target/product/vsoc_x86/data/nativetest/arm/arm_insn_tests_arm_static/arm_insn_tests_arm_static', needed by 'out/target/product/vsoc_x86/obj/PACKAGING/ndk_translation_tests_intermediates/arm_insn_tests_arm_static_result.xml', missing and no known rule to make it
15:55:38 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1
Return Code: 2

Change-Id: Idf95ef2e06526a0a31690420c923207db627605f
2019-03-11 16:48:29 +00:00
nelsonli 6e17758737 Merge "Build System: Solve dependency problem for test" am: 15e76e3848 am: 740ac49c83
am: 6e62c0bdaa

Change-Id: Ic1786c6b153ab105400aa1e2c78101fa288ee913
2019-03-11 08:34:40 -07:00
nelsonli 224e103308 Build System: Solve dependency problem for test
1. A test can add a runtime dependent test module by just setting
   LOCAL_REQUIRED_MODULES or LOCAL_TARGET_REQUIRED_MODULES. Then the dependent test
   module will be copied to testcase folder.
2. Do not install to $(TARGET_OUT_DATA) for testcase

BUG: 117224272

Test: 1. (a) vi cts/tests/tests/text/Android.mk
         (b) add LOCAL_REQUIRED_MODULES := CtsPrintTestCases
         (c) m -j CtsTextTestCases
         (d) Then, CtsPrintTestCases should also be built to testcase folder like below.
             ./target/product/generic_arm64/testcases/CtsPrintTestCases

Change-Id: I24ea3783486c54a05cfa9d3d0375b977afc230f8
2019-03-07 14:08:35 +08:00
Nicolas Geoffray e7379ba071 Merge "Pass the --api-flags to appcompat explicitly." am: 53cfd9275b am: 40ccefa404
am: 05cee18432

Change-Id: I89ab19518261acaf22565fc608611231288b7a70
2019-03-04 06:31:55 -08:00
Nicolas Geoffray 53cfd9275b Merge "Pass the --api-flags to appcompat explicitly." 2019-03-04 14:14:39 +00:00
Colin Cross 62fc068b69 Merge "Use flags from Soong for d8 and r8" am: 5852c93585 am: fb770b4f84
am: ecc4607403

Change-Id: I863876bb8139fd8c5aceb97f4fde51f2df3697ff
2019-03-01 07:51:15 -08:00
Nicolas Geoffray ac1f90c39c Pass the --api-flags to appcompat explicitly.
Bug: 125794065
Test: m && appcompat logs contain data
Change-Id: Idef875138d6670efc9ed7b9c63f653229b173d3e
2019-02-28 13:51:14 +00:00
Colin Cross 17ea341950 Use flags from Soong for d8 and r8
Use the flags provided by Soong when running d8 and r8.

Bug: 119270658
Test: m checkbuild
Change-Id: I9459ded386effc27c4c96f1e94f9ea2f8ed19319
2019-02-21 15:04:37 -08:00
Colin Cross 44bc5d6323 Merge "Make copy-many-files take an optional destination directory" am: ceaf716a3d am: e95dc4e3cc
am: da37ee584c

Change-Id: I5b81e3c051dfc15e2bf027be1857d5cf0553ac59
2019-02-13 17:02:19 -08:00
Colin Cross dc53f450af Make copy-many-files take an optional destination directory
Test: m checkbuild
Change-Id: I777952d27bd1a0cf2608e080a0f46e39268784ce
2019-02-13 08:03:25 -08:00
Colin Cross e8903ad55c Merge "Make manifest and APK agree on uncompressed native libs" am: 010df4b471 am: b568c2e15d
am: 2197223be0

Change-Id: Iafc06c2cfb9ccdcb3d6774863c1a146977277ded
2019-02-08 18:55:22 -08:00
Colin Cross ead7b66590 Make manifest and APK agree on uncompressed native libs
Only put uncompressed native libs in an APK if the min_sdk_version
supports it (>= 23, Marshmallow), and set
android:extractNativeLibs="false" in the AndroidManifest.xml so
that the platform won't extract them anyways.

Bug: 117618214
Test: m checkbuild
Change-Id: Iae26e4676c29c68fa3f76187512c82786bfa0522
2019-02-07 21:44:12 -08:00
Colin Cross 58ba970763 Merge "Consolidate sdk version handling" am: 2b526bf7f3 am: 5e2b2c666d
am: 1403c05cc8

Change-Id: I0cb43b0b62692faf23e6ad9ed23a2f4a4ead4936
2019-02-07 18:55:15 -08: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
Colin Cross c15321795a Merge "Move hiddenapi singleton rules to Soong" am: 6d1ae7a015 am: 4d2fbfd232
am: 38513055b3

Change-Id: Ib094f9f615c914750629bc45bcbdb0102182f6ef
2019-02-07 00:09:18 -08: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
Adrian Roos b5724ecfbf Merge "Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true" am: 61ae763ec4 am: 840b7b3df2
am: 3c1e101f6d

Change-Id: Iea80bf83b6b051b608c13d27e6f13fed33f50fec
2019-01-31 12:06:10 -08:00
Treehugger Robot 61ae763ec4 Merge "Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true" 2019-01-31 19:25:59 +00:00
Joe Onorato 4abc14b9ed Merge "When using inherit-package for a test, also allow specifying a new test suite." am: c51c523b88 am: ac00ab680e
am: f1847c0a18

Change-Id: Ibac629980c5794b00f0c2e31b9c4c27aef132e55
2019-01-25 17:20:45 -08:00
Adrian Roos 21028b7ad6 Remove dependencies on hiddenapi files with UNSAFE_DISABLE_HIDDENAPI_FLAGS=true
Fixes: 122957987
Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true make droid
Change-Id: Iafef8cc69971fd10718882326fbba99a6223d0f8
2019-01-25 17:35:25 +01:00
Joe Onorato 62472b676a When using inherit-package for a test, also allow specifying a new test suite.
Test: make
Change-Id: I2c9b5d998e6cc3159e4d23d7547bfd0b865f714c
2019-01-23 14:50:07 -08:00
David Brazdil 85b0346b7a Replace hiddenapi-{public,private}-list.txt with a CSV file am: fc274bab4d am: a1a433b368
am: 0e4ce6c0e1

Change-Id: Ib8c051aa4c41b83a1530a964c2ed54af3283611a
2019-01-21 12:08:22 -08:00
David Brazdil fc274bab4d Replace hiddenapi-{public,private}-list.txt with a CSV file
`hiddenapi` is being refactored to work with a single CSV file as
opposued to a multitude of text files (one per flag). This patch
changes the singleton rule for listing public/private APIs from
stubs to expect a CSV as an output.

Bug: 119068555
Test: compiles, hiddenapi-flags.csv unchanged
Change-Id: If56c7ab8a4c3bbd33e447ef0dfd33f2c303a937c
2019-01-19 15:57:35 +00:00
Colin Cross 748e839bdf Merge changes from topics "hiddenapi-soong", "hostdex_install" am: d61a1aba36 am: 9cfe03b9d5
am: b1e0d646e6

Change-Id: Ib2b539012d410a54489e2845c2d7707c1fec42e7
2019-01-17 15:54:28 -08:00
Colin Cross 49adea3bd8 Move hiddenapi to Soong
Perform hiddenapi CSV generation and dex encoding for Soong modules
in Soong.  This fixes an issue where dexpreopting was happening on
a different jar than was being installed.

Bug: 122856783
Test: m checkbuild
Change-Id: I24a235c63ff62fed7e1af9f2fd17e55b0c1598a5
2019-01-17 10:23:10 -08:00
Jeongik Cha 0a87686514 Merge "Dump and enforce certificate for apks" am: bdf0ec03b6 am: 237303f1e2
am: b10dfc9222

Change-Id: I8836193364ea0b21ed0af6beac75250fca192496
2019-01-10 20:50:00 -08:00
Jeongik Cha bdf0ec03b6 Merge "Dump and enforce certificate for apks" 2019-01-11 04:31:02 +00:00
Dan Willemsen 19fd4d0842 Merge "Stop trying to read depfile from vtsc" am: 82f2cb078f am: d372e54742
am: afbfff0d2d

Change-Id: I4f336a2f8b6d3fce8b1529a0e50a82d15b12d008
2019-01-10 10:12:19 -08:00
Jeongik Cha b2c4bb7e3d Dump and enforce certificate for apks
Dump the list of APKs that aren't located at system partition and signed
with system certificate.
And when enforcement option is enabled, it makes build error if there is
the apk that satisfies the condition above.

Bug: 74699609

Test: m -j
Test: m out/target/product/$(get_build_var TARGET_DEVICE)/certificate_violation_modules.txt

Change-Id: I23c41f2665dd97abac3e77d1c82d81ff91b894eb
2019-01-10 11:37:22 +09:00
Dan Willemsen 5125746561 Stop trying to read depfile from vtsc
vtsc just ignores the -d argument and apparently can't write a depfile.
So for now, just stop assuming it produces one.

Bug: 121058584
Bug: 120496070
Test: NINJA_ARGS="-w missingdepfile=err" m libvts_interfacespecification
Change-Id: Ie1483fbeead9f710d8a6636df07ce44bbc4a6e2d
2019-01-09 16:40:58 -08:00
Mathew Inwood 0fa280036b Fix hiddenapi-greylist.csv generation.
It was referring to a non-existant macro paramater resulting in empty
output.

Test: m out/target/common/obj/PACKAGING/hiddenapi-greylist.csv
& then check output.

(cherry picked from commit 8626c8ea95)

Change-Id: Ib48042ecca320c4d7c3a27959e41e5c55099b27a
Merged-In: Ib48042ecca320c4d7c3a27959e41e5c55099b27a
2019-01-07 14:59:51 +00:00
Tor Norbye 58027e26aa Merge "Switch apicheck over from doclava to metalava" am: 5ca77c512c am: 52c520096b
am: 30905d6ef7

Change-Id: I4e3187cf8980ada64e7b65eb34a14b8fa2abd675
2019-01-06 08:34:26 -08:00
Tor Norbye cb58fa13df Switch apicheck over from doclava to metalava
Apicheck seems to only be used for signature file
conversion and diffing at this point.

Test: make dist
Not Yet Merged In Ib8c09ba7f85fbb48526132ca8cc85856d63ca407
Change-Id: I5ca70a019ef4f7828f0a566f7745fc2dbf673b2e
2019-01-01 13:18:04 -08:00
Dario Freni 91bfcc3d3c Merge "Log only errors when invoking veridex." am: 17e9a79fb0 am: a56b6fb49a
am: 3f95d38e05

Change-Id: I3d9bbb01bed418951e2ff7d28f7e58561df0a6a0
2018-12-19 16:25:27 -08:00
Dario Freni ee835c736b Log only errors when invoking veridex.
Test: m
Bug: 121225084
Change-Id: I7e8cfbb7b0bcdb3f8d941086ce920da38d558145
2018-12-19 18:24:53 +00:00
Mathew Inwood 8626c8ea95 Fix hiddenapi-greylist.csv generation.
It was referring to a non-existant macro paramater resulting in empty
output.

Test: m out/target/common/obj/PACKAGING/hiddenapi-greylist.csv
& then check output.

Change-Id: Ib48042ecca320c4d7c3a27959e41e5c55099b27a
2018-12-05 17:51:37 +00:00
Jaewoong Jung 594e6b0d0e Merge "Use debug mode when running R8 for eng builds." am: 58b7f7480f am: 2623318e10
am: 64f54d3991

Change-Id: Iaf3b88bfa92ac42e7a22e88b31cf64e3b61b015f
2018-12-03 07:58:47 -08:00
David Brazdil 451f79b072 Merge "Replace hidden API lists with a single CSV" am: 8d8d4584f8 am: 3ca0bb066f
am: 26a968f409

Change-Id: I8bb7be6147e826ddbe5c6fe52e04361bbba87a02
2018-12-03 06:34:25 -08:00
Jaewoong Jung 58b7f7480f Merge "Use debug mode when running R8 for eng builds." 2018-11-30 22:40:45 +00: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
Jaewoong Jung b3113da542 Use debug mode when running R8 for eng builds.
Bug: 119601874
Test: Built for different variants.
Change-Id: Icaf300c944b1d0594f524a11999cc5a8229919eb
2018-11-28 15:19:46 -08:00
Yi Kong f41d24acb3 Merge changes I52805f5d,Ifb16ed87
* changes:
  Allow projects to exclude from libcrt_builtins
  Move libgcc to libcrt.builtins
2018-11-13 21:56:47 +00:00
Anton Hansson c3229f62c7 Merge "Quote message in echo-error/echo-warning macros" am: 1cdbf8f2bd am: 224210eaba
am: a1cd25650a

Change-Id: I23f135b024feb381e1a62cd696482dd2331b1ac6
2018-11-09 10:19:39 -08:00
Anton Hansson 1cdbf8f2bd Merge "Quote message in echo-error/echo-warning macros" 2018-11-09 17:59:59 +00:00
Anton Hansson 700db42d54 Quote message in echo-error/echo-warning macros
Makes pretty-error and pretty-warning behave more like $(error) and
$(warning), where you don't need to do things like quote parentheses.

Bug: 118833208
Test: trigger the private_apis && sdk set error in sdk_check.mk,
      which no longer produces bash syntax errors

Change-Id: I766ff98ad4e652f59dbef9dd5654f1cd10a2d038
2018-11-09 08:59:25 +00:00
Yi Kong 95fd9d171d Move libgcc to libcrt.builtins
libgcc is kept behind libcrt.builtins to provide unwinder symbols and
any other missing symbols.

Bug: 29275768
Bug: 119007754
Test: m checkbuild
Change-Id: Ifb16ed87afc3391f8830d771971315515f929235
Merged-In: Ifb16ed87afc3391f8830d771971315515f929235
(cherry picked from commit b9d8932279)
2018-11-08 13:40:34 -08:00
Yi Kong b9d8932279 Move libgcc to libcrt.builtins
libgcc is kept behind libcrt.builtins to provide unwinder symbols and
any other missing symbols.

Bug: 29275768
Bug: 119007754
Test: m checkbuild
Change-Id: Ifb16ed87afc3391f8830d771971315515f929235
2018-11-06 13:04:37 -08:00
Dan Shi 3e7b6d1c69 Merge "Copy shared libraries used by tests to testcases directory" am: 8b86ca8827 am: 0f4e535493
am: 550340760c

Change-Id: If1eaf53fca029de23eef2e43bb70dd7386735ff2
2018-11-05 13:39:26 -08:00
Dan Shi 6fe5bf0adb Copy shared libraries used by tests to testcases directory
This change collects the shared libraries files used by tests in
suite, and deploy the files to testcases/lib*. The shared libraries then
can be zipped in general-tests.zip and device-tests.zip. And the host
test can be run in TradeFed host based on build artifacts.

Bug: 111486845
Test: m -j general-tests; m -j device-tests
Confirm the test can run in testcases directory:
out/host/linux-x86/testcases$ ./net_test_avrcp/x86_64/net_test_avrcp
unzip general-tests.zip, confirm net_test_avrcp can run.

Change-Id: I4f9322118aa4891226ea318cbd1bcee6ca48b050
2018-11-04 19:51:59 -08:00
David Brazdil 6df1b0983c Merge "Revert^4: Change command-line flags of hiddenapi" am: 4438e0bb8e am: 88e7af76fa
am: fda97d6aa6

Change-Id: Ife4a18a9397f427459007827ebbeb72aa56be46d
2018-10-30 03:27:10 -07:00
David Brazdil 4438e0bb8e Merge "Revert^4: Change command-line flags of hiddenapi" 2018-10-30 10:02:20 +00:00
David Brazdil 9007e530aa Revert^4: Change command-line flags of hiddenapi
The `hiddenapi` build tool now reads a dex file from one filename
and writes a modified dex file to another. Change the build rule
to reflect it.

This reverts commit d8c427fbba.

Change-Id: Ic9a4188a65f7a6fb28edae1aeda7422e93800c58
Test: m
2018-10-27 21:46:19 +00:00
Paul Hobbs 06cc313c0f Merge "Revert "Revert^2: Change command-line flags of hiddenapi"" am: 27ec8b868e am: 741724f25e
am: a006361b50

Change-Id: Ie8abc2ba7a47cc743e753373c8a939c68dfae69f
2018-10-26 10:46:46 -07:00
Paul Hobbs 27ec8b868e Merge "Revert "Revert^2: Change command-line flags of hiddenapi"" 2018-10-26 17:22:35 +00:00
Luman Qu d8c427fbba Revert "Revert^2: Change command-line flags of hiddenapi"
This reverts commit e9540386e2.

Reason for revert: Caught by droidcop https://b.corp.google.com/issues/118481351

Change-Id: I66e45ef5a84d63682e5c33c9aa1e708160606611
2018-10-26 16:53:09 +00:00
David Brazdil 3ed7d14189 Merge "Revert^2: Change command-line flags of hiddenapi" am: 6d0b0f6103 am: cdac626a1d
am: 0f33abc3e7

Change-Id: Ifc8fcbc13fb9d674f4f9b7882261f0690b61c6ed
2018-10-26 02:43:56 -07:00
David Brazdil 6d0b0f6103 Merge "Revert^2: Change command-line flags of hiddenapi" 2018-10-26 09:19:23 +00:00
David Brazdil e9540386e2 Revert^2: Change command-line flags of hiddenapi
Change command-line flags of hiddenapi

The `hiddenapi` build tool now reads a dex file from one filename
and writes a modified dex file to another. Change the build rule
to reflect it.

This reverts commit 5381eb684e.

Test: m
Change-Id: I8d37935c5ea381348278ec668d474f6ffb8e8411
2018-10-25 17:25:23 +00:00
Colin Cross 99ba50e5e6 Merge "Reduce the propagation of LOCAL_DEX_PREOPT := nostripping" am: aefeae367e am: afabdbcc8b
am: 74cd0c4525

Change-Id: I2ee102dcf101677a866cabc125cc27e526fc6702
2018-10-24 11:28:27 -07:00
David Brazdil 5cbb887495 Merge "Revert "Change command-line flags of hiddenapi"" am: 70b26e5c98 am: a683633732
am: 77f8040a5c

Change-Id: I1e0f4509f841d807609873b09e7d62f1ce16af26
2018-10-24 05:59:21 -07:00
David Brazdil 5381eb684e Revert "Change command-line flags of hiddenapi"
This reverts commit 6b00bfd2fb.

Reason for revert: marlin running out of space

Exempted-From-Owner-Approval: Needed to unblock build, no
  buildcops on call in EMEA today.
Change-Id: I9e86545c8ada2523bc21116c6e958f69fb94dc26
2018-10-24 12:37:41 +00:00
David Brazdil 1ee485702a Merge "Change command-line flags of hiddenapi" am: 7658657ee4 am: a80d9ccbdd
am: 6ec87655fb

Change-Id: I05646eeeca4055079319fe057c960330fd5b8a48
2018-10-24 02:37:41 -07:00
David Brazdil 7658657ee4 Merge "Change command-line flags of hiddenapi" 2018-10-24 09:19:00 +00:00
Colin Cross fc782ad949 Reduce the propagation of LOCAL_DEX_PREOPT := nostripping
nostripping causes confusing double negatives, allow nostripping
in LOCAL_DEX_PREOPT and DEFAULT_DEX_PREOPT, but convert to
LOCAL_STRIP_DEX outside of dex_preopt_odex_install.mk.

Test: m checkbuild
Change-Id: I996e9258ce20c394900d9fe937d638bc2ab8589d
2018-10-23 22:33:07 -07:00
Mathew Inwood 9b5e92e92b Merge "Put maxTargetSdk=P APIs onto light greylist." am: 5546a543ce am: 5d4f39cbb6
am: ece9efdbaa

Change-Id: Ida3330e89bfd5710ced7ba35c6c31c49f9064335
2018-10-22 09:35:48 -07:00
Treehugger Robot 5546a543ce Merge "Put maxTargetSdk=P APIs onto light greylist." 2018-10-22 15:56:49 +00:00
David Brazdil 6b00bfd2fb Change command-line flags of hiddenapi
The `hiddenapi` build tool now reads a dex file from one filename
and writes a modified dex file to another. Change the build rule
to reflect it.

Test: m
Change-Id: I2c4b080dbfdf348f230e7544c228cfd7419d1c64
2018-10-22 14:08:21 +01:00
David Brazdil c6c75a6564 Merge "Add UNSAFE_DISABLE_HIDDENAPI_FLAGS to skip hiddenapi processing" am: 6a038d662b am: 3613f69675
am: 0dff3fc393

Change-Id: I2b7384c56dff8b0ab661f5f4c81b36faddb7d6ab
2018-10-22 06:00:18 -07:00
Mathew Inwood bcde1c52a6 Put maxTargetSdk=P APIs onto light greylist.
Since the per-SDK level enforcement support is not ready in ART yet, we
can't implement the correct enforcement for maxTargetSdk=P. Putting these
APIs on the dark greylist causes problems for existing apps, so put them
on the light greylist instead.

Test: m
Bug: 117899984
Change-Id: Ib3dad2f50eb6a769ba9f21cec4bac01275888ef6
2018-10-22 13:44:15 +01:00
David Brazdil 6a038d662b Merge "Add UNSAFE_DISABLE_HIDDENAPI_FLAGS to skip hiddenapi processing" 2018-10-22 12:43:39 +00:00
Dan Willemsen 9dda44fc51 Merge changes from topic "refactor_dist" am: ac270964f1 am: 92d1847f56
am: a94e9a6e38

Change-Id: I8cc3adf3249ffa3010249c7240dc4ccb76376de3
2018-10-20 16:04:44 -07:00
Dan Willemsen 7ddc50a066 Refactor common makefile fragments
In preparation for setting up another Kati stage, move some common
settings and tools into a common folder. This way it's a bit easier to
see that they're safe to use, and that they shouldn't depend on anything
outside of the common folder.

Bug: 117463001
Test: build-aosp_arm.ninja is the same before and after
Change-Id: Ief4b75a4dbe45b73ffd03bf32c60695c816d979d
2018-10-20 14:43:58 -07:00
David Brazdil 8a6b9a7baf Add UNSAFE_DISABLE_HIDDENAPI_FLAGS to skip hiddenapi processing
Setting environment variable UNSAFE_DISABLE_HIDDENAPI_FLAGS=true
will skip the build step which annotates dex files with information
about public and non-public API membership. This is meant to speed
up incremental local builds.

USE AT OWN RISK: Dex files built with this flag will execute with
hidden API access checks disabled and therefore may exhibit different
behaviour compared to production code.

WARNING: Some JARs cannot be compiled with this flag as ART hardcodes
hidden API access flags of intrinsified methods. Attempting to compile
dex files containing such methods will trigger an assertion.

Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true mmm frameworks/base
Bug: 113278235
Bug: 112388925
Change-Id: I51fe99ab53e1bb2aa0db64b22a321dd1e1ed47e1
2018-10-19 20:16:49 +01:00
Mathew Inwood 31175015c5 Merge "Write greylist annotation metadata to a csv file." am: c948d1a101 am: 964070be62
am: 592d644e83

Change-Id: I9d7dc5e8b0d723c4ee81abc17b7aabaca1bdee5e
2018-10-18 08:25:07 -07: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
Colin Cross ed2120d57e Merge "Remove extra JNI libs from prebuilt APKs" am: 0443b46066 am: 4e04fff35e
am: 1ac0bbefc1

Change-Id: I9d645b071472af437b5f037091789d427c060422
2018-10-10 20:01:25 -07:00
Treehugger Robot 0443b46066 Merge "Remove extra JNI libs from prebuilt APKs" 2018-10-09 22:35:26 +00:00
Colin Cross 0e8a2ee172 Remove extra JNI libs from prebuilt APKs
If an APK specifies LOCAL_PREBUILT_JNI_LIBS embedded in the prebuilt
APK, remove any that aren't listed.  Restores the behavior from before
I82dd3aa441712772a1d1ddd6aaf5f41179facaa7.

Bug: 69500920
Test: m checkbuild
Change-Id: I971a9c4206604c172d77144df4c0ed9a8b1c5dd0
2018-10-09 13:06:01 -07:00
nelsonli 7e618d9423 Merge "Build System: Ignore copies in copy-many-files if src == dst" am: 5112afe657 am: f52da96e11
am: 3cd2b2f563

Change-Id: I5b8148f7fd3f4a0899ab01e3a525c11008c91452
2018-10-09 03:47:21 -07:00
nelsonli c91284dcd8 Build System: Ignore copies in copy-many-files if src == dst
BUG: 117224272

Test: 1. Modify build/core/base_rules.mk
         Add the following line after line 617
	  $(eval my_compat_dist_$(suite) += out/a:out/a))
      2. touch out/a
      3. make -j BluetoothInstrumentationTests
      4. It should build pass without any dependency errors.

Change-Id: I40372eab5b74e042f605c3cb38e72942531ed69a
2018-10-09 14:46:40 +08:00
Colin Cross d42f15d724 Merge "Use zip2zip for uncompress-dexs and uncompress-shared-libs" am: 0ab356ac20 am: ce594b4549
am: d3371bd1ab

Change-Id: I22fd914d31494fce8036ed28507621da1e9e83de
2018-10-08 17:51:54 -07:00
Colin Cross 2a51a25495 Merge "Don't zip hiddenapi output jar into jar" am: f05a023a5a am: 808af69564
am: bcf2fa33d3

Change-Id: I7ced2ae5b772bec65cc18645b6cb75088650d9ba
2018-10-08 15:49:07 -07:00
Colin Cross dac94fff8f Use zip2zip for uncompress-dexs and uncompress-shared-libs
Unzipping and rezipping files causes the umask of the host machine
to affect the permissions in the APK.  Use the new zip2zip -0 feature
to rewrite the zip file with selected files uncompressed.

Bug: 69500920
Test: m checkbuild
Change-Id: I82dd3aa441712772a1d1ddd6aaf5f41179facaa7
2018-10-08 12:49:11 -07:00
Colin Cross c3c62fba96 Don't zip hiddenapi output jar into jar
Zip classes*.dex so that the jar does not contain an empty
classes.jar.

Test: m out/target/common/obj/JAVA_LIBRARIES/android.test.base.impl_intermediates/javalib.jar
Change-Id: I53bdd2035b2963dd781734da64058c95e1cff9d4
2018-10-08 11:23:59 -07:00
Anton Hansson 1d97d35f90 Merge "Move a few more string functions to strings.mk" am: d6e5cb1add am: 21e7c05f7e
am: c0bbfed0dd

Change-Id: I7f17e606ca4d179b43e9b5dbdd41f8443b71e5ae
2018-10-04 07:17:15 -07:00
Anton Hansson d6e5cb1add Merge "Move a few more string functions to strings.mk" 2018-10-04 13:47:55 +00:00
Anton Hansson 8478f12427 Merge "Fix TWS requirement in definitions.mk" am: ee08d635c7 am: 9920578c25
am: f07cec3b69

Change-Id: I26cd047f958930c8311e79f716e61435158a8828
2018-10-03 09:10:34 -07:00
Anton Hansson 4967b34ddd Move a few more string functions to strings.mk
So they can be used in product.mk

Bug: 80410283
Test: make
Change-Id: Ic94754f6b48a3281ca1dd8c195a3410b543eb366
2018-10-03 15:59:39 +01:00
Anton Hansson a0f91bd506 Fix TWS requirement in definitions.mk
Removing this TWS breaks the build. Add a backslash to avoid
needing it.

Test: make
Change-Id: I4f8e127218ffbf55a3e11600569f0100e914d2e2
2018-10-03 13:38:00 +01:00
Colin Cross 2ae0d2518d Merge "Pass classpath to d8" am: 1ac080e9e5 am: 5fa79d2afd
am: 807dd63e65

Change-Id: I568884edfca04ab5989b1bfe0cca226f9c6c4bbb
2018-09-27 16:47:54 -07:00
Treehugger Robot 1ac080e9e5 Merge "Pass classpath to d8" 2018-09-27 23:27:45 +00:00
Yifan Hong 29dcc01a54 Merge "to-upper and to-lower move to strings.mk" am: 1f5c41bacf am: b9f8a6fa45
am: 0576f6ed91

Change-Id: I832bcda3ea704d44c52abdb3f1224150a74313a4
2018-09-25 11:05:30 -07:00
Yifan Hong c49bddfb67 to-upper and to-lower move to strings.mk
So that config.mk can use these functions.
Test: builds

Change-Id: I6634226cbed56c34977803ff9c75b8d481c21c34
2018-09-24 14:45:41 -07: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
Dario Freni ab2ead7504 Merge "Pass the intermediate dir to appcompat.sh" am: abda944667 am: ea0c204d4f
am: 1eaeb2093a

Change-Id: I83468f462a2927507c8264307e1d1ec8fceedb3e
2018-09-19 17:42:01 -07:00
Colin Cross adbd94b1ea Merge "Don't set -pie for windows modules" am: a70669e4a5 am: f31d9e78bb
am: 637d2329d1

Change-Id: I7b0f2c0f25c8eef27c24a6972f1de65ed59bd88d
2018-09-19 17:40:44 -07:00
Treehugger Robot abda944667 Merge "Pass the intermediate dir to appcompat.sh" 2018-09-20 00:00:54 +00:00
Colin Cross a70669e4a5 Merge "Don't set -pie for windows modules" 2018-09-20 00:00:42 +00:00
Dario Freni 75266ab671 Pass the intermediate dir to appcompat.sh
For ASAN build the intermediate dir might differ from the default
directory.

Test: m (on an affected ASAN build)
Bug: 116020783
Change-Id: Ie4f282ea651d710351799f3fc24dba42e79ee63d
2018-09-19 23:18:38 +01:00
Colin Cross feb4a7e4ae Don't set -pie for windows modules
Adding -pie to LOCAL_LDFLAGS for host linking leaves it around
when doing the host cross Windows linking, resulting in a warning:
clang-7: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

Add it later in binary.mk after the flags have been copied to the
single-use my_ldflags.

Bug: 115776263
Test: m checkbuild
Change-Id: I70d71fa1ec6445631dc7e89ef61927a3304375e2
2018-09-19 15:18:17 -07:00
Dan Willemsen 4797cf2ede Merge "Remove *_OUT_INTERMEDIATE_LIBRARIES" am: c4af7d75dc am: a127ddfe6b
am: d734e9c32a

Change-Id: Ic85e410e3b510604f3ecb448647d097a9da32798
2018-09-19 10:46:22 -07:00
Dan Willemsen c4af7d75dc Merge "Remove *_OUT_INTERMEDIATE_LIBRARIES" 2018-09-19 17:19:37 +00:00
Dan Willemsen 5ba4114e2f Merge "Fix installclean incremental builds w/veridex" am: c55b42358d am: 962f88574b
am: 6a1f125c6e

Change-Id: I71c1be25df144088e78b31e0e20e440787ae8cd5
2018-09-18 02:48:44 -07:00
Treehugger Robot c55b42358d Merge "Fix installclean incremental builds w/veridex" 2018-09-18 09:16:14 +00:00
Søren Gjesse 56094acb4a Merge "Don't include data resources when running R8" am: 75e1c77f1b am: cfc4e3ec90
am: a60ee3f917

Change-Id: I0443f2ba5b327243f3bb491ff4211f4d12ea00c8
2018-09-17 23:47:28 -07:00
Søren Gjesse 75e1c77f1b Merge "Don't include data resources when running R8" 2018-09-18 06:22:21 +00:00
Dan Willemsen b73ccb7a25 Fix installclean incremental builds w/veridex
$(HOST_OUT)/obj/PACKAGING is cleaned via `installclean`, so regular
built modules should not be depending on it. Explicitly call out the
dependencies instead.

Test: m; m installclean; m
Change-Id: I0f318257e4742d6b7bd099dc06958ca8aba0cfb8
2018-09-17 16:01:14 -07:00
Colin Cross f18eeb7340 Merge changes from topic "make_umask" am: d828c07b56 am: fbdc2fe2d1
am: bafd10b2e0

Change-Id: Ibcc2b95d97870f7b100688a46abd051a740d3046
2018-09-17 14:39:15 -07:00
Colin Cross 91b1146ac1 Make package functions take an argument am: 7b226865c1 am: 62f450722c
am: f31ab94fef

Change-Id: I69d8c84b2de066e07332c81716774e36586eb34f
2018-09-17 14:37:35 -07:00
Dan Willemsen 8cf6b65445 Remove *_OUT_INTERMEDIATE_LIBRARIES
Always use the exact libraries like Soong does instead.

Test: m
Change-Id: Ifd48020073dd045247f76f84627c497e94562286
2018-09-15 10:52:13 -07:00
Roland Levillain 47016b1fbf Merge "Revert "Make package functions take an argument"" am: d55eb7643d am: f16ce8df3c
am: b20027a82b

Change-Id: I1bb791ac5457ec06b181403b788d45e4fa843cd7
2018-09-15 09:23:51 -07:00
Colin Cross c9e4976832 Replace some uses of zip with merge_zips, soong_zip, and zip2zip
zip maintains permissions when adding files to zips, which causes
the final jars and apks to change based on the umask of the build.
Move some of the rules that were using zip to soong_zip instead.

Since soong_zip doesn't support adding files to existing zips,
create a new zip file for each part of the package creation
process and then merge them together at the end with merge_zips.

Bug: 69500920
Test: m checkbuild
Change-Id: Id253df776ce19ec4cac3a36fa470a50461ea3cad
2018-09-15 09:16:26 -07:00
Colin Cross 7b226865c1 Make package functions take an argument
In preparation for rearranging the way jars and apks are built.

Relands Ib9f0da132196942062c58fd5b12e84588106724e with a fix to
correctly include classes.dex in hostdex jars.

Test: m checkbuild
Change-Id: I397544456b8ce5827716fcd1828de707b719c2bb
2018-09-15 09:10:37 -07:00
Treehugger Robot d55eb7643d Merge "Revert "Make package functions take an argument"" 2018-09-15 16:05:39 +00:00
Roland Levillain 70bd104353 Revert "Make package functions take an argument"
This reverts commit 5ea65dcc5e.

Reason for revert: Breaks some ART gtests on host.

Change-Id: I314692e31628a14d824e28544fdb3c765fc100f6
2018-09-15 12:46:44 +00:00
Colin Cross 75ec8c9f6e Merge "Make package functions take an argument" am: dcfdb91c07 am: 99bd49a9fa
am: 96597963fa

Change-Id: I4ef712bdcda1eb488f0c44c80678881e85a834af
2018-09-14 20:32:50 -07:00
Colin Cross dcfdb91c07 Merge "Make package functions take an argument" 2018-09-15 03:16:56 +00:00
Colin Cross dff4b108f9 Merge "Remove LOCAL_DONT_DELETE_JAR_DIRS" am: 7f583f1e57 am: 1fe6d8c6f5
am: 134c90324c

Change-Id: Ib65ebcf086d722ef7aece3f35e2a2e5390a3beec
2018-09-14 19:37:39 -07:00
Treehugger Robot 7f583f1e57 Merge "Remove LOCAL_DONT_DELETE_JAR_DIRS" 2018-09-15 02:14:24 +00:00
Colin Cross 5ea65dcc5e Make package functions take an argument
In preparation for rearranging the way jars and apks are built.

Test: m checkbuild
Change-Id: Ib9f0da132196942062c58fd5b12e84588106724e
2018-09-14 16:55:18 -07:00
Colin Cross 405b30fb4f Remove LOCAL_DONT_DELETE_JAR_DIRS
There are no users left in Make.

Test: m checkbuild
Change-Id: I896fc6b889aab556c6983c374421e4c5381af54d
2018-09-14 16:55:08 -07:00
Søren Gjesse c81798f2a2 Don't include data resources when running R8
The change https://r8-review.googlesource.com/c/r8/+/26482 made R8
process data resources by default. This is not expected for the
Android Platform build

Test: m -j PRODUCT-aosp_x86-userdebug core-oj
Change-Id: I8936a39ea3cc0f46e455087076635a8fa2c9e0d3
2018-09-14 15:26:44 +02:00
Anton Hansson d69c043fec Merge "Re-write the module override logic." am: 3ea8ca5ac7 am: 18b20d7644
am: 3392edacd1

Change-Id: Ie48b3eb96c67f5cfb07b38e25e66241304900ba8
2018-09-14 01:21:05 -07:00
Anton Hansson 948615083a Re-write the module override logic.
This makes the product-installed-files macro more accurately reflect
the files installed for a given product, as well as fixing bugs in
the previous implementation.

Specifically, the complete list of overrides found so far is stripped
in each round of expanding required modules. Previously, overrides were
stripped out *after* expanding required modules. This meant that for a
scenario where B depends on C, and A overrides B, C could get installed.
It's unclear if this was a problem in practice.

The other effect is that the offending artifacts txt is more accurate,
since overridden modules are now correctly removed.

Bug: 80410283
Test: build_test downstream
Change-Id: I8bfc7c40bedd5cb2afba567bae4b998f51770793
2018-09-13 07:51:08 +01:00
Colin Cross 6d914ce7bf Merge changes from topics "make_strip_sh", "soong_cc_prebuilt" am: 78104cdd94 am: 4f454c43da
am: 92e2b56b59

Change-Id: I37769a3b1e479854d91eba905eaa6a83dd9a625a
2018-09-10 13:07:36 -07:00
Colin Cross 830eed81ab Use build/soong/scripts/strip.sh for Make modules
Replace the complicated rules in Make with calls the same strip.sh
script that Soong uses.

Bug: 113936524
Test: m checkbuild
Change-Id: If7beeb8381b5a9bc6e9ba15d443a834eb43fc0d4
2018-09-10 11:05:32 -07:00
Mathew Inwood 8fce0cfe1e Merge "Support for adding dark greylist members from annotations." am: d72c37eb0a am: ca9374e779
am: 223dc031d1

Change-Id: I6aba3a8164e20f020b38d8fc5b09f2a96afd1cac
2018-09-10 03:00:31 -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
Dan Willemsen a639fc73be Merge "Remove GCC support from Make" am: 5a3ddef8da am: 408391d205
am: 13d247168d

Change-Id: I02b0cd60df0166004e896ef4a803c2b8ee8fa187
2018-09-06 22:01:11 -07:00
Dan Willemsen f063839de9 Remove GCC support from Make
Test: out/build-aosp_arm64.ninja is the same before/after
Test: build_test on downstream branches
Change-Id: If7f8c12f2f288b1e589689361f9457acae634882
2018-09-06 15:40:00 -07:00
Dan Willemsen ac874b9165 Merge "Switch protoc javastream plugin to using explicit path" am: 690e1a17a4 am: efb9460d4c
am: 3a61da0071

Change-Id: I147e6750174415389fdb15bfb0459999904fdbd0
2018-08-31 18:29:37 -07:00
Dan Willemsen 5771e8cbf1 Switch protoc javastream plugin to using explicit path
The previous PATH=$PATH:out/... logic was incorrect, since the version
in $PATH would override the one out. And now that we're limiting what's
accessible via $PATH, that caused an error.

Instead, ensure that all protoc plugins are specified explicitly with
--plugin, then remove the PATH modification.

Test: cd frameworks/base/cmds/am; mma    (with protoc-gen-javastream in $PATH)
Change-Id: I6690727504f67f84fdc95ed93eabdf3351e5cb0b
2018-08-31 15:59:23 -07:00
David Brazdil 865720388f Merge "Adjust build rule for hidden API list generation" am: 354cc2dde6 am: 968c99c6f0
am: f6c003e0f8

Change-Id: Ib0049d457176904200ad401c8c4566b4d25edc35
2018-08-30 11:35:07 -07:00
David Brazdil cf163d38d6 Adjust build rule for hidden API list generation
Associated CL in frameworks/base/ migrates hidden API list generation
logic from Makefile/Bash to Python. Instead of four different build
targets, there is now just one. Adjust definitions.mk accordingly.

Bug: 113278235
Test: m appcompat
Change-Id: I01130729a0f783ff37cb4e942bc9ad179fe24e4e
2018-08-30 13:45:22 +01:00
Chih-hung Hsieh b0197daa63 Merge "Filter out unknown arguments with clang-tidy.sh." am: 385ba5c434 am: 062ccf719e
am: 6b936b94ab

Change-Id: I863b58b2d0450fd2b2651638ceb052a375161b3d
2018-08-28 13:39:32 -07:00
Chih-hung Hsieh 385ba5c434 Merge "Filter out unknown arguments with clang-tidy.sh." 2018-08-28 18:18:32 +00:00
Chih-Hung Hsieh be5dd2023e Filter out unknown arguments with clang-tidy.sh.
* Call clang-tidy.sh defined in PATH_TO_CLANG_TIDY_SHELL.
* Add dependency to clang-tidy and clang-tidy.sh.

Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I90175ea1489272d8d4fc0f9ba4e5bbfdc7399d82
2018-08-28 09:45:39 -07:00
David Brazdil 35f6337da8 Merge "Support hidden API whitelist generated by class2greylist" am: 7c76579e7a am: 142c7408d3
am: 4cd7e9bc2d

Change-Id: Ifcf975c28b2507ab63f2e97512a9ac2e140896e3
2018-08-27 17:51:22 -07:00
David Brazdil 7c76579e7a Merge "Support hidden API whitelist generated by class2greylist" 2018-08-27 21:41:04 +00:00
Søren Gjesse 2a56e2305e Merge "Ensure that the R8 minification map (ProGuard dictionary) file exists" am: 6601397608 am: e75eb3d6cb
am: 942d069779

Change-Id: I784feffff2b0aa466f20064e67932e832d60111d
2018-08-27 09:21:49 -07:00
Søren Gjesse 6601397608 Merge "Ensure that the R8 minification map (ProGuard dictionary) file exists" 2018-08-27 16:06:07 +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
Chih-hung Hsieh 374d433d0c Merge "Define CLANG_TIDY_UNKNOWN_CFLAGS in tidy.mk" am: 8668e9228a am: ad3cb5a924
am: 2d6216035e

Change-Id: I243338608452e0e58c6f16dbf6552b54396f490b
2018-08-23 15:43:06 -07: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
Chih-Hung Hsieh 4275dcf866 Define CLANG_TIDY_UNKNOWN_CFLAGS in tidy.mk
* Moved from build/soong because the list is used only in make rules.

Bug: 111885396
Test: build with WITH_TIDY=1
Change-Id: I6ca7420e7ed1e342a5b92996724c6659a406d5ae
2018-08-22 09:21:53 -07:00
Evgenii Stepanov 79edf43b9e Merge "Add "hwaddress" sanitizer." am: 36ea50d760 am: 9afe363ceb
am: 0c9d6fa503

Change-Id: I8c2a2cc292f9f3a127d4ac3e25af2f07984ecb41
2018-08-20 18:05:26 -07:00
Treehugger Robot 36ea50d760 Merge "Add "hwaddress" sanitizer." 2018-08-20 23:22:35 +00:00
Evgenii Stepanov 8841a7f681 Add "hwaddress" sanitizer.
Build/make support for "hwaddress".

* HWASan supports static binaries, unlike ASan.
* It will be used to build libc. Since static libraries get a .hwasan
  suffix in soong, the logic that moves libc-and-friends to the end
  of the link command line has to be updated.

Bug: 112438058
Test: manual, part of a bigger patch set

Change-Id: I3b52336841012622771a88ba161916bc33071dfe
2018-08-20 14:59:36 -07:00
Dario Freni 437ce8160e Adjust AAPT2 dump usage to new syntax.
Syntax was changed in Change-Id
5d2755129dae6ff6f0061da0abe634f44054b23e .

Bug: 112747818
Test: m -- and check reports
Change-Id: I909e6d66a0ce0ffa4cb1595a2779d754a3ab933b
2018-08-17 13:07:56 +01:00
Treehugger Robot 72150c147e Merge "Remove proguard support" 2018-08-15 01:14:45 +00:00
Mathew Inwood c4d57494b5 Pass public API list to class2greylist tool.
This is necessary to allow it to exclude synthetic bridge methods from the
generated greylist. We need to be able to apply the @UnsupportedAppUsage
annotation to regular (non-bridged) methods, but due to the SDK visibility
rules, the synthetic bridge is part of the SDK.

Don't do this on build that don't include frameworks/base since the
target is not needed and breaks certain builds.

Bug: 110868826
Test: m
Change-Id: I08f06f38d84945f5473618513c641762bc541e24
2018-08-13 16:21:21 +01:00
Roland Levillain a86b80567a Revert "Pass public API list to class2greylist tool."
This reverts commit 9f46a30e29.

Reason for revert: This change breaks the ART Buildbot (see
https://build.chromium.org/p/client.art/builders/angler-armv7-ndebug/builds/2045/steps/build%20target/logs/stdio).

Bug: 110868826
Change-Id: I78efb71738f191b432b271f723ac83e4f02e6a0d
2018-08-10 17:55:07 +00:00
Mathew Inwood 9f46a30e29 Pass public API list to class2greylist tool.
This is necessary to allow it to exclude synthetic bridge methods from the
generated greylist. We need to be able to apply the @UnsupportedAppUsage
annotation to regular (non-bridged) methods, but due to the SDK visibility
rules, the synthetic bridge is part of the SDK.

Bug: 110868826
Test: m
Change-Id: Iac23b0d2a9b371771a020b24191634a8b6b9b4b5
2018-08-09 11:14:10 +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 9fd9183e66 Merge "aapt2: use clean-path on paths to resource files"
am: ca52cd4b64

Change-Id: Id9be0878060f306e26abce4503f8ab958f675c10
2018-07-31 19:48:06 -07:00
Treehugger Robot ca52cd4b64 Merge "aapt2: use clean-path on paths to resource files" 2018-08-01 02:44:27 +00:00
Dario Freni 8c5710a0af Merge "Run appcompat on vendor and product-services."
am: 11b4a97ad8

Change-Id: Ibb98e36a46e6489b086071620abcdffe97f5f5ce
2018-07-31 18:24:23 -07:00
Dario Freni 716e9b686c Run appcompat on vendor and product-services.
Also add some more relevant information at the beginning of each report,
to make triaging of the reports easier.

To test this I declared ExactCalculator as
LOCAL_PRODUCT_SERVICES_MODULE, and this is the resulting log:

"""
Package name: com.android.calculator2
Module name in Android tree: ExactCalculator
Local path in Android tree: packages/apps/ExactCalculator
Install path on aosp_marlin-eng: out/target/product/marlin/system/product-services/app/ExactCalculator/ExactCalculator.apk

appcompat.sh output:
NOTE: appcompat.sh is still under development. It can report
API uses that do not execute at runtime, and reflection uses
that do not exist. It can also miss on reflection uses.
1: Reflection light greylist Landroid/os/Bundle;->getIBinder use(s):
       Landroid/support/v4/app/BundleCompat$BundleCompatBaseImpl;->getBinder(Landroid/os/Bundle;Ljava/lang/String;)Landroid/os/IBinder;

2: Reflection light greylist Landroid/view/View;->mAccessibilityDelegate use(s):
       Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->hasAccessibilityDelegate(Landroid/view/View;)Z

3: Reflection light greylist Landroid/view/View;->mMinHeight use(s):
       Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumHeight(Landroid/view/View;)I

4: Reflection light greylist Landroid/view/View;->mMinWidth use(s):
       Landroid/support/v4/view/ViewCompat$ViewCompatBaseImpl;->getMinimumWidth(Landroid/view/View;)I

4 hidden API(s) used: 0 linked against, 4 through reflection
       0 in blacklist
       0 in dark greylist
       4 in light greylist
To run an analysis that can give more reflection accesses,
but could include false positives, pass the --imprecise flag.
"""

Test: m (also on internal)
Bug: 110073830
Change-Id: I5114f51d1ab163e954fcffb159ef335abc289cf6
2018-08-01 00:22:08 +01:00
Colin Cross 0cade20918 aapt2: use clean-path on paths to resource files
The aapt2 rules need to generate an output path for each resource
file.  Use $(call clean-path) on the input path so the output path
doesn't contain "..".

Bug: 112037828
Test: m checkbuild
Change-Id: Ib4e255e7a7f1d069cd3871a12ac232f231f19646
2018-07-31 20:47:38 +00:00
Yifan Hong 48b23f3a0c Merge changes from topic "lrap_sysprop"
am: 9c1264417f

Change-Id: I82335d291a5ae0a7fe82bb6742652b018943c699
2018-07-30 10:41:10 -07:00
Yifan Hong 285083e475 Fix collapse-pairs for last empty property
If the last token in the argument for collapse-pairs is
key=, then the following lines were written:
    key
    =
This patch fixes it so that key= is written instead.

Test: specify ro.boot.logical_partitions= at the end of
ADDITIONAL_PRODUCT_PROPERTIES and `cat $OUT/product/build.prop`
shows:
ro.boot.logical_partitions=

Change-Id: I33a0efb59871f0e36a93c8fae0d75f2735994301
2018-07-27 16:24:38 -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
Colin Cross a90b6070c7 Move manifest fixing to a separate rule
Manifest fixing is getting complicated, move it to a separate rule
so that it doesn't have to be a function in definitions.mk.

Bug: 111347801
Test: m checkbuild
Change-Id: Ibc60ad79c9c4f4a63a0e1c8f7779534954fb6585
2018-07-25 14:30:05 -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
Dario Freni 1aef906c01 Merge "Run appcompat on all /product modules."
am: 88858574b0

Change-Id: I4af0e942659b9a6b7a0ee091af679b15517a8a7e
2018-07-20 02:08:20 -07:00
Dario Freni 1ecc925995 Run appcompat on all /product modules.
The output of the appcompat tool is store on $(PRODUCT_OUT)/appcompat.

Bug: 110073830
Bug: 78924201
Test: m
Change-Id: Ia77cc53fc241a048958cf243ba298298f800f933
2018-07-18 12:18:49 +01:00
Dan Willemsen f32fa7ca45 Merge "Remove '=' from the valid module/stem names"
am: 45819baa42

Change-Id: I6da2cdf86fd13c7d694913912b3c02da1e859ef0
2018-07-16 20:02:01 -07:00
Dan Willemsen f012af1aab Remove '=' from the valid module/stem names
Kati produces errors when a variable containing '=' is used as a
dependency:

https://github.com/google/kati/issues/138

So provide a better error message instead.

Test: Add a module with an '=', see new error
Change-Id: I09d570a8d19abb067621af9983a9d568b643dfb0
2018-07-16 13:57:52 -07:00
David Brazdil 467a10c261 Add singleton rule for hiddenapi list generation
The lists of public/private APIs used for non-SDK API restriction
enforcement used to be generated by Doclava. In Q we're switching
to resolving android.jar (and other SDK stub JARs) against the boot
class path directly to avoid lowering Doclava's high-level view of
the framework and issues related to it.

This patch adds a new build rule which invokes `hiddenapi` on all
boot class path dex files simultaneously. The tool generates two
text files - one with public and one with private APIs.

Bug: 79409988
Test: m out/target/common/obj/PACKAGING/hiddenapi-private-list.txt
Change-Id: I826d8ac513a41a1d6d5e29a8300073158cff5acf
Merged-In: I826d8ac513a41a1d6d5e29a8300073158cff5acf
(cherry picked from commit a39db48511)
2018-07-13 00:52:05 +00:00
David Brazdil ab501e0d8b Add singleton rule for hiddenapi list generation
The lists of public/private APIs used for non-SDK API restriction
enforcement used to be generated by Doclava. In Q we're switching
to resolving android.jar (and other SDK stub JARs) against the boot
class path directly to avoid lowering Doclava's high-level view of
the framework and issues related to it.

This patch adds a new build rule which invokes `hiddenapi` on all
boot class path dex files simultaneously. The tool generates two
text files - one with public and one with private APIs.

Bug: 79409988
Test: m out/target/common/obj/PACKAGING/hiddenapi-private-list.txt
Merged-In: I826d8ac513a41a1d6d5e29a8300073158cff5acf
Change-Id: I826d8ac513a41a1d6d5e29a8300073158cff5acf
(cherry picked from commit a39db48511)
2018-07-12 08:58:14 +00:00
Steven Moreland e2c90abd90 Merge "aidl: -ninja -> --ninja"
am: 9721ee965e

Change-Id: I9ac08d786f2055810f2fd8fef33139c9b49154b7
2018-07-06 17:24:51 -07:00
Steven Moreland 385442d399 aidl: -ninja -> --ninja
Bug: 110967839
Test: AIDL's runtests.sh
Change-Id: I785d39846a477c7edb91db477a0dfa046d823cbf
2018-07-06 11:35:09 -07:00
David Brazdil afb4d4cf8c Merge "Fix unzip on sdk_mac build"
am: 2986542f65

Change-Id: I422250d37866c56fed294a288bb1b7a8084372e8
2018-07-02 06:20:16 -07:00
David Brazdil c06f48a21d Fix unzip on sdk_mac build
Recent CL added a flag to an unzip command which does not restore
the timestamps of extracted files. This is necessary because the
extracted files are the output of the rule and thus the timestamp
must be newer than the timestamp of the inputs.

Unfortunately, the sdk_mac build has an old version of UnZip (5.52
vs 6.0) which does not support the flag. Replace it with find|touch.

Test: m
Change-Id: Ib1f218af4547a1d604b46e68b6ef50d45cb91ee9
2018-07-02 11:19:53 +01:00
David Brazdil dfd096870d Merge "Refactor hiddenapi rules to share common code"
am: 9b53066762

Change-Id: I2fc45e8d861aff3a2e4ab5ca6ccf1ba44bb29c6c
2018-06-29 04:40:17 -07:00
David Brazdil 9b53066762 Merge "Refactor hiddenapi rules to share common code" 2018-06-29 11:33:09 +00:00
David Brazdil d9a9e981ce Merge "Adjust arguments of `hiddenapi` tool"
am: dadcb9ced2

Change-Id: I952877c22a547aacbe248e2411f5b2628a164133
2018-06-29 01:46:18 -07:00
David Brazdil dadcb9ced2 Merge "Adjust arguments of `hiddenapi` tool" 2018-06-29 08:40:55 +00:00
Sundong Ahn 04d7ae2ff5 Merge "Support java sdk libraries"
am: 3dbb886cda

Change-Id: I7e61484fd12db60a7a18a4559b8ae38cb463eeef
2018-06-28 20:31:17 -07:00
Treehugger Robot 3dbb886cda Merge "Support java sdk libraries" 2018-06-29 02:51:43 +00:00
David Brazdil 6b60b2151e Refactor hiddenapi rules to share common code
Java modules built with make and Soong currently invoke `hiddenapi`
with their own rules. Refactor the definitions so that Soong uses
make's definition. This will be useful for a subsequent CL which
needs to invoke `hiddenapi` on all boot dex files simultaneously.

Bug: 79409988
Test: m
Change-Id: I85105e650605d37c3ee8200d7f0d40c297756fcb
2018-06-28 18:14:30 +01:00
David Brazdil 57b1e546a0 Adjust arguments of `hiddenapi` tool
The `hiddenapi` build tool now expects the first argument to be
a command name. Change its build rule accordingly.

Bug: 79409988
Test: make
Change-Id: I7e34331c487f490d1de6a10c4139768e9774f03e
2018-06-28 18:14:30 +01:00
Pirama Arumuga Nainar 783c0bd833 Merge "Do not set entry-point for Windows"
am: 645b8db09a

Change-Id: Ia4982902151b800b58a3cfa488ccfddecb6aa662
2018-06-27 13:26:34 -07:00
Pirama Arumuga Nainar b448834e96 Do not set entry-point for Windows
Bug: http://b/62424007

This breaks 64-bit Windows executables.  Probably due to the Clang
migration, the entry-point need not be set even for 32-bit executables.

Test: 32-bit and 64-bit aapt2_tests.exe and ziparchive-tests.exe can
start.  (There are some failed tests, though).

Change-Id: I1dea9137c79c5f26b493640cfae0856c1a7ea301
2018-06-27 11:28:33 -07:00
Colin Cross bbbcf1c01e Merge "Disable standalone relocation packer"
am: effbc370dc

Change-Id: Ie72c24415f13f0960413f61d515b793ab780125a
2018-06-26 10:50:11 -07:00
Colin Cross effbc370dc Merge "Disable standalone relocation packer" 2018-06-26 17:40:57 +00:00
Chih-hung Hsieh fb21c07d84 Merge "Filter out clang-tidy unknown arguments."
am: 875691cf89

Change-Id: I213cba2633df3d5de2ecc072ca4569f894c64ee8
2018-06-26 10:03:15 -07:00
Chih-hung Hsieh 875691cf89 Merge "Filter out clang-tidy unknown arguments." 2018-06-26 16:51:40 +00:00
Colin Cross 979f9f9b18 Disable standalone relocation packer
We only support relocation packing inside lld now, remove calls to
the standalone relocation packer.  Any shared library built with
LOCAL_USE_CLANG_LLD := false will no longer have relocation packing.

This will also prevent relocation packing on prebuilt shared
libraries.

Also enables relocation packing on Darwin since lld will work on
Darwin.

Bug: 110715614
Test: m checkbuild
Change-Id: Ib4d4bc86f164d05dd78455c8e7605d4b4f5a2a77
2018-06-26 00:35:46 +00:00
Nelson Li f6cfd5e360 Merge "Revert "Revert "Build System: Validate AndroidTest.xml Configs"""
am: d3ef2822cc

Change-Id: Id57e37bd69958c9e6cfc178414ef9a5a84842d25
2018-06-25 17:30:59 -07:00
Treehugger Robot d3ef2822cc Merge "Revert "Revert "Build System: Validate AndroidTest.xml Configs""" 2018-06-26 00:24:50 +00:00
Chih-Hung Hsieh b02e447775 Filter out clang-tidy unknown arguments.
Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I77cd5dec834215fa22742eae6d96aabecadd11ab
2018-06-25 13:49:36 -07:00
Nelson Li a2a8b9ba11 Revert "Revert "Build System: Validate AndroidTest.xml Configs""
This reverts commit 054f210fd5.

Reason for revert: Revert it again since BUG of 109736180 already be fixed.
                   Local verified for different build targets of
                   walleye_coverage-userdebug, marlin_coverage-userdebug
                   and make sure they can build pass.
BUG: 109736180
Test: lunch walleye_coverage-userdebug; make adbd_test

BUG: 73082610
Test: cd packages/apps/DocumentsUI/tests/; mma
      Modify AndroidTest.xml to a not well-formed xml; mma
      Then, it should build fail.
      atest -v DocumentsUITests

Change-Id: Iadfcb28a4e3f685a66697de21f57ca5bdb8b7c9e
2018-06-25 06:03:41 +00:00
Tom Cherry 281d343dfb Merge "Reland: Verify init scripts for correctness during build"
am: bdaaab2e39

Change-Id: Ia0cdc6067e357e97ab88b1dd2690358ead4edd18
2018-06-21 13:12:54 -07:00
Tom Cherry fc97764dd5 Reland: Verify init scripts for correctness during build
Relanding with change to not run on the darwin build since host init
verifier is not possible there.

Bug: 36970783
Bug: 110477913
Test: builds pass without failures
Test: builds fail with failures in init files used via LOCAL_INIT_RC,
      PRODUCT_COPY_FILES, or TARGET_PREBUILT

Change-Id: Iae93705a9320159ed97328e615eaa3bc150e6442
2018-06-21 11:16:25 -07:00