Commit Graph

3511 Commits

Author SHA1 Message Date
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
13dbaac5b6 Make test api extend system in sdk_library.go
The test stubs for the "main" android API are being changed to
incude @SystemApi annotated APIs. Update sdk_library to make modules
and optional libraries follow the same principle.

Bug: 129133308
Test: presubmit
Change-Id: I7bd940e1a8127d954d30c532c74d684a5ba9d33c
2020-10-09 10:16:49 +01:00
Anton Hansson
746be9ca1e Remove jdiff support from droiddoc
There are no users of this flag anymore.

Bug: 158465496
Test: m
Change-Id: I8e4af0a7863f6f4ebfc21997c9d72a6745081433
2020-10-08 19:07:39 +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
Aaron Huang
846200328c Add service-connectivity to legacy core platform list
It will use stable version of platform API to compile
if module is not in this list. However, service-connectivity
still has dependencies on legacy platform API so add
it into the list to use legacy platform API.

Bug: 158268939
Test: build pass if add service-connectivity into the list
      build fail without adding target into the list
Change-Id: I629ed1454def5cf8164a6079034e2c610ed0a554
2020-10-07 15:43:48 +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
Dan Albert
d2a7987456 Replace ApiStrToNum uses with ApiLevel. am: c8060536e8 am: 6e3d089818 am: c81c409966 am: 97825a1e23 am: 049b18bb14
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1371896

Change-Id: Id26f8d0f0323da9fbf924fcb42dda23d326e2909
2020-09-25 06:00:55 +00:00
Treehugger Robot
4f6eebff0c Merge changes I0885e493,Ic37c8db9
* changes:
  linux_bionic_arm64 is added when Host_bionic_arm64 is true
  HostCross is an attribute of a Target, not OsType
2020-09-24 22:56:43 +00:00
Anton Hansson
b30f593da4 Make API lint warnings errors for system & testapi
They used to be listed to not have this treatment, but we are
baselining the existing warnings and making them errors instead.

Bug: 154317059
Test: m
Change-Id: I306b5a07d1b771cc0061aaac44f881f40fbe85ed
Merged-In: I306b5a07d1b771cc0061aaac44f881f40fbe85ed
2020-09-24 13:51:29 +01:00
Jiyong Park
1613e5541f HostCross is an attribute of a Target, not OsType
A host target is considered as being cross-compiled when the target
can't run natively on the build machine. For example, linux_glibc/x86_64
is a non-cross target on a standard x86/Linux machine, but is a cross
host on Mac. Previously, whether cross or not was a static attribute of
an OsType. For example, Windows was always considered as cross host,
while linux_bionic was not. This becomes a problem when we support more
host targets like linux_bionic/arm64 which should be cross-host on
standard x86/Linux machines.

This change removes HostCross from the OsClass type and instead adds a
property HostCross to the Target type. When a target is being added, it
is initialized to true when the target can't run natively on the current
build machine.

Bug: 168086242
Test: m
Change-Id: Ic37c8db918873ddf324c86b12b5412952b0f2be2
2020-09-24 14:14:31 +09:00
Dan Albert
4f378d75aa Convert more versions in config to ApiLevel.
The test case I removed is invalid. The codename has had its int
assigned, but the config claims it is not final.

If this ever does need to be supported it's just a matter of making
sure the Q -> 29 mapping (or whatever) in the finalized codenames map
in android/api_levels.go.

Test: treehugger
Bug: http://b/154667674
Change-Id: I4f42ec2fd4a37750519ee3937938a1c65b6bb1e8
2020-09-22 16:01:56 -07:00
Dan Albert
0b176c8038 Replace FutureApiLevel with an ApiLevel.
Keeping the int constant around for now as FutureApiLevelInt because
it's still useful in places that haven't adopted ApiLevel yet for
testing if their non-ApiLevel API level is current or not.

Test: treehugger
Bug: http://b/154667674
Change-Id: I47a7012703f41fdeb56f91edf9c83afa93042deb
2020-09-22 15:04:48 -07:00
Dan Albert
c8060536e8 Replace ApiStrToNum uses with ApiLevel.
Test: treehugger
Bug: http://b/154667674
Change-Id: I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50
2020-09-22 15:04:48 -07:00
Treehugger Robot
1f3cf5f29e Merge "Fix proguard_usage.zip with USE_RBE=true RBE_R8=true" am: 5fc50f2936 am: e11d46dbec am: fc9014fd82 am: a91e7bcb5c am: cd4491e820
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1430134

Change-Id: Ifbf30b113ac6b66cb3745131017cd12c65bc9f48
2020-09-22 20:40:25 +00:00
Treehugger Robot
5fc50f2936 Merge "Fix proguard_usage.zip with USE_RBE=true RBE_R8=true" 2020-09-22 17:59:40 +00:00
Treehugger Robot
43e9691814 Merge "Suppress reflection warnings when running metalava" am: 7ede442a9e am: 964421d8ab am: 98842ca7c0 am: 525f65dcce am: 0e98f35df2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1433193

Change-Id: I89a7554336d68d3d3b4bd729bb286df3ff372afa
2020-09-22 01:40:40 +00:00
Aurimas Liutikas
4c5efde049 Suppress reflection warnings when running metalava
Intellij PSI/UAST reflects into java.base causing
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/mnt/ssd1/out/master/soong/host/linux-x86/framework/metalava.jar) to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Upstream bug https://youtrack.jetbrains.com/issue/IDEA-210683

Bug: 168689341
Test: make checkapi
Change-Id: Ibc8954d83d5962b3cd0ea1bac9a62f6ccfc88c6c
2020-09-21 11:35:10 -07:00
Liz Kammer
fd84d991dc Merge "Make hiddenapi use prebuilt stubs when it should" am: 9d1f85da7a am: 11719185e2 am: 4bc86bdb72 am: f289c2a0ae am: 6fef26413b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1431533

Change-Id: Id8da02afdb4563b654425d3687169ef10da0987d
2020-09-21 17:19:03 +00:00
Anton Hansson
a2adc37fc9 Make hiddenapi use prebuilt stubs when it should
Bug: 160455085
Test: build_unbundled_mainline_module.sh (with disabled source-stubs)
Test: hiddenapi_singleton_test.go
Change-Id: Id93c974351b3f8efdf8e4efe4192d3809f4fcaa5
2020-09-18 08:06:58 -07:00
Colin Cross
e00c0e795d Fix proguard_usage.zip with USE_RBE=true RBE_R8=true
proguard_usage.zip contained an empty unused.txt file when
the unused.txt file wasn't specified as an output of the r8
rule.

Test: m USE_RBE=true RBE_R8=true out/soong/.intermediates/frameworks/base/packages/Shell/Shell/android_common/proguard_usage.zip
Change-Id: Ie6a7c8b2581fe21d643e675143d6cc0e2ce80456
2020-09-17 18:56:43 +00:00
Anton Hansson
7da8a66865 Merge "Make API lint warnings errors for system & testapi" 2020-09-17 10:47:21 +00:00
Treehugger Robot
214052bbcf Merge "Make robolectric runtimes a host module" am: 0fe609075d am: a53a783a13 am: 1a24371349 am: 825733a01e am: 853a7d4f62
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1427453

Change-Id: I55a1ba4b856e98b62ffe026fb2849575f9d2d337
2020-09-17 02:30:30 +00:00
Treehugger Robot
0fe609075d Merge "Make robolectric runtimes a host module" 2020-09-16 23:23:08 +00:00