Commit graph

1173 commits

Author SHA1 Message Date
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
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
Treehugger Robot
a77e2acd6b Merge "Fix mini_debug_info stripping when no symbols should be kept." 2018-04-04 04:28:52 +00:00
Tao Bao
160bb70c4c Fix the comment for find-test-data-in-subdirs.
The function along with LOCAL_TEST_DATA are very helpful, but it took me
some extra minutes to figure out the issue with the arguments.

Test: N/A
Change-Id: I2c2878fca99ab77ea881d86635c27c34f9ecf855
2018-03-30 20:06:36 -07:00
Ryan Prichard
a45f5833c0 Fix mini_debug_info stripping when no symbols should be kept.
If there are no symbols to keep (i.e. all function symbols are also in
the dynsym table), then the $@.keep_symbols file has size 0.
When objcopy parses a --keep-symbols file, it has a special case for
0-sized files where it silently fails (exits with status 1, no error
message). On the other hand, objcopy is happy with a file containing no
symbols, as long as there is some whitespace or a comment. Avoid the
special case by appending a newline to keep_symbols.

Bug: b/62815515
Bug: b/77242617
Test: manual
Change-Id: I348593164fe78ece5c85db3d28c7daccce3a52fb
2018-03-29 01:39:07 +00:00
Colin Cross
f6d68cf6fe Use a srcjar for aapt and aapt2 output
Dumping files in the *_intermediates/src causes incremental build
problems, because we don't know when to delete them if they are
no longer generated.  Switch to outputting a srcjar instead, and
pass it in to the turbine and javac compiles.

Bug: 73885582
Test: m checkbuild
Change-Id: Ibef28507522339d930c09426d0c98372eb864cb6
Merged-In: Ibef28507522339d930c09426d0c98372eb864cb6
(cherry picked from commit 2d1cddd567)
2018-03-20 15:26:27 -07:00
Colin Cross
dc1e028994 Use srcjar and resource zip as output of renderscript rules
Replace RenderScript.stamp with a srcjar, with a resource zip as
an implicit output.  This makes the renderscript rules self contained,
which will make it easier to move them before aapt.

Bug: 73885582
Test: m checkbuild
Change-Id: I12d33e52019aebac6ea33271939228e4690a4173
Merged-In: I12d33e52019aebac6ea33271939228e4690a4173
(cherry picked from commit e00e2fae52)
2018-03-20 15:25:51 -07:00
Colin Cross
3f99cd5933 Replace extract_srcjars.sh with zipsync
Use zipsync instead of extract_srcjars.sh.

Also fixes an issue where unzipping a resource zip would
ignore anything that wasn't a *.java file.

Bug: 73885582
Test: m checkbuild
Change-Id: I1c25f65afa196614879071c8655866febebac185
2018-03-15 16:40:05 -07:00
Colin Cross
1f4f67201d Merge "Update turbine command line flags" 2018-03-15 22:39:28 +00:00
Colin Cross
0c0adb993c Allow compiles with only srcjars
Some javac and turbine compiles have no source files but sources
from srcjars.  Continue with compilation if the java source list
is empty but the srcjar source list is not.

Bug: 73885582
Test: m checkbuild
Change-Id: Ica412de2dd1b1bfc12c01c3eafca884220d42771
2018-03-15 13:07:33 -07:00
Colin Cross
6b27285619 Update turbine command line flags
The latest version of turbine requires a -- after the javac
options, and uses multiple --bootclasspath arguments instead
of a javac-style colon separated list.

Test: m javac-check
Bug: 74339924
Change-Id: I3f694ac375eab61954d4fe63c1166a18314bf75f
2018-03-15 06:04:53 +00:00
Colin Cross
bc0c494d3a Allow aapt2 rules to take zipped resource files
Allow aapt2 rules to take zipped resource files similar to the
way the javac rules take srcjars.  For now, unzip the files using
extract_srcjars.sh, and then use aapt2 compile --dir.  Eventually
it could be done with aapt2 compile --zip.

Bug: 73885582
Bug: 74574557
Test: m checkbuild
Change-Id: I97ea3ff305e7a9ef2a908b4cf0bca903af62c6b1
2018-03-14 14:13:18 -07:00
Colin Cross
11e2d55c0f Add LOCAL_SRCJARS support
Allow java modules to take jars containing .java files as an input.
For turbine, pass them directly to turbine.  For javac, extract them
to a directory and pass a list of the files to javac.

Bug: 73885582
Test: m checkbuild
Change-Id: Ib4351a5b4b165a55e5fb02ee2680466db368983a
2018-03-14 12:05:04 -07: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
Dan Willemsen
893859573d Use xz prebuilt
Instead of whichever xz happens to be on the PATH.

Bug: 36130900
Test: m
Change-Id: Ib37d8db4e935ef8f69f3d43b5065c22d34028cf3
2018-03-09 12:56:01 -08:00
Colin Cross
f6799e859a Silence more duplicate path warnings
Silence warnings when merging header jars that were missed by
Ifb67dbf7734b5f53941d110f578c4fe642e36005.

Bug: 69316739
Test: m checkbuild
Change-Id: I5cfea62e46d99f9b315a589d8915bf62307220aa
2018-03-07 09:47:41 -08:00
Dan Willemsen
4c36d45a2c Use xmllint built from source
Instead of relying on whatever version of xmllint is on the host system,
build and use the version in external/libxml2.

Test: diff build_aosp-marlin.ninja, expected changes.
Test: m $(xmllint targets in build_aosp-marlin.ninja)
Test: introduce xml error, build fails
Change-Id: I39579f06db3777e3b5c8dda7c7541c25a35887b2
2018-02-27 02:34:08 +00:00
Treehugger Robot
74413198b7 Merge "Move to-upper and to-lower to definitions.mk" 2018-02-09 18:20:23 +00:00
Colin Cross
18fae7a32e Move to-upper and to-lower to definitions.mk
So they can be used by art/test/Android.run-test.mk.

Also remove the line wrapping, which was inserting extra characters
at the beginning of the result, and add a sanity check.

Bug: 26275726
Test: no change to out/build-hikey960-test-art.ninja
Change-Id: I35b54c258a1dc76bb1a8a758ec4a08915a2b226d
2018-02-08 16:03:17 -08:00
Victor Hsieh
7aecf33efd Don't use the same temp directory to uncompress dex
This was ok for apk because they are in different parent directory.

Test: marlin built
Bug: 63920015
Bug: 30972906
Change-Id: I5ed00824fda9e7e0a99c825402753c21a06ba6c5
2018-02-08 13:24:56 -08:00
David Brazdil
b8fa6dd104 Revert "Revert "Apply hiddenapi build tool on boot jars""
This reverts commit 4a2926a44e.

Reason for revert: The original CL caused two issues:
1) Increased app startup because `profman` failed to verify boot
jars and created an empty profile for the boot image. All methods
in the framework therefore ran interpreted/JITed. New flag
"--skip-apk-verification" has been added to `profman` to fix
the issue in CL Iad614e47feada293218c11cff985a8012ca49a0f.
2) Caused a crash in Mockito CTS tests because jvmti did not
remove hiddenapi access flags from boot jars before using them.
This has been fixed with CL Ibc9a96a6b541c06844f276db009ac29514f7a3bb.

Bug: 64382372
Bug: 72550707
Test: make test-art-host
Change-Id: Ie8c58714455662f042f56b2977b01b75c5ec7d2f
2018-01-30 18:25:46 +00:00
Dan Willemsen
893bebc44b Clean up some kati warnings
Kati has a `--warn` option that adds some extra Kati-specific warnings
-- like using undefined make functions, undefined user functions, likely
bad variable lookups, etc. Some of these are bugs, others are fine doing
nothing. This fixes up all of them in the core build system.

It also complains about $(eval) usage in a recipe not being recommended.
Those aren't handled as part of this change.

Bug: 72661763
Test: build-aosp_arm.ninja is identical before and after
Change-Id: I8e00af142a7745236d3ad4efc9e91ec3ce71a511
2018-01-29 16:23:37 -08:00
Tobias Thierer
e1b94da7c8 Merge "javac 9 -target 1.9: Move bootclasspath jars onto classpath." 2018-01-29 10:51:24 +00:00
Alex Light
4a2926a44e Revert "Apply hiddenapi build tool on boot jars"
This reverts commit b7f00ed2af.

Bug: 72550707
Bug: 64382372
Test: atest CtsInlineMockingTestCases

Reason for revert: Causing invalid dex files to be passed to jvmti
                   agents. This causes CtsInlineMockingTestCases and
                   other tests to fail.

Change-Id: I50129e94791b9e2bef919fe398b4250ae461195b
2018-01-26 18:16:52 +00:00
Tobias Thierer
0276db1ec7 javac 9 -target 1.9: Move bootclasspath jars onto classpath.
When building with OpenJDK 9's javac with -source 1.9 -target 1.9,
a runtime image (with system modules) is used via the --system
command line flag, instead of --bootclasspath.
The runtime image only contains the default libraries (libcore)
but is missing other libraries that might be on the bootclasspath
for a particular build target.

This CL fixes compilation for this case by adding the missing
jars onto the classpath instead.

This already used to work but was broken by CL [1]. I attempted
to conditionally revert some of that CL's changes to java_common.mk
for the case of language level 1.9, but couldn't get it to work.
Therefore this CL follows a different approach.

[1] http://r.android.com/519552

Bug: 38177569
Test: Treehugger
Test: Ran "EXPERIMENTAL_USE_OPENJDK9=true make checkbuild docs"
      and spot-checked some javac invocations to confirm that the
      system modules libs were not included in the bootclasspath,
      but other libs were.

Change-Id: I48fd11aac9b310bfa58dee0f9cfb3ef33f10bca8
2018-01-26 02:48:48 +00:00
David Brazdil
b7f00ed2af Apply hiddenapi build tool on boot jars
Restrictions on usage of private APIs require encoding new information
into the dex files of the boot class path. ART now contains a new build
tool called `hiddenapi` which takes three lists of class member
signatures (blacklist, light and dark greylist), finds the class members
in their respective dex files and modifies their access flags in place.

This patch invokes the `hiddenapi` tool on all JARs in
PRODUCT_BOOT_JARS. For Java libraries built with Makefiles the tool is
invoked after the dexer directly on DEX files. For Soong-built
libraries, the build system has to unzip the JAR produced by Soong,
apply `hiddenapi` and rezip again. This is due to the fact that the
PRODUCT_BOOT_JARS variable is not available to Soong.

Bug: 64382372
Test: m
Change-Id: I6ce897d204459c8b6f46ed49e0909ff76c08a9ed
2018-01-25 09:22:08 +00:00
Nicolas Geoffray
ec1fdc8813 Merge "Tighter control of stripping in dex_preopt_odex_install." 2018-01-22 13:37:56 +00:00
Nicolas Geoffray
3972a47e9f Tighter control of stripping in dex_preopt_odex_install.
- Move logic to uncompress dexs in an APK in dex_preopt_odex_install.mk
  and definitions.mk.
- Explicitly mark nostripping cases where dexpreopt will not embed the dex
  file in the APK.

bug: 63920015
Test: m
Test: verify priv-apps dexs are uncompressed and unstripped
Test: Verify a non priv-app APK with uncompressed dex doesn't get stripped.

Change-Id: I624a03e3d965cebc0cae43fd6f7a6260178e6b8a
2018-01-18 22:42:46 +00: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
aca57b6c89 Remove --no-locals -> --release translation
--no-locals is never used any more, remove the translation.

Bug: 70886092
Test: m checkbuild
Change-Id: I5b0a512601b417c5a10001feed1fd9b8de8cb983
2017-12-21 13:00:51 -08:00
Alan Leung
c8ef37dfd8 Prep D8 default instead of CompatDX in build/core
Also use zip2zip to extract classes into another jar
to avoid hitting parameter limit in the shell invocations.

Bug: 69329508
Test: m checkbuild tests

Change-Id: Ic047aa699519b6b3fd100cb5395de945f96e4d0b
2017-12-18 23:54:33 -08:00
Treehugger Robot
973301af79 Merge "Replace build/tools with build/make/tools" 2017-12-13 02:34:42 +00:00
Alan Leung
aff156bd49 Avoid feeding D8 with dex files.
Some test targets include dex files as resource to be loaded
at runtime. This is an issue since full D8 also take dex files
as input.

This CL extracts only the class files and feed that to D8 instead
of the whole jar.

Test: USE_D8_DESUGAR=true m checkbuild tests
Bug: 69329508

Change-Id: I52d80ec01933573f18eb497472a80b6a649c9dae
2017-12-12 15:51:25 -08:00
Alan Leung
eaafb3cd37 Add USE_D8_DESUGAR option in build/core
Add an option to use D8's desugar instead of the standalone version.

USE_D8_DESUGAR=true m would trigger DCHECK in dex2oat unless
https://android-review.googlesource.com/c/platform/art/+/562595 is
patched in as well.

Bug: 69329508
Test: m && USE_D8_DESUGAR=false m

Change-Id: I601dada44c361e45bbc0e2227ae1544a7d9efa90
2017-12-11 14:03:09 -08:00
Colin Cross
fdea893833 Replace build/tools with build/make/tools
Test: m checkbuild
Change-Id: I8db6c27a6d2372f142d10568fe92d6f2e9a59252
2017-12-06 16:12:40 -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
Sundong Ahn
f3e8302088 Add LOCAL_SDK_VERSION := system_$(VER)
am: 5a44d1f069

Change-Id: Ief08f78484b654502d356c07d61063a16aad0572
2017-12-01 04:26:10 +00:00
Sundong Ahn
5a44d1f069 Add LOCAL_SDK_VERSION := system_$(VER)
The system_$(VER) can be set in LOCAL_SDK_VERSION, and the apk will use
android_system.jar at build time.
If LOCAL_SDK_VERSION is not defined and this module is installed in
vendor.img, LOCAL_SDK_VERSION is set to system_current.

Bug: 67724799
Test: 1. build && run on taimen
2. LOCAL_SDK_VERSION:=system_27 in ims.apk && build ims.apk && check
the vsdk_v27_intermediates.

Merged-In: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
(cherry picked from commit ef212cbe8d)
2017-12-01 00:39:07 +00:00
Colin Cross
2338f237a3 Merge "Tighten restrictions on LOCAL_JACK_COVERAGE_(INCLUDE|EXCLUDE)_FILTER"
am: 711bfabd50

Change-Id: If9f4d81504c26e3d752d4f10f161f9229fb68a8d
2017-11-22 22:37:23 +00:00
Colin Cross
711bfabd50 Merge "Tighten restrictions on LOCAL_JACK_COVERAGE_(INCLUDE|EXCLUDE)_FILTER" 2017-11-22 22:30:18 +00:00
Colin Cross
3c8d30ce60 Tighten restrictions on LOCAL_JACK_COVERAGE_(INCLUDE|EXCLUDE)_FILTER
Jack supported '?' and '*' wildcards anywhere in a filter. Tighten
the restrictions to only support '*' at the end of a filter, and
to disallow '?'.  This will allow jacoco support to be built on
top of the existing zip2zip tools.

Add checks that all filters meet the new requirements, and run
the checks outside the LOCAL_EMMA_INSTRUMENT==true check so that
mistakes can be caught without having to run a build with
coverage enabled.

Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true
Test: m in internal master
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L67200000122054710&nodeType=Trybot
Change-Id: Ib78bd3c8685fbc6bdcdb517df874186efd1cff33
2017-11-22 01:49:47 +00:00
Tomasz Wasilczyk
c792d08bd2 Merge "Silence yet more superfluous build messages."
am: 01e1fe60b8

Change-Id: I5dc1676389d4b6fb062265fac86a9d77b37c5c7b
2017-11-22 01:25:29 +00:00