Commit Graph

1058 Commits

Author SHA1 Message Date
Jaewoong Jung e7d52c779f Merge "Add android_app_import." 2019-05-02 14:00:22 +00:00
Treehugger Robot b5ad835dfe Merge "Reverse merge order of resources and implementation" 2019-05-02 03:04:24 +00:00
Colin Cross 0ef0816727 Support robolectric_test
robolectric_test will compile a suite of tests that run in
robolectric.  For now it also generates a Run* rule, later
that will be removed in favor of atest.

Bug: 123248659
Test: m RunSettingsLibRoboTests
Change-Id: I12407d0b0d639e31c1969077ba787e8985e6a506
2019-05-01 16:41:44 -07:00
Sasha Smundak 6ad772597d Fix use_embedded_native_libs handling for android_test
`use_embedded_native_libs: true` should cause
`--extract-native-libs=false` be added to the manifest_fixer invocation,
and it was not happening.
There are also minor naming improvements.

Bug: 117618214
Test: treehugger and 'atest CtsDynamicLinkerTestCases' after
cts/tests/tests/dynamic_linker has been converted to Android.bp.

Change-Id: I93ec2aed3f3b185d320e56b1b4eebb71339b81ee
2019-05-01 13:16:22 -07:00
Jaewoong Jung ccbb393651 Add android_app_import.
This is an initial version that handles the most basic cases.

Bug: 128610294
Test: app_test.go + prebuilt webview.apk
Change-Id: Ic525559aad5612987e50aa75b326b77b23acb716
2019-05-01 10:06:47 -07:00
Nicolas Geoffray 327a7e7420 Merge "Add ART folks to owner of dexpreopt related file." 2019-04-30 20:36:16 +00:00
Nicolas Geoffray 5b6061d6aa Add ART folks to owner of dexpreopt related file.
Test: N/A
Change-Id: If8c7b1801e4a08e38ab75b459d9d8eff22804f06
2019-04-30 15:33:49 +01:00
Nicolas Geoffray feef2ef4d7 Pass other boot classpath locations to the apex image.
In order to evaluate the impact of framework classes being in an image.

Test: m
Bug: 119800099
Exempt-From-Owner-Approval: this is only for an experimental config, which we would like to see
the performance before build snap.
Change-Id: Ib0d3acf8d2718ee443b3bffe8122a54f92257691
2019-04-30 13:33:10 +00:00
Colin Cross 08a409df2d Reverse merge order of resources and implementation
Merge the resources first in case one of the static libraries
merge into the implementation jars contains a duplicate resource.
Also put the manifest into the resource jar so that the default
manifest doens't override the custom manifest.

Test: m checkbuild
Change-Id: I96d117c306bc9f1346720251d3993031992cef66
2019-04-29 10:29:24 -07:00
Treehugger Robot 3d974ec295 Merge "Tag dex_preopt.profile as a path" 2019-04-26 20:50:28 +00:00
Colin Cross de4e4e6a6d Tag dex_preopt.profile as a path
Tag dex_preopt.profile with `android:"path"` so that it can be used
with a filegroup.

Test: m checkbuild
Change-Id: I5d6bbfcfcf0a1a22c9478ad57d0c55fb9b9efadd
2019-04-26 10:52:32 -07:00
Treehugger Robot 02cbe8f1c6 Merge changes Id93bcaea,Ia8f9f910
* changes:
  Pass --remove-tools-declarations to manifest merger
  Don't use merged manifest for android_library modules
2019-04-25 14:47:37 +00:00
Colin Cross 226586ca3c Merge "Support target.hostdex.required" 2019-04-25 00:06:00 +00:00
Colin Cross aa1c6f1f5a Pass --remove-tools-declarations to manifest merger
Manifest merger needs --remove-tools-declarations to match
Gradle behavior.

Bug: 112607039
Test: m checkbuild
Change-Id: Id93bcaeaf03770a4acd2e1fdf44e418f55540dd3
2019-04-24 14:41:04 -07:00
Colin Cross 90c25c6893 Don't use merged manifest for android_library modules
Don't use the merged manifest for android_library modules.  We
still have to run manifest merger for android_library modules
because Make can't handle transitive dependencies, so it will
continue to merge the manifests at each library, and then merge
the manifests of direct dependencies into the final application.

Bug: 113294940
Test: m checkbuild
Change-Id: Ia8f9f910bd0a134730ddf2d542460eeddbc0a075
2019-04-24 14:40:14 -07:00
Colin Cross 7f87f4fdeb Support target.hostdex.required
Hostdex modules sometimes need extra required modules, add
target.hostdex.required.

Bug: 131167818
Test: manual
Change-Id: I599f3499f0b738556baeb27185371a42b4c2701b
2019-04-24 20:43:14 +00:00
Colin Cross 9a4abed701 Make java_test_helper_library installable
java_test_helper_library should product an installabler, dexed
library, the same as java_test just without the auto-generated
test config.

Test: m checkbuild
Change-Id: Ie573c1d24969ba9c4feb8a2e85f8969d5d713064
2019-04-24 13:19:28 -07:00
Colin Cross e8a7dc987c Export proguard_dictionary for java_library modules
Move exporting LOCAL_SOONG_PROGUARD_DICT from AndroidLibrary
to Library so that it is exported for java_library modules.

Test: m checkbuild
Change-Id: I27ea08ad8ba9072d0648c141cdbaf447c5268f91
2019-04-24 12:52:42 -07:00
Colin Cross 28c3eb6829 Export java_host_for_device and java_device_for_host modules to Make
Robolectric needs to reference some modules declared with
java_host_for_device and java_device_for_host from Make for now.

Bug: 122331577
Test: m checkbuild
Change-Id: I09b3848edb120f2c3ee16b449b937b650f59811b
2019-04-24 05:17:22 +00:00
Jaewoong Jung 159a585251 Merge "New AndroidMk authoring system based on entry map." 2019-04-23 14:43:52 +00:00
Treehugger Robot 6fa6dfa25d Merge "Set default target SDK version for APEX" 2019-04-23 00:18:54 +00:00
Jaewoong Jung 9aa3ab1f3f New AndroidMk authoring system based on entry map.
The new system collects all Android.mk variable assignments using a map
and writes them to io.Writer. Compared to the previous system, which
directly writes all entries to buffers, this new system is more robust
and test-friendly.

Test: Built without prebuilt_etc.go change and diffed the mk output.
Test: prebuilt_etc_test.go
Change-Id: Idd28443d129ff70053295015e69328a8fa3eca47
2019-04-22 15:32:44 -07:00
Colin Cross e928452f30 Merge "Allow codename.fingerprint format for targetSdkVersion" 2019-04-22 16:48:35 +00:00
Colin Cross 8bf9bd9f91 Merge "Build framework.aidl in Soong" 2019-04-21 17:20:16 +00:00
Treehugger Robot 36ab727c82 Merge "Fix handling optimize.enabled from java_defaults" 2019-04-20 06:17:14 +00:00
Jiyong Park 71b519d6ce Set default target SDK version for APEX
Target SDK version is used for targeting an APEX to a specific set of
platform builds. Usually, the targeting is unrestricted (in case the
APEX can run on all platforms), or based on platform SDK version (e.g.
28 for P). However, when the platform is under development and SDK is
not finalized, the targeting should be much more fine-grained; the
APEX should be targeted to a very specific build that supports the same
set of APIs that the APEX was built against.

To support that, target sdk version is automatically set by the build
system. When the platform is released or SDK is finalized, the target sdk
version set to the SDK version number. If not, it is set to
<version_code>.<fingerprint> (e.g., Q.123456).
Note that the target sdk version set by the build system is used only
when the target sdk version is not explicitly set in
AndroidManifest.xml.

Bug: 130541924
Test: UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true \
UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true \
TARGET_BUILD_APPS=com.android.tzdata m
build.ninja has --target_sdk_version Q.$$(cat out/soong/api_fingerprint.txt)

Test: aapt dump badging out/dist/com.android.tzdata.apex | grep \
targetSdkVersion shows:
targetSdkVersion:'Q.6ee443d9ad5f0cca7a43cfa97b7fc62a'

Change-Id: I086230d787f01075c28fc3f0163550300fa00212
2019-04-19 14:45:41 +09:00
Colin Cross 109328714f Allow codename.fingerprint format for targetSdkVersion
Use codename.fingerprint format for targetSdkVersion if it is unset
in the manifest and UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true.

Test: manual
Bug: 130541924
Change-Id: I4e3b1274cc32038b00b292dc6d67559eb320e9e4
2019-04-18 16:05:37 -07:00
Colin Cross 3047fa23da Build framework.aidl in Soong
Move the rules to build framework.aidl into Soong, and use it
when compiling aidl files with sdk_version: "current".

Also fixes incorrectly using the aidl includes exported by the
"framework" module when the proguardRaiseDep dependency was
added.

Bug: 130798034
Test: sdk_test.go
Change-Id: I126adf1d9e7b6acb528875ff62b974ba7ad9a337
2019-04-18 13:51:58 -07:00
Colin Cross 60405e50f8 Get default sdk_test.go values from config
This will help avoid merge conflicts between branches that have
additional default libraries.

Test: sdk_test.go
Change-Id: I98d5b8b2ea939df7ef57686f3bd913d6a21edc5d
Merged-In: I98d5b8b2ea939df7ef57686f3bd913d6a21edc5d
2019-04-18 12:35:16 -07:00
Sasha Smundak 2057f82161 Fix handling optimize.enabled from java_defaults
Some module types (`android_test`, etc.) set `optimize.enabled` by
default. If such module happens to have `defaults` attribute which
clears `optimize.enabled`, the latter value is ignored.

Fixes: 129858282
Test: unit tests in java_test.go,
`atest CtsExtendedMockingTestCases` succeeds with aog/936802
reverted (that is, with cts/test/mocking converted to Android.bp)

Change-Id: Ib8e3a0ab0bd489d70ed07f626082aeae31c45e7c
2019-04-17 17:59:09 -07:00
Colin Cross 79c7c26d8a Add support for prebuilt java_sdk_library modules
Add java_sdk_library_import for use when a java_sdk_library may
be used by unbundled branches that do not have the project that
contains the original java_sdk_library module.

Bug: 130287656
Test: m checkbuild
Change-Id: I62df4bccc0da95ed6c8b31dab8f2c32cc3215e9e
2019-04-17 11:28:34 -07:00
Colin Cross f8b860a0fb Use LoadHook to create modules in java_sdk_library
Creating new modules in a mutator is dangerous, as other mutators
that need to see the new modules may already have run, in this case
the prebuilts mutator.  Move SdkLibraryMutator to a LoadHook instead.
Also moves registering the LoadHook mutator to testing.go so it is
registered for all tests.

Test: m checkbuild
Change-Id: I08bd76a0e6205d2ca27861058067a1562c339eed
2019-04-16 21:46:28 +00:00
Colin Cross 91268c668c Make makevars deterministic
Sort map keys before iterating over them to produce makevars.

Bug: 130411407
Test: m checkbuild
Change-Id: I4153977705da05a5c73e641f93d02f408209c897
2019-04-12 14:55:16 +00:00
Colin Cross df8eebecaa Zip boot image
Create a zip file containing the zipped boot image files.

Test: m out/soong/sailfish/dex_bootjars/boot.zip
Change-Id: I1b08c9aca962a5999585cbe9e665693ef4558524
2019-04-11 23:03:23 +00:00
Dan Willemsen 412160e1c9 Stop using build/target -> build/make/target symlink
Instead, fully specify build/make/target/... everywhere

Test: treehugger
Change-Id: I07ba0e9b0604919a271afd5133070616e1f404fc
2019-04-09 21:36:26 -07:00
Dan Willemsen c4bd8f8282 Include proper deps for signapk
Bug: 130111713
Test: run signapk remotely, action succeeds after this change
Change-Id: I1670a27341591e0762cdfb42bcf424f065837192
2019-04-09 21:26:14 -07:00
Dan Willemsen aad19605c5 Add extra used dependencies
Found while executing the build actions remotely.

Bug: 130111713
Test: treehugger
Test: run actions remotely with given dependencies, they pass.
Change-Id: I2bff8fb8ccf50fde446d6bcef0f1dca9b2974b4b
2019-04-09 09:50:25 -07:00
Nicolas Geoffray ce93e3c672 Merge "Use the full dexpreopt boot classpath when preopting with other images." 2019-04-09 06:04:43 +00:00
Nicolas Geoffray 06758a7e13 Use the full dexpreopt boot classpath when preopting with other images.
Bug: 119800099
Test: m
Change-Id: Ia9b34aa92ebb1b4de96ea0f8f290d798be19b2cf
2019-04-08 17:20:27 +01:00
Vladimir Marko 0975ee0de3 Check package restrictions for Java libs.
Test: m checkbuild; inspect verbose log.
Test: Manual - compile with unmet restrictions.
Bug: 122937705
Change-Id: I9360ae8b6d9ce016b7827be5e8ffc6eb521809b7
2019-04-08 14:02:14 +01:00
Nicolas Geoffray 56405f8071 Merge "Use the apex image when the device config asks for it." 2019-04-05 09:34:34 +00:00
Sasha Smundak b6d230515e Implement `host_required` and `target_required` properties.
They are counterparts of LOCAL_HOST_REQUIRED_MODULES and
LOCAL_TARGET_REQUIRED_MODULES respectively.

Fixes: 128693436
Test: treehugger, convert cts/hostsidetests/devicepolicy/Android.bp
Change-Id: Id66ffca6edffe18993ac51e8930f1d0e78178249
2019-04-04 11:24:01 -07:00
Nicolas Geoffray 25c0e03520 Use the apex image when the device config asks for it.
Test: lunch walleye_jitzygote-userdebug m && all odex file use the apex image
Bug: 119800099
Change-Id: Id2fff6a4569d48b8e6a886cb82bdba205b0dd56a
2019-04-04 18:50:56 +01:00
Colin Cross cc0ce80ed5 Fix package path of android/soong/android pctx
android/soong/common was renamed to android/soong/android long
ago, but the pctx package path was still "android/soong/common".
This required all users of rules defined in android/soong/android
to import "android/soong/android" and then
pctx.Import("android/soong/common").

Test: m checkbuild
Change-Id: I20d096522760538f7cfc2bec3d4bfeba99b275d4
2019-04-04 03:59:34 +00:00
Colin Cross b007b2bde5 Merge "Fix sdk_version: "system_current" when Platform_sdk_final=true" 2019-04-03 18:40:09 +00:00
Colin Cross ff0daf4ccf Fix sdk_version: "system_current" when Platform_sdk_final=true
When PLATFORM_VERSION_CODENAME is set to REL Platform_sdk_final
becomes true, which causes the return value of sdkVersionToNumber
for "system_current" to a real version number instead of
FutureApiLevel.  This enables the check against
PlatformSystemSdkVersions, which doesn't contain "current".  Use
the numeric value instead.

Fixes: 129786845
Test: sdk_test.go
Change-Id: If7cf211cc01c5fbf3e3ece3c3f604718a13d5a9b
2019-04-02 23:18:30 +00:00
Colin Cross caa0e1e341 Fix panic when missing hiddenapi jar
Fix a panic after reporting an error when a module is listed
in ProductHiddenAPIStubs but doesn't exist or doesn't produce
a dex jar.

Test: manual
Change-Id: I43643cbc5303536bfe0b02feedb03563ea0b540a
2019-04-02 13:03:46 -07:00
Colin Cross fe17f6f0e8 Add support for protoc plugins
Add a proto.plugin property to allow specifying a custom protoc
plugin to generate the code.

Fixes: 70706119
Test: m am StreamingProtoTest
Change-Id: I1ecdd346284b42bbcc8297019d98d2cd564eb94c
2019-04-02 16:38:55 +00:00
Colin Cross 19878da6a0 Move proto compilation to RuleBuilder
Using blueprint.Rule for protoc commands was causing code duplication
because there was no good way to run the same protoc for cc, java and
python but then run custom source packaging steps for java and python.
Move most of the code into a common function that returns a
RuleBuilder, and then let java and python add their own commands at
the end of the rule.

Bug: 70706119
Test: All Soong tests
Test: m checkbuild
Change-Id: Ic692136775d273bcc4f4de99620ab4878667c83a
2019-04-02 16:38:47 +00:00
Colin Cross 92cc71606c Merge changes I7dd4ba7f,I7887a67a
* changes:
  Add depfile support to RuleBuilder
  Add RuleBuilderCommand.Flags
2019-04-02 15:04:06 +00:00
Andrei-Valentin Onea dca6ac3e35 Merge "Automatically greylist code in 3P packages" 2019-04-02 13:10:37 +00:00
Colin Cross 1d2cf0494a Add depfile support to RuleBuilder
Allow rules built with RuleBuilder to use depfiles.  Ninja only
supports a single depfile with single output.  If there are
multiple outputs in a rule, move all but the first to implicit
outputs.  If multiple depfiles are specified, use new support
in dep_fixer to combine additional depfiles into the first depfile.

Test: rule_builder_test.go
Change-Id: I7dd4ba7fdf9feaf89b3dd2b7abb0e79006e06018
2019-03-29 16:35:06 -07:00
Andrei Onea 896237b7b9 Automatically greylist code in 3P packages
Bug: 129387816
Test: m appcompat
Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: Id55abed766a6de6a2c032ee12d5153ab73a8d65c
2019-03-29 16:51:43 +00:00
Jaewoong Jung a641ee9cc7 Fix an override_module bug.
proptools.PrependProperties doesn't replace a pointer when both the src
and the dst have one. This prevented override_module from overriding
simple value pointer properties when the base module has existing
values. It turns out this was why the name property needed to be
overwritten manually.

Bug: 122957760
Test: app_test.go
Change-Id: I3302287c31a560422548c22fade95261ddbe606a
2019-03-27 11:21:24 -07:00
Colin Cross 47fa9d3d83 Always package JNI libs into android_test modules
android_test modules should always have native libraries packaged
into the APK even when use_embedded_native_libs: false is set.

Fixes: 129298278
Test: TestJNIPackaging
Change-Id: Idfcc630f7c6579c1280a920b5d71808b0a502e06
2019-03-27 15:09:52 +00:00
Jaewoong Jung c7dd408f89 Merge "Add package_name property to android_app." 2019-03-27 14:13:15 +00:00
Jaewoong Jung 6f373f60c4 Add package_name property to android_app.
This enables users to override the package name of their apps either
directly in android_app or through override_android_app.

Bug: 122957760
Test: app_test.go
Change-Id: I98080a4076ce970fc85e58fc33495ba9b363eec9
2019-03-26 15:17:17 -07:00
Paul Duffin 42df144fd4 Add java_test_helper_library
Extracts testSuiteComponent() function to reduce duplication.

Bug: 128969758
Test: atest CtsJdwpTestCases
Change-Id: I23746b18112d22f8670666f429a665b34b1955fd
2019-03-25 11:48:01 +00:00
Treehugger Robot 6d75c9d18e Merge "Don't visit disabled modules with SOONG_COLLECT_JAVA_DEPS=true" 2019-03-23 14:41:37 +00:00
Treehugger Robot 4ada982da9 Merge "Rename jetifier property and add it to androidmk" 2019-03-23 06:09:25 +00:00
Colin Cross c48428a6bb Don't visit disabled modules with SOONG_COLLECT_JAVA_DEPS=true
Calling AndroidMk() on a disabled module may not be safe because
the module will not have had GenerateAndroidBuildActions() called
on it to initialize the data structures that AndroidMk() expects
to exist.  Check module.Enabled() before generating IDE info.

Fixes: 129089976
Test: SOONG_COLLECT_JAVA_DEPS=true m nothing
Change-Id: Icd79088c532c1842801f2bf89d92bc1a67109936
2019-03-23 04:42:57 +00:00
Jaewoong Jung 66f2e8701e Merge "Add synopsis for prebuilt_apis." 2019-03-22 17:16:45 +00:00
Colin Cross 1001a7971a Rename jetifier property and add it to androidmk
Rename jetifier_enabled to jetifier since there are no users
yet and it is more consistent with the rest of the Soong
properties.  Also add it to androidmk translation.

Fixes: 123524520
Test: androidmk_test.go
Change-Id: Ib4c688cf3cb171a822ddf7dd49467522c4c1276c
2019-03-22 15:25:30 +00:00
Jaewoong Jung e9665723da Merge "Add override_android_app module type." 2019-03-22 14:36:04 +00:00
Treehugger Robot 6b200500cc Merge "Fix checking of empty slice properties" 2019-03-22 01:22:11 +00:00
Jaewoong Jung 5fb5b2a7f5 Add synopsis for prebuilt_apis.
Test: m soong_docs
Change-Id: I0e2cefd3dd24e5c8483d32cc325a37e96d3d495c
2019-03-21 17:44:11 -07:00
Jaewoong Jung 525443aa22 Add override_android_app module type.
This is a new implementation of overriding module types that makes use
of local variants. With this, product owners can use PRODUCT_PACKAGES to
decide which override module to include in their products.

Bug: 122957760
Bug: 123640028
Test: app_test.go
Change-Id: Ie65e97f615d006b6e9475193b6017ea9d97e8e97
2019-03-21 13:26:20 -07:00
Inseob Kim 6e93ac9a32 Fix checking of empty slice properties
Properties can be empty (not nil), and in that case some weird error
messages will happen to be emitted.

Bug: N/A
Test: try to build with api_pacakges: [] and srcs: []
Change-Id: I492077616e742072696265796520737465616b21
2019-03-21 22:04:01 +09:00
Anton Hansson 53c88448fd Separate device and product overlays
This change adds book-keeping of whether an overlay came from
DEVICE_PACKAGE_OVERLAYS or PRODUCT_PACKAGE_OVERLAYS. This is
later used when writing the output to soong_app_prebuilt.mk, to
use either LOCAL_SOONG_[DEVICE|PRODUCT]_RRO_PACKAGES depending
on the original source.

This change is intended to be a noop on its own, but allows a
follow-up make change to customize the location of the auto-generated
RRO packages.

Bug: 127758779
Test: verify noop on presubmit targets
Change-Id: Ib24fe1d05be132c360dd6966f7c83968c9939f77
2019-03-21 11:25:46 +00:00
Colin Cross 8a49795df1 Replace ctx.ExpandSources with android.PathsForModuleSrc
Move the logic from ctx.ExpandSources into android.PathsForModuleSrc
and ctx.ExpandSource into android.PathForModuleSrc, and deprecate
them.  When combined with the pathDepsMutator this will let all
properties that take source paths also take filegroups or genrule
outputs, as long as they are tagged with `android:"path"`.

Test: All soong tests
Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
2019-03-20 19:36:13 +00:00
Colin Cross 07e51619a2 Remove ModuleSrcPath
ModuleSrcPath was designed as a type that ensured that modules only
referenced sources inside the directory that contained the Android.bp
file.  In practice they don't work very well, because allowing
filegroups and genrules as inputs to any module that takes a source
path means that the path might end up being to a file in another
source directory or to a generated file in the output directory.

Remove ModuleSrcPath, replacing it with SourcePath in the places
that need to explicitly refer to a path in the source tree, or
Path where it may be a source path or a generated path.

Make PathForModuleSrc return a Path instead of a SourcePath in
preparation for consolidation with ctx.ExpandSources, which will
make it possibly return paths to generated files.

Test: All soong tests
Change-Id: I973a78470ed14307eea5f6d0cc93942775a65715
2019-03-20 19:36:03 +00:00
Colin Cross 42be761ebd Add dex_import module type
Add a module type for importing a prebuilt jar that contains
classes.dex files.

Test: m with a prebuilt jar that contains classes.dex files in
      PRODUCT_BOOT_JARS
Test: java_test.go, dexpreopt_test.go, dexpreopt_bootjars_test.go
Bug: 124804356
Bug: 125517186

Change-Id: I496848f9dca11f758d49b1cb68168cec7f8e1718
2019-03-20 19:29:59 +00:00
Treehugger Robot d62bfe5604 Merge "Support package_splits" 2019-03-20 15:45:13 +00:00
Treehugger Robot 36c70bcfcb Merge "Add Conscrypt to coverage" 2019-03-20 14:52:06 +00:00
Inseob Kim 8098faad9f Refine error messages in case of missing api files
Some non-interpretable error messages has been shown in case of missing
current api files. Instead of that messy errors, This clearly tells
users what is the problem and how to fix it.

Bug: 126259114
Test: 1) try to build a sysprop_library and a java_sdk_library without
creating txt files under api/, and see it fails.
Test: 2) Copy and paste the emitted command, and try to build again.

Change-Id: I986781cc710475647c2b996b0f1c51a6f50c0ba2
2019-03-20 15:33:06 +09:00
Colin Cross e560c4aabc Support package_splits
Pass the package_splits list from the property to aapt2 as
--split arguments, sign the extra outputs, install them, and
add them as extra output files for SourceFileProducer.

Bug: 127921149
Test: TestAppSplits
Change-Id: Id94a53ae6a8a68ec81e98abba2fefc9c23feaa7a
2019-03-19 23:33:47 +00:00
Adam Vartanian fa62cfc2aa Add Conscrypt to coverage
Bug: 73156932
Test: manual coverage run
Change-Id: I20dc1595ba55d8425bf16770c1f2e6e4fa8bffae
2019-03-13 13:46:14 +00:00
Andrei-Valentin Onea fdd1457fa6 Merge "Differentiate system and test apis in whitelist" 2019-03-08 16:22:11 +00:00
Colin Cross 27b922f53e Annotate paths and deprecate ExtractSource(s)Deps
Add `android:"path"` to all properties that take paths to source
files, and remove the calls to ExtractSource(s)Deps, the
pathsDepsMutator will add the necessary SourceDepTag dependency.

Test: All soong tests
Change-Id: I488ba1a5d680aaa50b04fc38acf693e23c6d4d6d
2019-03-07 18:36:35 +00:00
Colin Cross 3d7c9827d5 Add modules for converting java modules between host and device
java_device_for_host and java_host_for_device allow treating a
device module as a host module and vice versa.  They will be useful
for converting layoutlib and robolectric to Soong, as these modules
run device java code on the host.

Bug: 117920228
Test: device_host_converter_test.go
Change-Id: Ia9a371fb41a97bc16338097f3ce8b40099744167
2019-03-05 23:09:45 +00:00
Colin Cross 762286723a Add dexpreopt_bootjars_test.go
Add a test that exercises the dexpreopt_bootjars.go singleton.

Test: dexpreopt_bootjars_test.go
Change-Id: I01d4f6e22f6ff7b809af043391d7b6209dcb8675
2019-03-05 03:17:51 +00:00
Colin Cross c28bb0b8f9 Move some java test setup later
Move ctx.Register() from testContext() to run() so that tests can
register more singletons before the env singleton is registered.
Any singletons registered after the env singleton will hit an error
if they attempt to read an environment variable.

Move setDexpreoptTestGlobalConfig from TestConfig to run() so that
a test can set their own custom config after TestConfig but before
run().

Test: All Soong tests
Change-Id: Iec47f4b7898736f583cbd6bd53e4d02a035f4fb2
2019-03-05 03:17:42 +00:00
Colin Cross 87ecbfe107 Update manifest merger to use binary
Manifest merger is now a java_binary instead of a collection of jars,
it can use the single binary as the dependency.

Bug: 112607039
Test: m checkbuild
Change-Id: Iea6c97c99a3bb09952fed2b25437b644f4e863f8
2019-03-04 22:02:01 +00:00
Colin Cross 0b9f31fb08 Replace *Escape with *EscapeList
Follow the change to blueprint to make *Escape take and return a string
and add *EscapeList that take and return slices of strings.  Fix up
a few places that were unnecessarily converting a string to a slice
and back to a string.

Test: m nothing
Change-Id: I3fa87de175522205f36544ef76aa2f04aef1b936
2019-03-04 18:11:53 +00:00
Treehugger Robot 4be65809d7 Merge "Ignore missing prebuilt_apis of java_sdk_library" 2019-03-04 07:20:55 +00:00
Inseob Kim 38449af64f Ignore missing prebuilt_apis of java_sdk_library
Building java_sdk_library without defining prebuilt_apis has been
failing with weird error messages. So one have to touch empty txt files
and create prebuilt_apis module, even when the java_sdk_library is
brand-new and has no previous versions. This commit fixes it so that API
check against previous version is skipped, in the case of missing
prebuilt_apis.

Note that Current api txt files (placed under api/ directory) are still
needed (make update-api)

Bug: 126259114
Test: tries to build without touching empty api txt files.
Change-Id: I93630f4139cbf502621693ec315dc06c0d07d1c3
2019-03-04 10:56:53 +09:00
Colin Cross 247e0cfaa4 Don't add static libs resources to implemenation jars
Static dependency resources will already be in the resources jar
and the implementation and resource jar, they shouldn't be in
the implementation jar.

Test: m checkbuild
Change-Id: I4d4dab1d2e55e92ba9a95a66b246c721b9bf6410
2019-03-03 11:34:47 -08:00
Andrei Onea e04da07dfe Differentiate system and test apis in whitelist
@SystemApi and @TestApi entries in the whitelist can now be
differentiated from the rest of the public apis.

Test: m
Change-Id: Ie6a0108540cffe11992739d6391531401378f14b
2019-03-01 17:44:13 +00:00
Colin Cross 6db4d4e613 Optimize CPU time when running d8 and r8
Pass -XX:+TieredCompilation -XX:TieredStopAtLevel=1 to the JVM to
reduce the time spent JITing, which in local experiments reduced
the CPU time of R8 while increasing the wall time, and reduced the
total number of runnable threads.

Without the new flags:
$ time out/soong/host/linux-x86/bin/r8-compat-proguard -injars out/target/common/obj/APPS/Dialer_intermediates/classes.jar ...
real	0m30.090s
user	4m35.337s
sys	0m12.853s

With the new flags:
$ time out/soong/host/linux-x86/bin/r8-compat-proguard -JXX:+TieredCompilation -JXX:TieredStopAtLevel=1 -injars out/target/common/obj/APPS/Dialer_intermediates/classes.jar ...
real	0m35.674s
user	2m45.135s
sys	0m9.531s

The increase in wall time should be offset by the better parallelism from
the reduced CPU time.

Bug: 119270658
Test: m checkbuild
Change-Id: I8fc78b5ef1f8c6f51fd97a29461b96ae2b35cada
2019-03-01 15:28:19 +00:00
Colin Cross 292d6cfd73 Merge "Move boot image oatdump phony rules into Soong" 2019-03-01 15:27:35 +00:00
Paul Duffin e28d0c0ff3 Merge changes Ib0389900,Ib2d69dea
* changes:
  Fix hiddenapi issue when REMOVE_ATB_FROM_BCP=true
  Improve hiddenapi processing so it does not require white list
2019-03-01 09:04:39 +00:00
Colin Cross c9a4c36634 Move boot image oatdump phony rules into Soong
The boot image oatdump rules depend on the details of dexpreopting
the boot image.  Instead of exporting all of the necessary values
to make, move the rules into Soong instead.  Also removes the
ART_DUMP_OAT_PATH variable, and moves the output to
out/soong/boot.*.oatdump.txt.

Test: m dump-oat-boot
Change-Id: I055b1c39918ba3425c8393b3e1b5359df055472a
2019-02-28 22:00:21 -08:00
Jaewoong Jung ce3de3df0f Merge "aapt2 flag for target manifest package override" 2019-03-01 03:24:25 +00:00
Treehugger Robot 10d21fdcb9 Merge "Add path valid check" 2019-03-01 02:34:58 +00:00
Jaewoong Jung 4102e5dca3 aapt2 flag for target manifest package override
This change adds an aapt2 flag, rename-instrumentation-target-package,
when an android test's instrumention target module's manifest package
name is overridden.

Bug: 122957760
Test: app_test.go, atest DocumentsUITests
Change-Id: I7116a51ec5ec9d61a20cd28509b3af0e383730d7
2019-02-28 15:41:45 -08:00
Treehugger Robot ef36053829 Merge "Revert "Add override_module."" 2019-02-28 23:10:33 +00:00
Alex Light 6a48032fc9 Merge "Add java_* 'services:' field" 2019-02-28 17:05:01 +00:00
Jaewoong Jung acb6db331b Revert "Add override_module."
This reverts commit aa65e17016.

Reason for revert: Not compatible with PRODUCT_PACKAGES, and so has very limited use.

Change-Id: Ib141d3984a6f12bb50989e66037494c466b066f1
2019-02-28 16:22:30 +00:00
Paul Duffin 719fed4e95 Fix hiddenapi issue when REMOVE_ATB_FROM_BCP=true
If the android.test.base is not on the bootclasspath then its stubs
should not be used as input to the hiddenapi processor.

Bug: 73711752
Test: make REMOVE_ATB_FROM_BCP=true droid && atest -p cts/tests/signature
Change-Id: Ib03899001e4350c9ad9e757e9e6d7d41bb0a3896
2019-02-28 16:15:44 +00:00
Paul Duffin d2acecaeb7 Improve hiddenapi processing so it does not require white list
Rather than have a special white list to contain the names of modules
that provide additional hiddenapi for modules on the bootclasspath
this defines a convention that such modules must have a name which is
of the format <x>-hiddenapi, where <x> is the name of the module on the
bootclasspath.

Bug: 73711752
Test: make droid && flashall -w && atest -p cts/tests/signature
Change-Id: Ib2d69dea9541b60a9bb81496f00edb65036d1ebb
2019-02-28 16:13:20 +00:00