Commit graph

828 commits

Author SHA1 Message Date
Sam Delmerico
af20c7cad1 Merge "build device binary for java_test_host" 2022-01-27 14:30:39 +00:00
Sam Delmerico
b3342ce580 build device binary for java_test_host
This commit adds support for a java_host_test that requires a target
binary to run. If the binary has host and target variants and is added
as a dependency in the `data` attribute, then the host variant is used.
Instead, we need a way to force the use of the target variant.

Bug: 182919153
Test: add code from aosp/1647282/1 && atest AuthFsHostTest
Change-Id: I68a6259b41a5e6809e1b82eec3122ffdf5067f56
2022-01-26 19:57:27 +00:00
Sorin Basca
18ecf61090 Revert^2: "Setting Java 11 as the default version"
Reverted Change: I2f9866deff41406aede24758f6eda5e5808c7f29

Reason for revert: Post-submission failure have been fixed.

Test: presubmit
Bug: 195387473
Change-Id: If5db1614ef455e2f1eae1d36cf514e13e7aab993
2022-01-24 13:31:05 +00:00
Sorin Basca
8d3e0bb25e Revert "Setting Java 11 as the default version"
Revert submission 1944928-default-java11

Reason for revert: Post-submit failures
Reverted Changes:
Ia9a0aa2a4:Setting Java 11 as the default version
Ibf5d10521:Setting Java 11 as the default version

Fixes: 215504708
Fixes: 215502091
Fixes: 215502091
Change-Id: I2f9866deff41406aede24758f6eda5e5808c7f29
2022-01-20 15:37:11 +00:00
Sorin Basca
171c2103b8 Setting Java 11 as the default version
Test: m
Change-Id: Ia9a0aa2a4aa02d7b67ad8e1cb6083d33c3d75e70
2022-01-18 09:05:34 +00:00
Jooyung Han
01d80d8b4b Make android_app.stem overridable
override_android_app can set "stem" property to set the APK name.

Bug: 193504286
Test: m (soong test)
Change-Id: I9ad66ea28bd1b030cb2c588d1f070d72e62ab1c7
2022-01-11 13:07:44 +09:00
Sam Delmerico
4e27229b61 Convert javacflags -> javacopts for java_binary_host
This has already been done for java_library modules, we need to add
similar support for java_binary_host.

Bug: 213456294
Test: go test ./bp2build
Change-Id: Idf7b631f3afe9f59e50f9e45bcbdc29fb5923cc6
2022-01-06 21:00:46 +00:00
Sorin Basca
9347ae3ba0 Adding option to include sources only for Java 11 builds
Bug: 207852002
Test: m
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_11=true m
Change-Id: I554a79798ea7f1dd4a96b09f761090f83a009cb4
2021-12-20 21:33:14 +00:00
Colin Cross
c68db4b305 Remove InstallBypassMake and ToMakePath
InstallBypassMake and ToMakePath are obsolete, remove them.

Bug: 204136549
Test: m checkbuild
Change-Id: Ie5a6f7254b3d317ed6039e114ed6aec35e1ce273
2021-12-15 15:22:53 -08:00
Wei Li
bafb6d6612 Add the initial implementation of bp2build converter for java_library,
java_library_host, java_binary_host and cc_library_host_shared so
signapk tool can be built with Bazel.

Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Test: jarsigner -verify -verbose build.bazel.examples.apex.minimal.apex
Bug: 209876137
Bug: 196204358
Bug: 210158864
Bug: 210159074
Bug: 210158872
Change-Id: I855884159d25e69d8f9623792c376da820a1eb4c
2021-12-14 17:23:19 -08:00
Treehugger Robot
f4c2bf6559 Merge changes from topic "revert-1918946-revert-1899703-AMWIVCREEV-CCTEXIRRRV"
* changes:
  Revert^2 "Add dependency license annotations"
  Revert^2 "Build license metadata files in Soong"
2021-12-11 03:32:18 +00:00
Colin Cross
65cb314c92 Revert^2 "Add dependency license annotations"
abe2a4b7bf

Change-Id: Ibcd16b5b779a4e6d4372dab9d21de76abae9ca9c
2021-12-10 23:05:02 +00:00
Colin Cross
67938c2925 Merge changes from topic "revert-1899703-AMWIVCREEV"
* changes:
  Revert "Build license metadata files in Soong"
  Revert "Add dependency license annotations"
2021-12-10 23:04:45 +00:00
Colin Cross
abe2a4b7bf Revert "Add dependency license annotations"
Revert submission 1899703

Reason for revert: b/210158272
Reverted Changes:
I142c19284:Reuse license metadata files from Soong
Ife89b8f23:Add dependency license annotations
I8e7410837:Build license metadata files in Soong

Change-Id: I51f33ae67311a3cff00d3e581d24c9a3411b7131
2021-12-10 23:02:41 +00:00
Colin Cross
b435744fdc Merge changes from topic "soong-license-metadata"
* changes:
  Add dependency license annotations
  Build license metadata files in Soong
  Escape Host*Variable contents
2021-12-10 21:43:49 +00:00
Sorin Basca
eb59a6d3ea Merge "Adding experimental option to target Java 11" 2021-12-10 13:57:51 +00:00
Colin Cross
b674b43656 Add dependency license annotations
Add annotations to dependency tags that are dynamic or classpath
linkage.

Bug: 207445310
Test: m checkbuild
Change-Id: Ife89b8f234aa40c380c721eda7dd18cab697fbb3
2021-12-08 15:08:59 -08:00
Sorin Basca
8ef3e6fd02 Adding experimental option to target Java 11
Bug: 195387073
Test: m
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_11=true m
Change-Id: Ifd7ce6218a2761a8eaf79af7d91210da2fa581aa
2021-12-07 17:46:34 +00:00
Artur Satayev
fb0a7234d7 Merge changes Ieb9aef29,I6985ebb6
* changes:
  Propagate min and max sdk versions to classpaths.proto configs.
  Introduce max_sdk_version device property.
2021-12-02 14:53:48 +00:00
satayev
0a420e771a Introduce max_sdk_version device property.
Artifacts that go into apexes should only be active on certain SDK
versions. There is now a need to upper bound the range to support
expressiong statements like "this jar should only run on platforms
30-31".

Bug: 190818041
Test: presubmit
Change-Id: I6985ebb671841cdd9f0f37f916267ac5ed76e4f4
2021-12-01 17:51:22 +00:00
Sorin Basca
c0244da203 Adding configuration support for Java 11
Bug: 195387073
Test: m
Change-Id: Ibf26f35b83b300acacae800f9962a00916869412
2021-11-26 17:26:33 +00:00
Colin Cross
3108ce17b0 Add dependency from hostdex installed module to Make intermediates
The art tests rely on a dependency existing from
out/host/linux-x86/framework/core-oj-hostdex.jar to
out/host/common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jar,
override LOCAL_SOONG_INSTALLED_MODULE for the hostdex modules so that
soong_java_prebuilt.mk adds the dependency.

Test: art/tools/buildbot-build.sh --host && art/tools/run-libcore-tests.sh '--mode=host' '--variant=X64' --debug
Change-Id: I9412147fc66d5e5f0dae52d522868a37251f781e
2021-11-10 14:38:50 -08:00
Colin Cross
24cc4be60b Move java module installation into Soong
Move java module installation rules into Soong by overriding
InstallBypassMake.  Update the locations that find host java tools
to look in the Make installation directory instead of the Soong
installation directory, which will no longer be used.

Bug: 204136549
Test: m checkbuild
Change-Id: I5af6d764c97e7ddb5ee121fc9830166c25d831b1
2021-11-05 14:24:51 -07:00
Colin Cross
1d0eb7a9d0 Fix ctx.InstallFile calls for java modules
Call ctx.InstallFile on the primary install file last so that the
primary install file can depend on the extra install files, and so that
the primary install file can be inferred from the last installed file.

Add missing ctx.InstallFile calls for the dexpreopt and hostdex outputs.

Fix the install subdirectory for modules installing to the testcases
directory.

Bug: 204136549
Test: m checkbuild
Change-Id: I7edd7647be27439d3ca0ecc589ca5e89d4ba8474
2021-11-05 14:20:28 -07:00
Paul Duffin
9804da0544 Dedup use of "prebuilt_"
Bug: 177893770
Test: m nothing
Change-Id: I664ee4d9c3aafda3de0a3f8985ee23f25db38680
2021-10-26 10:43:23 +01:00
Jiakai Zhang
ae9ba1c93a Merge "Extract the logic of setting Uncompress_dex to a common place." 2021-10-15 03:30:47 +00:00
Dan Willemsen
9fe1410213 Add android_sdk_repo_host to build platform-tools&build-tools
The Android SDK has been built with Make up until now, monolithically,
then split up into several sdk-repo zip files for different purposes.
The Mac and Windows SDKs really only need to contain the platform-tools
and build-tools pieces, but due to this monolithic sdk zip, we had to
build the whole SDK first.

This adds an `android_sdk_repo_host` module that can build these
platform-tools and build-tools zips.

Bug: 187222815
Change-Id: I55809e1d7447dd65e22461f921b2b8abb6d5f822
2021-10-13 01:25:02 -07:00
Jiakai Zhang
22450f25da Extract the logic of setting Uncompress_dex to a common place.
Bug: 194150908
Test: m nothing
Change-Id: Ia33965067586cfd48183e6d17f5d17626eef3c5a
2021-10-11 03:05:20 +00:00
Treehugger Robot
6f0c1a1e0c Merge "Preopt APEX system server jars for java_import." 2021-10-02 03:33:22 +00:00
Colin Cross
2df9ebf9ca Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory"
* changes:
  Add data_bins property
  Support per-testcase directories in all test suites
  Add environment variables to cc_genrule commands
2021-10-01 16:27:55 +00:00
Jiakai Zhang
5b24f721fd Preopt APEX system server jars for java_import.
Similar to aosp/1821985, but for java_import.

Bug: 194150908
Test: See the next CL.
Change-Id: Ied1cfb1a7e1c2eea502b74b0d6e2344bcd02155e
2021-09-30 13:31:28 +00:00
Jiakai Zhang
ea18033f31 Add a new SDK member type java_systemserver_libs.
Similar to java_boot_libs, java_systemserver_libs only provide access
to their dex implementation jar for use by dexpreopting and do not
provide an actual implementation jar.

This is used in the subsequent CL.

Bug: 194150908
Test: m nothing
Change-Id: Ib2e7d5e6c002314a0231f46934a766f4a27e610a
2021-09-30 10:06:24 +00:00
Colin Cross
cfb0f5e102 Support per-testcase directories in all test suites
There are cases where two modules try to install the same test data
into CTS, which results in collisions when CTS puts the data for all
tests in the same directory.  Add a flag that allows enabling a
per-testcase directory for an individual test for all test suites.

Bug: 193168159
Test: cts-tradefed run commandAndExit CtsBionicTestCases
Change-Id: If034723e8fe937ca71d3e2d39b7d46702e41bc8c
2021-09-27 15:56:26 -07:00
Jiakai Zhang
a14b18fb31 Merge "Remove updatable-bcp-packages.txt." 2021-09-26 03:34:28 +00:00
Jiakai Zhang
46eb0fd501 Remove updatable-bcp-packages.txt.
Historically, this file was used by the `--updatable-bcp-packages-file`
flag for dex2oat. The flag is no longer needed and is being deprecated.

Unfortunately, we cannot remove `permitted_packages` and all the code
related to it because we still need it for checking the module
compatibility with Q and R.

Bug: 200241946
Test: m nothing
Change-Id: Ie3be54fd47a847ba0caf627d12da76b415d99466
2021-09-24 03:19:05 +00:00
Martin Stjernholm
4482560cc7 Consolidate the code to resolve a deapexer module dependency.
It will get more logic in upcoming CLs.

Add a property to DeapexerInfo for the APEX name, for use in error
messages.

Test: m nothing
Bug: 192006406
Change-Id: I957f3df8b34543a38cde38768dac93e78132d672
2021-09-23 17:19:55 +01:00
Martin Stjernholm
8be1e6db16 Propagate the dex jar path as an OptionalPath which is either valid or
invalid with a message.

This will allow propagating any error from the deapexer module for
prebuilt APEXes to the location where the dex jars get used. It's only
at those points that we can raise errors about not being able to
extract files from the deapexer modules if they are invalid, and this
way we avoid encoding knowledge there about why they may be invalid.

To keep the refactoring limited it intentionally does not change any of
the existing logic for when dexJarFiles are set or not (non-nil vs nil
prior to this change), although there may be opportunity to use this
for more conditions when dex jars aren't available.

The refactoring is also not extended to
dexpreopt.ClassLoaderContextMap.

Test: m nothing
Bug: 192006406
Change-Id: I68986dccd9a9b3fee4d24caa1947ea17a36caedc
2021-09-23 17:19:55 +01:00
Dan Willemsen
b13daf2ba7 Merge "Add java_binary_host support for Windows" 2021-09-22 20:13:33 +00:00
Dan Willemsen
8e6b37119a Add java_binary_host support for Windows
So that the Windows build-tools package doesn't need to manually copy
the wrapper. Also fixes enabling java modules for Windows by hiding them
from Make, as the Make code does not handle Windows java modules
properly.

Bug: 187222815
Change-Id: I13534b38b9a9f4b5ff0630e028c3b4f88a6b34f8
2021-09-20 23:29:48 -07:00
Aurimas Liutikas
e992a52d0e Merge "Enable compose kotlinc plugin when depending on the compose runtime" 2021-09-20 23:28:33 +00:00
Colin Cross
a1ff7c6926 Enable compose kotlinc plugin when depending on the compose runtime
When a module depends on the compose runtime add a -Xplugin argument
to the kotlinc flags that enables the compose compiler plugin.

Bug: 196351110
Test: TestKotlinCompose
Change-Id: I423a3c4d12df42804a24b672a40a165bc8dd165f
2021-09-20 09:12:42 -07:00
Jiakai Zhang
519c5c82e5 Revert^2 "Preopt APEX system server jars."
This reverts commit 92346c4832.

Reason for revert: Fixed build error.

The build error is fixed by ag/15841934. This CL remains unchanged. This
CL will be submitted AFTER ag/15841934 is submitted.

Bug: 200024131
Test: 1. Patch this CL and ag/15841934 into internal master.
  2. sudo vendor/google/build/build_test.bash

Change-Id: I5f2b8357846fc7dda56e25ebe6ffb095e8047ec8
2021-09-16 06:25:26 +00:00
Adrian Roos
92346c4832 Revert "Preopt APEX system server jars."
This reverts commit ca9bc98e0c.

Reason for revert: breaks build
Bug: 200024131

Change-Id: Ide07b4c4d267370ae31107b1598b2f878c701282
2021-09-15 14:11:07 +00:00
Jiakai Zhang
ca9bc98e0c Preopt APEX system server jars.
The path to the artifacts will in the form of
/system/framework/oat/<arch>/<encoded-jar-path>@classes.{odex,vdex,art},
where <encoded-jar-path> is the path to the jar file with "/" replaced
by "@". For example,
/system/framework/oat/x86_64/apex@com.android.art@javalib@service-art.jar@classes.odex

There will be a follow-up CL to update ART runtime to recognize
artifacts in that path.

Test: m com.android.art
Bug: 194150908
Change-Id: Ic89fd63c4b1cd565684cead83fc91dae3bc97a4c
2021-09-15 09:01:07 +00:00
Paul Duffin
296701e35b Refactor SdkMemberType.AddDependencies()
Replaces the BottomUpMutatorContext parameter with a new
SdkDependencyContext type that extends BottomUpMutatorContext. This is
to allow the sdk to pass additional information to the implementations
of that method to allow the behavior to be more finely tuned.

Bug: 195754365
Test: m nothing
Change-Id: I69c6d2c523934eb67d7a7e6c55c241e9b8a81773
2021-08-31 17:07:07 +01:00
Ulya Trafimovich
0b1c70efbc Don't add uses_libs/optional_uses_libs to the manifest_fixer.
These properties specify libraries that cannot be implicitly inferred by
Soong. If these properties are added to Android.bp, this can only be for
the reason that there is a <uses-library> tag in the manifest which is
unknown to the build system. Adding them to the manifest_fixer doesn't
make sense: if they are not in the manifest, they should be removed from
Android.bp as well.

Bug: 132357300
Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
      $ adb wait-for-device && adb root && adb logcat \
        | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
        # empty grep output, no errors
Change-Id: Ic6eb5268a954ef3be7f06a181ec72af99000c547
2021-08-20 15:54:42 +01:00
Ulya Trafimovich
e4432874a9 Propagate <uses-library> dependencies from java_library to apps.
Automatically add `uses_libs`/`optional_uses_libs` properties specified
in `java_library` modules to the apps that transitively depend on these
libraries.

Note that a library may choose to specify its <uses-library> deps as
either optional or required. If this is not the right choice for an app,
it should be able to override it by specifying its own `uses_libs`/
`optional_uses_libs` properties.

Add Soong tests to cover the new cases.

Bug: 196377222
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Change-Id: I601f3e2830ed9699b78d911966ee70812d32b4f6
2021-08-18 16:57:11 +01:00
Ulya Trafimovich
fc0f6e34ce Fix the way manifest fixer detects optional <uses-library> entries.
Previously manifest_fixer used a naive way to distiniguish optional libs
from required ones: it checked if a library is on the list of optional
compatibility libraries. This works for compatibility libs, but not for
other libs.

Now we properly track optionality through all stages of the build,
starting with the addition of the library as a dependency (here's where
the `uses_libs`/`optional_uses_libs` distinction kicks in), store it in
dependency tag and propagate to class loader context, and from there to
the manifest_fixer.

The tests have been updated accordingly.

Bug: 196377222
Test: lunch bertha_x86_64-userdebug && m droid dist cts mts
Change-Id: I3631ce59ebe47116ce7a9b3d33a86f636846ef0f
2021-08-13 16:10:42 +01:00
satayev
d604b210c4 Rename UpdatableBootJars to ApexBootJars.
Note that ART apex boot jars and core-icu4j are exceptions here as they
are not part of ApexBootJars. ART apex boot jars are defined in their
own variable, while core-icu4j is treated as a regular non-updatable
boot jar.

Bug: 191127295
Test: atest CtsClasspathsTestCases
Change-Id: I3cea3d82ef521655a1a5ffa8cae2258ab9d08bfc
2021-07-22 17:35:42 +01:00
Treehugger Robot
52cc87959b Merge "Revert "Export implementation class jars for java_boot_libs"" 2021-07-19 09:49:17 +00:00