Commit graph

132 commits

Author SHA1 Message Date
Jaewoong Jung
726fd0dc35 Merge "Implement DPI variants in android_app_import." am: 53ad63c127
am: a64eb7eada

Change-Id: Idcfca3ed5cbeb4955958d007ef701939cd3f26ae
2019-05-08 17:54:56 -07:00
Jaewoong Jung
53ad63c127 Merge "Implement DPI variants in android_app_import." 2019-05-08 23:34:04 +00:00
Jaewoong Jung
a5e5abc449 Implement DPI variants in android_app_import.
Bug: 128610294
Test: app_test.go
Change-Id: Ie3e558bfdb40de6b0b9df95d3b373d08a4084d7b
2019-05-07 17:55:23 -07:00
Colin Cross
2146d5642d Merge "Track sources for srcjars across modules" am: 082640d6ee
am: 222f5ee5f2

Change-Id: I1787ef4d66ebd129a15536b1455139235613ce2c
2019-05-07 10:43:23 -07:00
Colin Cross
0c4ce21615 Track sources for srcjars across modules
Robolectric coverage needs a srcjar that sometimes needs to
include sources of dependencies.  Track the arguments and
dependencies necessary to jar the sources.

Test: TestIncludeSrcs
Change-Id: I9979d2b8350923a2237e743c232e6e548f54ba3b
2019-05-06 14:22:26 -07:00
Jaewoong Jung
212106a722 Merge "Add android_app_import." am: e7d52c779f
am: 5fa44dfb04

Change-Id: I1ec1d30fe592f1997f41eb66f1ad85d9b2b4abeb
2019-05-02 07:15:42 -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
Colin Cross
19b9e855c9 Merge "Build framework.aidl in Soong" am: 8bf9bd9f91
am: 2e2967423a

Change-Id: I177c278e520177929aeb76fc1ce6f05ebc576a20
2019-04-21 10:38:53 -07:00
Colin Cross
8bf9bd9f91 Merge "Build framework.aidl in Soong" 2019-04-21 17:20:16 +00:00
Sasha Smundak
a6cc184cfd Merge "Fix handling optimize.enabled from java_defaults" am: 36ab727c82
am: 2f65feddde

Change-Id: I9ba47791f33c2722140dcfa3ddfe2b649ee3d9bd
2019-04-19 23:39:00 -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
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
a2181fdc2d Add support for prebuilt java_sdk_library modules am: 79c7c26d8a
am: c1afb65520

Change-Id: Ia26c7f53332a4821218476d6c796f7ab39928b87
2019-04-17 16:03:54 -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
f449d2aedb Merge "Use LoadHook to create modules in java_sdk_library" am: 59d4a31063
am: 414d337702

Change-Id: Ide9449f45066883662d05946fbbd43b142ec208f
2019-04-17 01:46:32 -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
Dan Willemsen
c5f8f6e93f Stop using build/target -> build/make/target symlink am: 412160e1c9
am: 8862c76a68

Change-Id: I0dacd807818a58934d436724401335f2c8366c37
2019-04-10 13:46:48 -07: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
Colin Cross
49c87dfae9 Merge "Fix sdk_version: "system_current" when Platform_sdk_final=true" am: b007b2bde5 am: 8c3f398c6c
am: 209edee425

Change-Id: I54ea846c9ac2b29354109755225db71dcdaa1527
2019-04-03 14:04:07 -07: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
fdd34fae76 Merge "Always package JNI libs into android_test modules" am: eae12cf400 am: f394fb0a27
am: b1af785608

Change-Id: I73d8243ae1bd428098f4f60b4a22c9b50785c481
2019-03-27 09:07:26 -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
79e3e79ee8 Merge "Add override_android_app module type." am: e9665723da am: 9874d6abe6
am: c3432e294e

Change-Id: I28638a23c6140ae1775187a2afc61b15db97f487
2019-03-22 07:57: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
Colin Cross
5654c3f42f Add dex_import module type am: 42be761ebd am: 66f3f2a01a
am: 5d56651745

Change-Id: I6a96468ef78f5cd0c1fab335e691bcc19a8988dd
2019-03-20 12:51:37 -07: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
Colin Cross
ccfe15d92a Merge "Add modules for converting java modules between host and device" am: e3ad4144db am: d5f25c7685
am: 3ce8fedd9a

Change-Id: I09f01ae076b93cdec5b738eed00c2d7a40e5555d
2019-03-05 20:06:45 -08: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
33db6a29cc Move some java test setup later am: c28bb0b8f9 am: 7e2b9c48ca
am: 7cb6f9e601

Change-Id: Ib0924d35bc9cd844a071e5f8729f5e2f7b8b6745
2019-03-04 19:40:03 -08: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
Jaewoong Jung
2cfaf135a4 Merge "Revert "Add override_module."" am: ef36053829 am: 4ab2e63974
am: d26cc522ac

Change-Id: Iab70e8d689eea96831afd4f3b696122b98c99d9b
2019-02-28 15:51:16 -08: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
Jaewoong Jung
049aea10f5 Merge "Add override_module." am: b709575a75 am: e8eaf4608d
am: b44bb0896b

Change-Id: I4c8faef56835a1e7d334f8dade5623c9ea07df3e
2019-02-27 20:13:56 -08:00
Jaewoong Jung
aa65e17016 Add override_module.
This new module type replaces the inherit-package function in make by
allowing developers to override the name, the certificate, and the
manifest package name of an android_app module.

Bug: 122957760
Fixes: 123640028
Test: app_test.go + BrowserGoogle
Change-Id: Iefe447e7078b25039233221361ef95c83a29973a
2019-02-27 14:35:39 -08:00
Colin Cross
e4759b9ab9 Add java/testing.go for sysprop_test.go
Share more of the setup code for java tests to sysprop_tests.go.

Test: java_test.go, sysprop_test.go
Change-Id: I0e3b287bf188c432d995a9a91a18ebef12aa47d1
Merged-In: I0e3b287bf188c432d995a9a91a18ebef12aa47d1
(cherry picked from commit b19745363f)
2019-02-16 17:08:01 -08:00
Colin Cross
b19745363f Add java/testing.go for sysprop_test.go
Share more of the setup code for java tests to sysprop_tests.go.

Test: java_test.go, sysprop_test.go
Change-Id: I0e3b287bf188c432d995a9a91a18ebef12aa47d1
2019-02-15 23:22:38 -08:00
Inseob Kim
12865b096a Create sysprop_library soong module am: c0907f191a am: 92053b977e
am: 751a2cb98a

Change-Id: Ie9976968934c4231492af4ad4cbbcfe38790f040
2019-02-13 17:25:17 -08:00
Inseob Kim
c0907f191a Create sysprop_library soong module
A newly introduced sysprop_library soong module will generate a
java_sdk_library and a cc_library from .sysprop description files.
Both Java modules and C++ modules can link against sysprop_library
module, thus giving consistency for using generated sysprop API.

As Java controls accessibility of Internal / System properties with
@hide and @SystemApi, 2 different header files will be created. And
build system will selectively expose depending on the property owner
and the place where the client libraries go into.

Bug: 80125326
Bug: 122170616
Test: 1) Create sysprop_library module.
Test: 2) Create empty txt files under prebuilts/sdk.
Test: 3) Create api directory, make update-api, and see changes.
Test: 4) Try to link against sysprop_library with various clients.
Test: 5) Soc_specific, Device_specific, Product_specific, recovery flags
work as intended.
Change-Id: I78dc5780ccfbb4b69e5c61dec26b94e92d43c333
2019-02-13 23:32:51 +00:00
Colin Cross
5e24ba9886 resolve merge conflicts of dec157bd6c to master
Bug: None
Test: treehugger
Change-Id: I701d7a4ee893eb4113a48eaee9930eceec478a29
2019-02-04 10:09:01 -08:00
Colin Cross
a74ca046da Replace *[]string with []string in product variables
There is no need for *[]string, []string can already hold a nil
value to specify "not set".

Test: all soong tests
Change-Id: I85a51b042c12aee1565a9287d62924feeeafd486
2019-02-01 16:43:02 -08:00
Insun Kang
234338609b Add updatable_media_stubs to prevent private API use.
Bug: 123551910, Bug: 123253805
Test: build
Change-Id: Id46ff05fa01db726d613ee2299b0c27921c88aae
2019-01-31 13:12:39 -08:00
Jaewoong Jung
2ad817c65d Enable certificate overrides with product vars.
Currently it is only for android_app, though it can be easily ported to
apex.

The make-side change will be made later, along with a real application.

Bug: 122957760
Test: app_test.go
Change-Id: I41f0be84f8b9f93e9518a16160e10eaa649388cd
2019-01-24 14:55:58 +00:00
Colin Cross
be9cdb8d64 Replace annotation_processors with plugins
Follow bazel's modules for annotation processors by introducing
a java_plugin module type that can contain extra metadata about
the annotation processor, the processor class and a flag to
specify if the annotation processor is compatible with the
turbine optimization.  Deprecate the annotation_processors
property, which took a list of java_library_host modules, in
favor of the plugins property, which takes a list of java_plugin
modules.  The annotation_processors property will be removed
once all uses have been replaced with plugins.

Bug: 77284273
Test: plugin_test.go
Test: m caliper
Change-Id: I37c1e80eba71ae2d6a06199fb102194a51994989
2019-01-23 20:17:51 +00:00
Colin Cross
afbb1734f6 Pass annotation processors to kotlinc
Enable the kotlin-annotation-processing plugin and pass annotation
processors to it.

Bug: 122251693
Test: m checkbuild
Test: TestKapt in kotlin_test.go
Change-Id: I841df454beaaa7edd263eea714ca0d958a03c9de
2019-01-22 21:47:19 +00:00
Colin Cross
21fc9bbe19 Move kotlin to it's own file
kapt is going to make kotlin a little more complicated, move the
rules and tests to their own files.

Bug: 122251693
Test: m checkbuild
Change-Id: Ieed78b97995ced210b710bd50c357514cc8e3bc6
2019-01-22 16:32:11 +00:00
Jaewoong Jung
b9a11518bc Enable arch variant properties in prebuilt_etc.
Bug: 122332178
Test: Soong unit tests + TreeHugger.
Change-Id: Ia8fab0add09478599398e8cbb703debc39f658f6
2019-01-17 09:02:34 -08:00
Sundong Ahn
054b19a131 Support core library
To support core library, "Openjdk9", "No_standard_libs" and metalava
properties are added to java_sdk_library.
If core_lib is true, dist paths are changed to
apistubs/core/....
impl library name is changed to {module_name}.jar instead of
{module_name}.impl.jar

Bug: 110404779
Test: m -j
Change-Id: Ieb6248ea714b4260333d8bf61573d4f3413f7f24
Merged-In: Ieb6248ea714b4260333d8bf61573d4f3413f7f24
(cherry picked from commit af4907fed7)
2019-01-16 22:00:17 -08:00
Colin Cross
98fd57460f Use latest SDK version for current in PDK builds
PDK builds need to use the latest SDK version instead of "current"
to match the behavior of Make.

Bug: 118634643
Test: sdk_test.go
Change-Id: Ice10d0ccb4066f27ce5839fc96a4026510057121
2019-01-10 07:09:35 +00:00
Colin Cross
fb6d781202 Split out sdk.go from java.go
Split out SDK handling functions from java.go to sdk.go and tests
from java_test.go to sdk.go.

Test: sdk_test.go
Change-Id: I83ef48cbe5230572c1d4ecc0e89021d2f7c71b76
2019-01-10 07:09:29 +00:00
Colin Cross
638149e650 Add dexpreopt enabled tests
Add tests that verify when dexpreopt is enabled or disabled.

Test: dexpreopt_test.go
Change-Id: Ideba9c0dac30eb31e7ae29e46d1d1590202b8369
2019-01-05 22:36:13 -08:00