Commit graph

1215 commits

Author SHA1 Message Date
Treehugger Robot
ca52cd4b64 Merge "aapt2: use clean-path on paths to resource files" 2018-08-01 02:44:27 +00: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
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
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
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
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
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
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
385442d399 aidl: -ninja -> --ninja
Bug: 110967839
Test: AIDL's runtests.sh
Change-Id: I785d39846a477c7edb91db477a0dfa046d823cbf
2018-07-06 11:35:09 -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
9b53066762 Merge "Refactor hiddenapi rules to share common code" 2018-06-29 11:33:09 +00:00
David Brazdil
dadcb9ced2 Merge "Adjust arguments of hiddenapi tool" 2018-06-29 08:40:55 +00: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
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
effbc370dc Merge "Disable standalone relocation packer" 2018-06-26 17:40:57 +00: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
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
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
Yifan Hong
560890b29f Merge "Revert "Verify init scripts for correctness during build"" 2018-06-20 22:56:39 +00:00
Tom Cherry
d15e50022f Revert "Verify init scripts for correctness during build"
This reverts commit 03303f97be.

Reason for revert: Mac build

Change-Id: Iadd76491307534fde81d3d917876c603a0658fb9
2018-06-20 22:45:14 +00:00
Tom Cherry
8075746865 Merge "Verify init scripts for correctness during build" 2018-06-20 17:06:11 +00: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
Sundong Ahn
a059c71348 Support java sdk libraries
Sdk addon has been allowed for libraries built with Android.mk. But some
of the libraries included in the Sdk addon should be built with
java_sdk_library. module-stubs-files function is modified for supporting
java_sdk_library modules.

Bug:77577799
Test: make -j
Change-Id: If289e5aa5b5016901ff9b69da8fc7f7d8138a456
2018-06-19 10:02:25 +09:00
Dan Willemsen
ac92659e0f Restrict / from module names
Since this is a directory separator, it causes a good deal of
strangeness in the build whenever we include a module name in a path.

It becomes particularly problematic if used together with ".."

Test: build_test on downstream branches
Change-Id: I344eca0db3346cd6ffabff767c34159c85ebc051
2018-06-16 14:15:50 -07:00
Tom Cherry
03303f97be Verify init scripts for correctness during build
Bug: 36970783
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: Ia98793776b365733ca8f0174dc228326a6edf041
2018-06-14 14:21:06 -07:00
Dan Willemsen
bbe6a022a3 Restrict characters in module names
See the Changes.md documentation for more information.

Test: build_test on downstream branches
Change-Id: I1524b1dbfd44a7feac3b9a212f37986f870bd837
2018-06-12 13:48:49 -07:00
Treehugger Robot
87d8dc4d4e Merge "Use llvm-{objcopy,strip} when clang lld is used." 2018-06-08 00:42:03 +00:00
Treehugger Robot
50ad8c97ac Merge "Revert "Revert "Remove desugar support""" 2018-06-07 20:31:22 +00:00
Treehugger Robot
79b6e2618a Merge "Revert "Build System: Validate AndroidTest.xml Configs"" 2018-06-07 02:50:32 +00:00
Chih-Hung Hsieh
9546d67fe9 Use llvm-{objcopy,strip} when clang lld is used.
* PRIVATE_OBJCOPY is still set to objcopy and used
  when llvm-objcopy cannot replace objcopy.

Bug: 80093681
Test: build/boot with USE_CLANG_LLD=true
Change-Id: I4bd8a53f74864b49e007f0c5f1b0f4b16e121135
2018-06-06 15:09:58 -07:00
Colin Cross
cf010858b6 Revert "Revert "Remove desugar support""
This reverts commit cf7407ed61.

Reason for revert: includes art veridex fix this time

Change-Id: I970b51e6a6c6f377cfe793f029d9674e7ee0ed15
2018-06-06 21:46:25 +00:00
Colin Cross
cf7407ed61 Revert "Remove desugar support"
This reverts commit bfad2c070c.

Reason for revert: broke art veridex build

Change-Id: I0dcc34102ee18b054c2247ae0e2698aca645c667
2018-06-06 21:42:21 +00:00
Nelson Li
054f210fd5 Revert "Build System: Validate AndroidTest.xml Configs"
This reverts commit 479da2f3bb.

Reason for revert: <revert for b/109736180 #8>

Bug: 109736180
Test: lunch walleye_coverage-userdebug; make adbd_test
Change-Id: I090893e20a2dab0651551361ebf65c26b95a25f2
2018-06-06 18:29:05 +00:00
Colin Cross
bfad2c070c Remove desugar support
Desugaring is always handled by d8 now.

Test: m checkbuild
Change-Id: I8af88522fb1280854ebb4e4957faf70ab59a74f4
2018-06-06 10:06:07 -07:00
Colin Cross
d45079a9ff Add minSdkVersion to default manifests
If the default manifest that doesn't set minSdkVersion is passed to
manifest merger along with a library manifest that does, it will fail
with:
.../DefaultManifest.xml Error:
	uses-sdk:minSdkVersion 1 cannot be smaller than version 14 declared in library ...

Translate LOCAL_MIN_SDK_VERSION or LOCAL_SDK_VERSION to minSdkVersion
in DefaultManifest.xml.

Bug: 79481102
Test: m checkbuild
Change-Id: I4d792d48612e6a1111e05a9e4a71bb4d87eae1ad
2018-05-23 16:35:40 -07:00
Treehugger Robot
af076d240a Merge "Build System: Validate AndroidTest.xml Configs" 2018-05-23 03:21:51 +00:00
Colin Cross
2029903b64 Allow forcing AAPT2 on
Building with FORCE_AAPT2=true will turn on AAPT2 for all modules
unless they set LOCAL_USE_AAPT2 := false.  The build system will
attempt to rewrite common AAPT patterns into AAPT2 patterns,
including removing --extra-packages for support library packages,
removing LOCAL_RESOURCE_DIR point to support library resources,
adding a default empty manifest file if it doesn't exist, and
converting LOCAL_STATIC_JAVA_AAR_LIBRARIES to
LOCAL_STATIC_ANDROID_LIBRARIES.

Bug: 79481102
Test: m checkbuild
Change-Id: I8d9d55fe4d5d5c965c64b0407efe74e0afc35c3a
2018-05-11 02:23:20 +00:00
Colin Cross
164a33f194 Fix zipped resources
Fix mismatch between output directory of zipsync and input
directory of aapt2.

Test: m checkbuild
Change-Id: If012c943af0c04cc3f0dd5c4266126412ae0a759
2018-05-09 23:56:19 +00:00
Nelson Li
479da2f3bb Build System: Validate AndroidTest.xml Configs
make <test> should fail if the test has a poorly configured
atest configuration

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

Change-Id: I774b4eb81a1b9e9ae31de949aea995d2f258e9a1
2018-05-08 00:26:40 +00: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
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
Dan Willemsen
a4155e8512 Delay eval to save memory use in create-suite-dependencies
Instead of passing the entire contents of
$(COMPATIBILITY.$(suite).FILES) to eval, which may keep that string
around, delay the evaluation of that, and the new files until inside the
eval.

This saves ~2.8GB: 7.4GB -> 4.6GB of ckati max resident memory for a
relatively small internal build. It also saves ~10% of the makefile
loading time (81 -> 73 seconds).

Test: build-aosp_arm.ninja is identical
Change-Id: If45a4796f1bbf6d67dff388ea877a6115a4e06f4
2018-04-09 16:30:06 -07:00
Treehugger Robot
e543e409d2 Merge "Support manifest fragments." 2018-04-05 23:09:14 +00:00