Commit graph

1133 commits

Author SHA1 Message Date
Mathieu Chartier
8a255acae2 Merge "Revert "Revert "Remove option to create boot image based on preloaded classes""" 2019-06-27 15:56:52 +00:00
Paul Duffin
bf46d96c60 Merge "core_current does not include framework libraries" 2019-06-27 11:43:32 +00:00
Mathieu Chartier
6adeee1131 Revert "Revert "Remove option to create boot image based on preloaded classes""
Test: make
Test: build/soong/scripts/build-ndk-prebuilts.sh

This reverts commit d3f688b521.

Change-Id: Ia8898d11d67e5f0c4d8886f13d29f5dbd5f8609b
2019-06-26 14:54:47 -07:00
Colin Cross
b2e4f475c3 Merge "Don't pass --legacy by default to aapt2 compile" 2019-06-26 17:05:34 +00:00
Mathieu Chartier
a6c4ff2cc8 Merge "Revert "Remove option to create boot image based on preloaded classes"" 2019-06-26 16:52:45 +00:00
Mathieu Chartier
d3f688b521 Revert "Remove option to create boot image based on preloaded classes"
This reverts commit 4a0473175e.

Reason for revert: NDK build broken

Change-Id: Id98bf9d5f82ed72d8c489264cf9d754e8ea1d27e
2019-06-26 16:44:38 +00:00
Mathieu Chartier
e2a8e7f0ec Merge "Remove option to create boot image based on preloaded classes" 2019-06-26 15:56:36 +00:00
Paul Duffin
7aae6e7794 core_current does not include framework libraries
Bug: 134566750
Test: m droid
Change-Id: I9496a121e28fabe0c60959ac8ccea60ec4b58544
2019-06-26 14:38:00 +01:00
Paul Duffin
735d03c65c Remove unused condition in decodeSdkDep(...)
The string "core.platform.api.stubs" is never passed to the toModule
function since change I6bb6c1a0ea24437c8253dc5d8fabd37edabc9d3e.

Bug: 134566750
Test: m droid
Change-Id: Ia425a433cd762bba30be72e837fa4199580e5b6c
2019-06-26 14:37:31 +01:00
Mathieu Chartier
4a0473175e Remove option to create boot image based on preloaded classes
From now on, the only supported approach is to use a boot image profile.

Test: make

Change-Id: Ibd8fbd1dd81db0a7b3f3b3e626a70dcc26510224
2019-06-25 15:38:25 -07:00
Colin Cross
53a87f523b Uncompress dex in unbundled privileged apps
Mainline builds privileged apps unbundled and then uses them as
prebuilts, so they need to respect the privileged flag when
deciding whether or not to uncompress the dex.

Bug: 135772877
Test: TestUncompressDex
Change-Id: I91da7116b779ae35c0617ef77dbcb9788902370c
2019-06-25 13:36:46 -07:00
Jaewoong Jung
50c744e916 Merge changes from topic "apex_notice"
* changes:
  Embed NOTICE output as an APEX asset.
  Optionally embed NOTICE files in apks.
2019-06-25 16:41:16 +00:00
Jaewoong Jung
5b425e2e20 Optionally embed NOTICE files in apks.
If embed_notices or ALWAYS_EMBED_NOTICES is set, collect NOTICE files
from all dependencies of the android_app, merge them with the app's own
one (if exists), transform it to HTML, gzip it, and put it as an asset
in the final APK output.

Bug: 135460391
Test: app_test.go
Change-Id: I52d92e2fd19b3f5f396100424665c5cc344190d8
2019-06-24 19:10:22 -07:00
Paul Duffin
5c2f963a1d Remove the no_framework_libs property
Corrects an error message that refers to no_framework_libs.

Removes any tests that use no_framework_libs:true where possible as
there are duplicate tests for sdk_version:"core_platform". Otherwise,
switches them over to use sdk_version:"core_platform".

Bug: 134566750
Test: m droid
Change-Id: I41abe1a49f5c744e3393ca9cdf0c41888f810c9f
2019-06-24 16:03:56 +01:00
Treehugger Robot
84338df001 Merge "Allow passing --legacy in aaptflags" 2019-06-24 00:59:15 +00:00
Colin Cross
4215cfd8f9 Don't pass --legacy by default to aapt2 compile
Don't pass --legacy by default, it is rarely necessary and converts
some errors into warnings that crash at runtime.  The modules that
need it have had --legacy added to aaptflags.

Bug: 135597368
Test: m java
Change-Id: Ib05a07ead4084dd32ba28df26708d81bb53f2f2a
2019-06-22 13:04:30 -07:00
Colin Cross
a0ba2f5858 Allow passing --legacy in aaptflags
--legacy will soon no longer be passed by default to all aapt2
compiles.  Allow it to be specified in aaptflags by passing it to
aapt2 compile when it is present and filtering it out from the
flags passed to aapt2 link.

Bug: 135597368
Test: m java
Change-Id: Ib65d1a9b7c32ae4ff5ab6f58e66aedfb5f296712
2019-06-22 12:59:27 -07:00
Dan Willemsen
fe310be720 Fix typo in java system modules makevars
This was preventing us from actually using system module dependencies
from Make.

Fixes: 135679136
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true m legacy-performance-test-hostdex
Change-Id: Ic51c30d09cf39e35f2fe5f534a23273f450d9138
2019-06-20 10:17:35 -07:00
Treehugger Robot
f8a698a0c6 Merge changes from topics "rbe-deps-dexpreopt-images", "rbe-deps-system-modules"
* changes:
  Expand the dexpreopt image dependencies to entire image
  Depend on all the files from system modules
2019-06-18 22:48:22 +00:00
Dan Willemsen
0f41678d00 Expand the dexpreopt image dependencies to entire image
Instead of just depending on the main .art file (boot.art, etc), also
expose the dependencies to the .oat/.vdex files (boot.oat/boot.vdex),
and all of the module files that get implicitly loading (boot-ext.*,
boot-framework.*, etc)

This is necessary for RBE, where the rule only gets the files that it
depends upon.

Test: treehugger
Test: build a system image with RBE
Change-Id: I0c7051f18582f1891d3398b46763b1521e4326c8
2019-06-18 06:40:38 +00:00
Dan Willemsen
ff60a73d89 Depend on all the files from system modules
Instead of just one of the files that we pass into javac.

Test: treehugger
Change-Id: I8478e88656487c9f667893d7c17839f0ea63c78f
2019-06-18 01:29:02 +00:00
Colin Cross
5d7409ba0f Remove SOONG_FRAMEWORK_SRCS
SOONG_FRAMEWORK_SRCS is not used in Make any more.

Test: m checkbuild
Change-Id: I61f7cdeb3d2e2fd89c8b3b302bee923624dba418
2019-06-17 14:27:15 -07:00
Paul Duffin
50c217c744 Add sdk_version:"core_platform" to replace no_framework_libs:true
Where possible this duplicates any tests that use no_framework_libs:true
with ones that use sdk_version:"core_platform". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"core_platform" to ensure that there is no regression in the
behavior of no_framework_libs:true.

Follow up changes will switch all usages of no_framework_libs:true over
to use sdk_version:"core_platform" at which point no_framework_libs will be
removed.

Bug: 134566750
Test: m droid

Change-Id: I42cb181f628b723c8f32a158ae4752b4c83365ae
2019-06-17 13:17:35 +01:00
Paul Duffin
a3d0986cfc Remove the no_standard_libs property
Corrects an error message that refers to no_standard_libs.

Removes any tests that use no_standard_libs:true where possible as
there are duplicate tests for sdk_version:"none". Otherwise, switches
them over to use sdk_version:"none".

The androidmk mapping from LOCAL_NO_STANDARD_LIBRARIES to
no_standard_libs has also been removed. There was little point in
updating the tool to map it through to sdk_version:"none" as there are
only a couple of places where it is used, in art's test running mk
targets and in some unbundled packages to work around some limitation
in .mk based build.

Bug: 134566750
Test: m droid
Change-Id: I6413c9b1fe3e63b93753a6a017d2981e32b7e013
2019-06-17 11:21:39 +01:00
Paul Duffin
301ba52886 Remove unused jars/sdk_version properties from java_system_modules
Bug: 134566750
Test: m droid
Change-Id: I2c5cd17f3f64bbde437eff65267d8c771d61e343
2019-06-17 11:21:39 +01:00
Colin Cross
ad13e1185f Merge "Support sharding robolectric tests" 2019-06-14 21:59:12 +00:00
Colin Cross
9a642dcde2 Support sharding robolectric tests
Explicitly pass the list of tests as LOCAL_ROBOTEST_FILES, and
support sharding the list of tests into multiple test runners.

Also filter out BaseRobolectricTest.java, which covers the only
use of LOCAL_ROBOTEST_FILES in Android.mk files.

Bug: 133878985
Test: m RunSettingsLibRoboTests runs the same number of tests before and after
Test: m RunSettingsLibRoboTests runs the same number of tests when sharded
Change-Id: Id85ffe03c98e722303eaa6def17812ed2244c6a6
Merged-In: Id85ffe03c98e722303eaa6def17812ed2244c6a6
2019-06-14 13:10:53 -07:00
Paul Duffin
b11c72b0b8 Merge "Add sdk_version:"none" to replace no_standard_libs:true" 2019-06-14 06:29:48 +00:00
Paul Duffin
60b393ce85 Merge "Make sdkDep/decodeSdkDep the source of truth about the sdk" 2019-06-14 06:26:02 +00:00
Paul Duffin
52d398a841 Add sdk_version:"none" to replace no_standard_libs:true
Where possible this duplicates any tests that use no_standard_libs:true
with ones that use sdk_version:"none". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"none" to ensure that there is no regression in the
behavior of no_standard_libs:true.

Follow up changes will switch all usages of no_standard_libs:true over
to use sdk_version:"none" at which point no_standard_libs will be
removed.

Bug: 134566750
Test: m droid
Change-Id: I5f0fd3daa980f6b223abe454cba7f25a97a39d7a
2019-06-13 19:15:10 +01:00
Treehugger Robot
42d33779cd Merge changes If25be604,I0a310229,I44155630
* changes:
  Add another jar used by kotlinc
  Actually depend on the headers from renderscript
  Fix a few missing dependencies in APEX building
2019-06-13 17:40:01 +00:00
Paul Duffin
250e6198d4 Make sdkDep/decodeSdkDep the source of truth about the sdk
Previously, different parts of the build used different sources of
information about the SDK (i.e. the default libraries) against which
a Java module aimed at the device was built. Some used the sdk_version
property, others used the no_standard_libs or no_framework_libs, some
used a combination of all three.

That lead to inconsistent handling in the code, e.g. some parts treated
no_standard_libs: true as implying no_framework_libs: true and others
did not, and also in the build files, e.g. some modules specified
no_framework_libs: true and sdk_version: "system_current" which makes
no sense, or no_standard_libs: true and sdk_version: "core_current"
which are inconsistent.

This is the first step in a refactoring to simplify the sdk selection
process by replacing the no_standard_libs/no_framework_libs properties
with some extra options for the sdk_version property. This change
consists of:
1) Extra functions sdkContext to access the no_standard_libs and
   no_framework_libs properties.
2) Extra field/functions in sdkDep to store and access the value of
   no_standard_libs/no_framework_libs.
3) Changes to decodeSdkDep(...) to pass the values of the no_...
   properties through to the returned sdkDep.
4) Change all code that accesses the no_... properties directly to
   call decodeSdkDep(...) to get an sdkDep object and then accessing
   the values of the no_... properties from there.

The accessor functions on sdkDep are called has...() rather than
no...() as most callers of the methods invert the value anyway and
!no...() is harder to reason about than has...().

The hasFrameworkLibs() function returns true if and only if
no_standard_libs and no_framework_libs are false. That is consistent
with all but one usage of the no_framework_libs property and that is
not affected by it.

Bug: 134566750
Test: m droid
Change-Id: I196e3304e8bd802fb154e897397b0dd337f868e2
Exempt-From-Owner-Approval: Colin has already given +2 modulo some
    minor nits and this blocking other changes.
2019-06-13 15:16:32 +01:00
Paul Duffin
1b033f5c4c Add hiddenapi_flags module type
The build generates a file out/soong/hiddenapi/hiddenapi-flags.csv
which is used by the hiddenapi-blacklist tests in cts/tests/signature.
The generation is done at the ninja level and so is not accessible from
the soong layer that runs on top. This change adds the hiddenapi-flags
module type which makes the file accessible from other soong modules.

Bug: 122332514
Test: atest -p cts/tests/signature
Change-Id: If38c8a8ffca110f2ae01f97f19a2740ca3fde1b7
Exempt-From-Owner-Approval: Colin has already reviewed and only had minor
    nits and this is blocking other changes.
2019-06-13 10:25:47 +01:00
Paul Duffin
393590d8a8 Merge "Never allow java_library_host with no_standard_libs: true" 2019-06-13 06:57:19 +00:00
Paul Duffin
45656aacab Merge "Allow java_test.go tests to use any Android.bp file" 2019-06-13 06:56:56 +00:00
Paul Duffin
5b775ae8b4 Merge "Add test for no_framework_libs:true" 2019-06-13 06:56:25 +00:00
Dan Willemsen
1cfbdbe1b2 Add another jar used by kotlinc
Bug: 130111713
Test: treehugger
Change-Id: If25be6047625cec4ed9802142876cfd8e9ccd3eb
2019-06-13 05:22:03 +00:00
Colin Cross
e51e2feafd Merge changes I89ad92f3,Ife1604c0
* changes:
  Don't add dependencies on uses-library modules in unbundled builds
  Add implicit outputs to ErrorRule rules
2019-06-13 03:36:08 +00:00
Colin Cross
3245b2cb83 Don't add dependencies on uses-library modules in unbundled builds
Unbundled builds may not have definitions of shared libraries, and
they are not dexpreopted so the dependencies are not used anyways.

Test: manual
Change-Id: I89ad92f3b073422734f824ac3a8a3b9baf995ccb
2019-06-12 20:20:21 +00:00
Colin Cross
72ea641dff Merge changes Ia17b2bcb,Ic71892c3,Id2b23b9e,I435ee7aa,I85112506, ...
* changes:
  Consolidate *MutatorContext and ModuleContext into BaseModuleContext
  Add test for missing defaults modules with AllowMissingDependencies
  Capture missing dependency error rules
  Share buildDir for android/soong/android tests
  Reimplement AddMissingDependencies
  Add GenerateAndroidBuildActions to DefaultsModuleBase
2019-06-12 20:19:55 +00:00
Alexander Smundak
90aa101152 Merge "Tune JVM, print full diagnostics on crash." 2019-06-12 15:33:06 +00:00
Paul Duffin
b815ada8c0 Never allow java_library_host with no_standard_libs: true
This combination makes no sense.

Bug: 134566750
Test: m droid
Change-Id: Ib37bbac165395c003d23225e0469ba60fa6a56ea
2019-06-12 14:08:13 +01:00
Paul Duffin
baccf7e122 Allow java_test.go tests to use any Android.bp file
Previously, the tests had to use the Android.bp file in the root
directory of the mock file system. That prevented adding tests that are
dependent on the location of the Android.bp file, e.g. ones that use
no_standard_libs. This change will process any Android.bp in the mock
filesystem.

Bug: 134566750
Test: m
Change-Id: I6fb057a473a18e87bd1a89507e78ceb3fd171eb5
2019-06-12 14:08:13 +01:00
Paul Duffin
fad7980075 Add test for no_framework_libs:true
Bug: 134566750
Test: m droid
Change-Id: Ie3c5c0730d4505c7932952eb20b5ccafd806a73a
2019-06-12 14:08:13 +01:00
Paul Duffin
b826a2f269 Remove unnecessary use of sdk_version: "core_current"
Modules that specify no_standard_libs: true should not specify the
sdk_version property as well because the former supercedes the latter.

Bug: 134566750
Test: m
Change-Id: I1d8663dc3a25baf23a1b136c7f35cf130cd7543b
2019-06-12 10:50:24 +01:00
Sasha Smundak
26c6d9e9fb Tune JVM, print full diagnostics on crash.
JVM occasionally (0.5% time) crashes on entering a method with SIGSEGV.
It might be due to excessive load on the host machine. Reduce the number
of the compiler threads to 6, and do not start all the GC threads
immediately. If JVM crashes, copy full diagnostics to stderr.

Bug: 132766811
Test: treehugger
Change-Id: Ib7bfd568f6d32456bf623cbb615ffc990c326a34
2019-06-11 13:30:13 -07:00
Pete Gillin
a53ae43180 Merge "Don't specify -encoding twice in Jdiff javadoc invocations." 2019-06-11 11:21:37 +00:00
Treehugger Robot
588857b418 Merge "Refactor .aar resource compilation" 2019-06-11 04:03:51 +00:00
Colin Cross
59037628f4 Add GenerateAndroidBuildActions to DefaultsModuleBase
Add an empty GenerateAndroidBuildActiosn to DefaultsModuleBase
so that every defaults module doesn't need to provide one.  This
will also allow adding an implementation in the next patch.

Test: m checkbuild
Change-Id: I13554bdb3a287c2f18e1efab74d4f08a1ba8620c
2019-06-10 13:51:17 -07:00
Colin Cross
a6bf56d4be Merge changes I9f8df94f,I2d7f5c56,I0ebb7381,Ieefcfc1a
* changes:
  Consolidate *MutatorContext and ModuleContext into BaseModuleContext
  Consolidate baseContext, BaseContext, and BaseModuleContext
  Rename ModuleBase receivers
  Remove repetition in android package names
2019-06-10 16:38:11 +00:00