Commit Graph

3327 Commits

Author SHA1 Message Date
Colin Cross
6e34b72d76 Merge changes Ieeca3c39,Iddeea2d0,I8d66a5d3 am: 9ebc22cf2d am: f36b061333 am: ddfc6dcd42 am: 2f48ebc159
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1456349

Change-Id: I5d0658c0023bbab9d62857564d167ee2a0950f00
2020-10-13 04:54:14 +00:00
Colin Cross
9ebc22cf2d Merge changes Ieeca3c39,Iddeea2d0,I8d66a5d3
* changes:
  Add jni_libs to host java binaries
  Make java_binary common variant a dependency
  Replace jniDependencyTag with a value
2020-10-13 03:33:10 +00:00
Treehugger Robot
131ae5c4a3 Merge "Add jetifier support to android_library_import" am: ff8838cb86 am: 43dea5e3d8 am: f5005f5adb am: 30f9ce220b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1451138

Change-Id: I39b617444029a8e70979b2050915b07e7c7059dc
2020-10-13 00:30:17 +00:00
Treehugger Robot
ff8838cb86 Merge "Add jetifier support to android_library_import" 2020-10-12 23:38:06 +00:00
Jaewoong Jung
21df53c381 Merge "Apply PRODUCT_ENFORCE_RRO_TARGETS to dependencies." am: c1c415d0f7 am: 1ca5f01a37 am: a9748ead00 am: 50cdac0f07
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1451145

Change-Id: Ic70fa44bfd6446c33a15312d95872d5cd24d4bf9
2020-10-12 23:01:01 +00:00
Jaewoong Jung
c1c415d0f7 Merge "Apply PRODUCT_ENFORCE_RRO_TARGETS to dependencies." 2020-10-12 21:45:33 +00:00
Jaewoong Jung
11b75b64cb Merge "Add config.AndroidFirstDeviceTarget." am: 19bc60abee am: 460960c457 am: 5a6e34b4c1 am: 5f161bd869
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1456597

Change-Id: If84c4799b3c4c66a40e7a8aeb8735b67e016ced0
2020-10-12 18:57:17 +00:00
Saeid Farivar Asanjan
f043696fb9 Add jetifier support to android_library_import
Bug: 170242653
Test: manual
Change-Id: I9b49ea9ed18041c5509d4d53a3ce8fdf58c8c537
2020-10-12 17:51:38 +00:00
Jaewoong Jung
c779cd403f Apply PRODUCT_ENFORCE_RRO_TARGETS to dependencies.
With this change, users don't need to figure out which libraries
actually hold the resources to be overlaid when targetting apps with a
core lib dependency (e.g. Settings, SystemUI).

Fixes: 169898727
Test: app_test.go
Change-Id: I3c3b9dc0a377b1828db1199858a73d080a173205
2020-10-12 10:34:36 -07:00
Jaewoong Jung
19bc60abee Merge "Add config.AndroidFirstDeviceTarget." 2020-10-12 17:30:18 +00:00
Anton Hansson
b91d8b11e8 Merge "Make hiddenapi flag generation use new artifact" am: 53781d55bc am: 1658d4f74f am: 635e1f7193 am: 14d3bb9632
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1450117

Change-Id: I7842789d7cfc530528d7dc7bffa0f6973ffb207d
2020-10-12 17:27:55 +00:00
Anton Hansson
53781d55bc Merge "Make hiddenapi flag generation use new artifact" 2020-10-12 16:08:11 +00:00
Jaewoong Jung
642916f20a Add config.AndroidFirstDeviceTarget.
Targets[Android][0] is not always the first, preferred target. Add a new
field to config to provide the correct target and begin to use it.

Test: m nothing
Test: build/soong/scripts/build-ndk-prebuilts.sh
Fixes: 156980228
Change-Id: Ib56f52424ebf47f3eee6ac62b9fd9eca2919d63a
2020-10-12 14:15:19 +00:00
Anton Hansson
858a8cabf9 Merge "Add a Impl_only_libs prop for sdk_library" 2020-10-12 09:00:13 +00:00
Colin Cross
f376e13ce5 Revert "Make lots of tests run in parallel" am: 405af07859 am: 2ad22c3644 am: af502ff241 am: 04640cbdd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1456655

Change-Id: Iee706968d37c90bcb020c508f6650eeb7cba9da0
2020-10-10 08:12:20 +00:00
Colin Cross
89226d9ef9 Add jni_libs to host java binaries
Add a property to support dependencies on JNI libraries for host
java binaries.

Fixes: 170389375
Test: TestBinary
Change-Id: Ieeca3c3997615f0b17ae1f058b94e6c9ba929cab
2020-10-09 19:27:34 -07:00
Colin Cross
c179ea6812 Make java_binary common variant a dependency
ctx.PrimaryModule() is wrong in the case of a java_binary that
supports both host and device, use an explicit dependency instead.
Once the dependency exists there is no need to manually request
the jar be installed, it will automatically be installed by the
host installation rules for dependencies.

Test: TestBinary
Change-Id: Iddeea2d08bc574c79d42139020558cd70d718ca1
2020-10-09 19:27:34 -07:00
Colin Cross
de78d138a1 Replace jniDependencyTag with a value
Support GetDirectDepsWithTag on JNI deps by replacing the
jniDependencyTag type with a jniLibTag value.

Test: app_test.go
Change-Id: I8d66a5d3f433562e131a1fbafce75891d1b094dd
2020-10-09 19:24:05 -07:00
Colin Cross
405af07859 Revert "Make lots of tests run in parallel"
This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-09 18:34:24 -07:00
Anton Hansson
6bcf86c676 Merge "Add a Impl_only_libs prop for sdk_library" 2020-10-09 12:49:43 +00:00
Anton Hansson
7f66efa10c Add a Impl_only_libs prop for sdk_library
Similar to Stubs_only_libs, this allows being a bit more specific
about what libs compile against what. In my usecase, it allows
removing a platform dependency from the appsearch stubs, which allows
the platform to depends on the stubs.

Bug: 169304493
Test: m
Change-Id: Ie997462819cd5266a761b2d415e81806c7877967
Merged-In: Ie997462819cd5266a761b2d415e81806c7877967
2020-10-09 13:49:30 +01:00
Anton Hansson
c92fa2d706 Add a Impl_only_libs prop for sdk_library
Similar to Stubs_only_libs, this allows being a bit more specific
about what libs compile against what. In my usecase, it allows
removing a platform dependency from the appsearch stubs, which allows
the platform to depends on the stubs.

Bug: 169304493
Test: m
Change-Id: Ie997462819cd5266a761b2d415e81806c7877967
2020-10-08 17:34:57 +01:00
Colin Cross
c7e8d7d11b Merge "Make lots of tests run in parallel" am: 45fd6ace7e am: e81d9e0142 am: c1577e018e am: c2e904d7e1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1439471

Change-Id: Ib0d3b461de8d5d3825c491ad393a3bd3969c2d07
2020-10-07 22:10:24 +00:00
Colin Cross
45fd6ace7e Merge "Make lots of tests run in parallel" 2020-10-07 20:40:38 +00:00
Colin Cross
04d9c96afe Merge "Remove global state from apex modules" am: 43159bd1b7 am: 21bb1d491c am: 2c76247f51 am: 393b394b85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1428815

Change-Id: I264afeceec4bdbc344ba812b1c5fd88fed043214
2020-10-07 20:02:47 +00:00
Paul Duffin
2ea888fddf Merge "Allow access to the class jar for java_import using {.jar} tag" am: a87ea4587d am: d8c90a7e8d am: ee7a67ae65 am: 9c3caa7815
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1450820

Change-Id: I32a9c118a890c156780e68fe69f274bfd48640bb
2020-10-07 18:42:37 +00:00
Colin Cross
43159bd1b7 Merge "Remove global state from apex modules" 2020-10-07 17:58:00 +00:00
Paul Duffin
a87ea4587d Merge "Allow access to the class jar for java_import using {.jar} tag" 2020-10-07 17:16:43 +00:00
Anton Hansson
b3cbd61846 Make hiddenapi flag generation use new artifact
Use the output of new genrule combined-removed-dex instead of the
removedDexApi output from various metalava runs when generating the
hiddenapi-flags.csv file.

There are some minor difference in the two combined-removed-dex files,
but these diffs do not amount to any diffs in the generated
hiddenapi-flags.csv file. See the full set of diffs here:
https://paste.googleplex.com/6632343525654528

Bug: 158465496
Test: diff hiddenapi-flags.csv before and after
Change-Id: I082d18fc2b8a57ea8c5941d5c955a7970ab9d860
2020-10-07 12:28:23 +01:00
Anton Hansson
2aad37c52a Merge "Add outputfiles tags for droidstubs api txts" am: 70bc545407 am: c9e7c18c40 am: 2eca928722 am: 5bcaacc636
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1446800

Change-Id: I6f85c92795d131b041a9f06d14dc29775cfa2052
2020-10-07 11:12:29 +00:00
Ulyana Trafimovich
66673770a6 Merge changes from topic "uses-libs-24" am: 9f701fa348 am: 2b45163773 am: 8a61f3ca89 am: b25df83dfe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1435492

Change-Id: Ibcc01b05f6c254ae13c0791a546e26f7e7e9724a
2020-10-07 10:17:57 +00:00
Anton Hansson
70bc545407 Merge "Add outputfiles tags for droidstubs api txts" 2020-10-07 09:54:43 +00:00
Ulyana Trafimovich
9f701fa348 Merge changes from topic "uses-libs-24"
* changes:
  Fail the build if dexpreopt cannot find path to a <uses-library>.
  Add dependency on implementation <uses-library> for modules that depend on component libraries.
2020-10-07 09:18:02 +00:00
Treehugger Robot
1d34218999 Merge "Avoid panic when a boot jar is provided as a java_import" am: a8baa88424 am: 3641d82f7e am: f67292088a am: 7fc1aef3c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1450816

Change-Id: I5bff5559eecb5286de5dddf5a3739be6c48f30cc
2020-10-06 22:18:59 +00:00
Colin Cross
323dc60712 Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.

Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-10-06 15:12:22 -07:00
Colin Cross
56a8321c21 Remove global state from apex modules
A global variant was used to store the global mapping between
modules and APEXes.  Replace it with storing pointers to APEX
contents inside each module so that they can query the contents
of any APEXes they belong to.

Bug: 146393795
Test: all Soong tests
Test: single line change to build.ninja host install dependency ordering
Test: no Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: Id2d7b73ea27f8c3b41d30820bdd86b65c539bfa4
2020-10-06 13:39:57 -07:00
Paul Duffin
aa55f74505 Allow access to the class jar for java_import using {.jar} tag
Layoutlib requires access to the jar file (containing .class) files for
a number of libraries including "core-libart". It does that using the
{.jar} output tag, e.g. "core-libart{.jar}".

This change makes sure that works when "core-libart" is provided as a
java_import instead of a java_library.

Bug: 142938164
Test: m nothing
Change-Id: I605019d680c28e4a33f0ca14279d63fa62b9774b
2020-10-06 17:48:37 +01:00
Paul Duffin
81febc4500 Avoid panic when a boot jar is provided as a java_import
Bug: 142938164
Test: m nothing
Change-Id: I607009825f5946d7e1daa31dc1e4bb8f2609206d
2020-10-06 16:54:02 +01:00
Ulya Trafimovich
39b437b25f Add dependency on implementation <uses-library> for modules that depend on component libraries.
If a dexpreopted Java module depends on a component library (such as
stubs), it must be dexpreopted against the implementation library,
because that is what it will use at run time. Therefore dexpreopt needs
to know about the implementation library.

One of the subtests of TestUsesLibraries is removed. This is because the
subtest was previosuly split in two variants with the only difference
that the first variant had dependency on a stubs library, and the second
one had dependency on the implementation. The latter caused dexpreopt to
be disabled because Soong couldn't find the implementation (it had only
the name, but no access to the module). Now that there is a dependency
on the implementation, the problem goes away and the two subtest
variants can be merged into one.

Add a method for getting the name of the implementation library for the
optional SDK library. Currently it is the same as the SDK library name,
but it may change in future.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I584df4b6db874c7ae3c478231fc51572a46929b1
2020-10-06 14:04:49 +01:00
Anton Hansson
ecf5435590 Add outputfiles tags for droidstubs api txts
These can then easily be used in genrules to merge txt files.

Bug: 169034951
Test: m combined-dex-api
Change-Id: Id49739c90a2ab52a72094b76696a4e5211c8d742
2020-10-06 10:01:29 +01:00
Paul Duffin
8653710545 Merge "Add support for using sdk_version: "module_<ver>"" am: 3a7e672abe am: c218ace51c am: a42ddeddfa am: 36d851ac26 am: f5d8fda386
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1442937

Change-Id: I891a840d7d77bd8652f070f8970e7ba77d1a996b
2020-10-01 12:21:28 +00:00
Paul Duffin
fb6ae5bc73 Add support for using sdk_version: "module_<ver>"
Fixes a panic when trying to build something with
sdk_version: "module_30".

Test: m nothing
Change-Id: I9b2ce50957f59e2bead335ffa58888e15cda1f78
2020-09-30 16:20:17 +01:00
Paul Duffin
0b697c3cc8 Merge "Allow java_sdk_library to specify doctags_files" am: 41b0876c10 am: 5420a8744b am: 438998b811 am: e80c041af4 am: 48b1ad0eb5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1432649

Change-Id: Ica8537abb0d4b6449f370249ae9d4eaf5edaf1ec
2020-09-29 15:50:49 +00:00
Paul Duffin
a2ae7e0358 Allow java_sdk_library to specify doctags_files
When generating Javadoc the processor needs to be given information
about the doctags that are present in the source. This change allows
that information to be managed with the java_sdk_library that generates
the stubs source from which the Javadoc is generated.

Bug: 168301990
Test: Built offline-sdk-docs with and without the change and
      diffed them. The only difference was the timestamp.js
      file.
Change-Id: I4adbeb0781bc2191461fec856ffa90ea185e7434
2020-09-28 18:35:57 +01:00
Paul Duffin
f9687df713 Merge "Output Javadoc comments for public API" am: d124b6b4e8 am: b3bc8c5eb7 am: aeca3f8bcd am: 0588954bc1 am: a10b546b82
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1439053

Change-Id: I81bb66dc4602f36e73aedb8eb48fd128ef9a61b9
2020-09-28 16:37:10 +00:00
Paul Duffin
6877e6d951 Output Javadoc comments for public API
When generating stubs source for contributions to the public API keep
the Javadoc comments from the input source so that the stubs source can
be used as input to the metalava invocation that creates the stubs from
which the public Javadoc is generated.

This is needed to fix an issue with conscrypt's contributions to the
public API, i.e. SSLEngines and SSLSockets where the Javadoc comments
were not present in the generated Javadoc.

Test: Built offline-sdk-docs with and without the change and
      diffed them. The only difference was the timestamp.js
      file and they now included proper documentation for the
      SSLEngines/SSLSockets classes.
Bug: 169162018
Change-Id: I1b50cff3b91766ce261b2f8e798b77ebc6faac70
2020-09-25 20:23:37 +01:00
Treehugger Robot
e798cae7e5 Merge changes I0885e493,Ic37c8db9 am: 4f6eebff0c am: bbfd7e016a am: e67f4200fd am: 2b04afb880 am: 2c81bf414e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1429848

Change-Id: Id5cd03ac91d2ea43a7d3b42d4c682b2cb5621a39
2020-09-25 07:01:03 +00:00
Anton Hansson
a6906e2329 Merge "Make API lint warnings errors for system & testapi" 2020-09-25 06:52:57 +00:00
Dan Albert
40e6162788 Merge changes from topics "soong-apilevel", "soong-config-apilevel" am: 8bd5095362 am: 587f425a1b am: eee05b3d29 am: 2be28db3af am: f6805df843
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1388352

Change-Id: I2e1c94c83f5ca7df45534027651075e9b4b39e95
2020-09-25 06:01:02 +00:00
Dan Albert
063452b1c1 Replace FutureApiLevel with an ApiLevel. am: 0b176c8038 am: d5e15a13df am: 818d1b4e6e am: d997f3cd33 am: 07f0cae3c7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1388351

Change-Id: Ife2f7c6a1d6dc9828c07ef6341b774e23d40fe3e
2020-09-25 06:00:59 +00:00