Commit graph

1299 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
7c76579e7a Merge "Support hidden API whitelist generated by class2greylist" 2018-08-27 21:41:04 +00: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
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
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
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