Commit Graph

8616 Commits

Author SHA1 Message Date
Jihoon Kang
ca43c1fe44 Correct the name of the android.car.builtin module that is instrumented am: 6de6d7267f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3219097

Change-Id: I5b6630e12c928dcd6134ddb12c4c51fcda93e940
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-14 18:51:53 +00:00
Jihoon Kang
6de6d7267f Correct the name of the android.car.builtin module that is instrumented
java_sdk_library is not instrumented as it does not perform any
compilation actions. Instead, its submodule impl lib (with .impl suffix)
is instrumented.

Test: CI
Bug: 355514682
Bug: 339901608
Change-Id: I2f7b4a8cf14a592d268b6f5d44f72e43700b4907
2024-08-14 16:39:57 +00:00
Yu Liu
73282e8129 Merge "Merge SingletonProviderContext with OtherModuleProviderContext" into main am: 246b43049c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3216676

Change-Id: Ib0d8eb66616fa4775e3827b4956ad19034bf1cc8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-13 16:15:51 +00:00
Yu Liu
663e4508dc Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
2024-08-12 22:50:19 +00:00
Colin Cross
6bdec0cbe6 Merge changes If313580b,I68d50d68 into main am: 08b6061539
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214342

Change-Id: I301643cc587ff80e243115b8f729eba4e0cd3e02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-12 17:37:42 +00:00
Spandan Das
9b5740ceeb Merge changes Ib4581079,Ia3887bae into main am: 9dfccb91a5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214336

Change-Id: I03e42b30ce41cdadee05041afc717bf8fee36d8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-12 17:37:24 +00:00
Colin Cross
08b6061539 Merge changes If313580b,I68d50d68 into main
* changes:
  Use a provider for systems modules
  Add PrepareForTestWithBuildFlag
2024-08-12 16:53:42 +00:00
Colin Cross
b61c226943 Use a provider for systems modules
Replace the SystemModulesProvider interface with Provider

Test: all soong tests
Flag: EXEMPT refactor
Change-Id: If313580b28094d55b71f1635259bafa850ef7af5
2024-08-09 16:47:45 -07:00
Colin Cross
a66b4630f6 Add PrepareForTestWithBuildFlag
Add a helper function that creates a test fixture preparer that
sets a build flag, and use it everywhere that was setting build flags
manually.

Test: all soong tests
Flag: EXEMPT refactor
Change-Id: I68d50d68787a30d091f0827e8caa51f5c5a762ef
2024-08-09 16:47:45 -07:00
Spandan Das
b4cd5df573 Make IdeInfo aware of jarjar-ing
jarjar can be used to repackage a java_library. e.g. Foo.java in package
com.android might get repackaged to prefix.com.android.Foo in the
resultant jar. To allow code completion of rdeps, we should use the
repackaged jar instead of the src files.

This CL sets dpInfo.Jars to the header jar _only_ when jarjar_rules is
not empty. We could probably set `Jars` to the header jar even for non
jarjar-d libraries and get rid of `Srcs`, `SrcJars` altogether, but that
would likely slow down any tools that index
out/soong/module_bp_java_deps.json for code completion.

Test: go test ./java
Bug: 356572093
Change-Id: Ib45810799a479cb315aed011a34351d386a21357
2024-08-09 22:37:33 +00:00
Spandan Das
742394d3e6 Merge changes Iab6efe78,I73affae8 into main am: 788f69722c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3214777

Change-Id: I6ea2dc099a65c623271f3abe4eb9f76db7f38aac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-09 22:36:25 +00:00
Spandan Das
dee1a7419f Add .internal modules to IDEInfo.deps of top-level java_sdk_library
libraries and apps can depend on the top-level java_sdk_library like
such
```
java_library {
  name: "mylib",
  libs: ["somesdklib"],
}
```
and soong will automatically resolve mylib's classpath to either the
stub or impl library based on the api container these libraries are in.

Since the top-level java_sdk_library has no compilation actions, code
completion of `mylib` is not feasible today via
`module_bp_java_deps.json`. This CL adds support for this code
completion by registering the .impl (or public stubs) as a transtive
dependency of `mylib`.

The implication of this change is that implementation symbols of the sdk
library will be surfaced during code-completion of mylib, even when
mylib is in a different container. Long term, this should go away when
all the library dependencies are made explicit in Android.bp files.

Test: go build ./java
Test: verified that symbols of android.car.builtin (a java_sdk_library)
can be resolved with the repro instructions in b/356572093#comment5

Bug: 356572093
Bug: 358613520
Change-Id: Ia3887bae34bbd25b8c6346f43602835da32af84a
2024-08-09 22:27:47 +00:00
Spandan Das
6e8bd1cc37 Register versioned sdk dependency in module_bp_java_deps.json
java modules that link against a versioned sdk (sdk_version: <num>) get
the appropriate stub jar on its classpath, but the dependency is not
registered in its build graph. This CL registers this dependency for
module_bp_java_deps.json. Ideally, we should move this to `decodeSdkDep`
so that this dependendency becomes known to other tools that analyze
soong's module graph (e.g. soongdbg)

Test: go test ./java
Bug: 358608607
Bug: 356572093
Change-Id: Iab6efe7826d18dedfadbe4d34d78e7eb2888bd8d
2024-08-09 17:16:23 +00:00
Spandan Das
f5ee86c46f Add IdeInfo for java module types
This CL adds support for
1. java_system_modules
2. java_system_modules_import
3. java_device_for_host
4. java_host_for_device

Bug: 356572093
Test: cat out/soong/module_bp_java_deps.json | jq
'."core-all-system-modules"' is no longer null

Change-Id: I73affae834df7f6ed961fa757585242f6d388395
2024-08-08 22:38:27 +00:00
Colin Cross
5866fc2d42 Merge changes Ib238a83a,I9ed6a649 into main am: 82201c2db1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3212336

Change-Id: I3499299e5069555bb3b7df1fcd712fc4aea7e3f7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-08 18:26:02 +00:00
Colin Cross
82201c2db1 Merge changes Ib238a83a,I9ed6a649 into main
* changes:
  Use rsp for kotlin classpath
  Move kotlin stdlib after javac jars
2024-08-08 18:11:59 +00:00
Treehugger Robot
8ab67df967 Merge changes Ifc905b14,I62166c6d into main am: edcbad4054
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3212518

Change-Id: I80d58e2d6dd31b2b3909c3e6d16a88333c7fcb5f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-08 01:40:47 +00:00
Treehugger Robot
edcbad4054 Merge changes Ifc905b14,I62166c6d into main
* changes:
  Fix IDEInfo for java_import
  Add IdeInfo for android_library_import
2024-08-08 01:24:10 +00:00
Colin Cross
151156760c Merge changes I2b182cd3,Ibf6d9b79 into main am: 8c844e0b8f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3198494

Change-Id: If9cd85e3ae2c51007a0884ada2dfe9207208f242
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-08 00:09:42 +00:00
Spandan Das
6d26f80c6c Fix IDEInfo for java_import
`Jars` property in module_bp_java_deps.json should be relative to the
android build top, and not relative to the Android.bp file

Bug: 356572093
Test: m out/soong/module_bp_java_deps.json and verified that `jars` in
an arbitrary java_import module is relative to android top

Change-Id: Ifc905b14500dfa4254b27505fcc8af8f18349587
2024-08-08 00:06:29 +00:00
Spandan Das
b08bf77438 Add IdeInfo for android_library_import
The information will be used for IDE autocompletion.

Test: {
  "jars": [
    "out/soong/.intermediates/prebuilts/misc/common/androidx-test/androidx.test.core-nodeps/android_common/turbine-combined/androidx.test.core-nodeps.jar",
    "out/soong/.intermediates/prebuilts/misc/common/androidx-test/androidx.test.core-nodeps/android_common/busybox/R.jar"
  ],
  "path": [
    "prebuilts/misc/common/androidx-test"
  ]
}

Bug: 356572093

Change-Id: I62166c6d5cfa1cf0c49adf42d5d8b4ca40ab5a11
2024-08-08 00:06:23 +00:00
Colin Cross
1f75cdf980 Use rsp for kotlin classpath
Support long classpaths by passing the classpath in a file to the script
that generates build.xml.

Bug: 308016794
Test: builds
Flag: EXEMPT refactor
Change-Id: Ib238a83a26acba7ede8e55298397dbeb9a57a866
2024-08-07 14:11:43 -07:00
Colin Cross
edec77c453 Split jarjarIfNecessary out of compileJavaHeader
A future CL is going to change transitive classpath behavior when
jarjar is enabled.  In preparation, split the jarjar rules out
of compileJavaHeader into a separate jarjarIfNecessary method, and
use it on the classes and resource jars too.

Also tweak the naming of the output files in repackageFlagsIfNecessary
to be prettier.

Bug: 308016794
Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I2b182cd30631f2bd7925341b9171e6b3c0e8d450
2024-08-07 14:11:43 -07:00
Colin Cross
d1d8f17e9e Move kotlin stdlib after javac jars
A future CL is going to treat local jars separately from dependency
jars.  Rearrange the order of the kotlin standard library jars to
come after the local jars produced by javac, which will better match
the future ordering and ease ninja file comparisions.

Bug: 308016794
Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I9ed6a649350451bf1788077752db5222f50c0247
2024-08-07 14:11:43 -07:00
Colin Cross
7727c7f096 Convert JavaInfoProvider to *JavaInfo
Convert JavaInfoProvider to return a *JavaInfo instead of a JavaInfo.
This will reduce copying when reading the provider, and also allows
JavaInfo to recursively contain a depset of JavaInfos from
dependencies.

Bug: 308016794
Test: go test ./java/...
Flag: EXEMPT refactor
Change-Id: Ibf6d9b797f760ad1fe815d59839839fdfad91733
2024-08-07 14:11:43 -07:00
Treehugger Robot
3f0b5f6f12 Merge "Don't hold on to WritablePath" into main am: d40aac1340
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3198492

Change-Id: I4fdf37dbd48d995efc26f6784e61f5af57538f11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-07 21:09:40 +00:00
Treehugger Robot
d40aac1340 Merge "Don't hold on to WritablePath" into main 2024-08-07 20:48:50 +00:00
Treehugger Robot
cc98c0ccdf Merge "Annotate Set property as android:Path" into main am: 6fb39c1fce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3208729

Change-Id: I9d9e1cf5c31987327343dbadced869c37e8b75fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 23:05:36 +00:00
Treehugger Robot
6fb39c1fce Merge "Annotate Set property as android:Path" into main 2024-08-06 22:37:14 +00:00
Spandan Das
7811e46669 Annotate Set property as android:Path
This allows use of filegroups as inputs.

Test: go build ./java
Change-Id: Ibe8634b49c30dcf62f80dfa89875c43ad741eaff
2024-08-06 21:28:33 +00:00
Zi Wang
d3599fadb3 Merge "Remove unused tagSplitter function" into main am: f5bf74f35d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3208710

Change-Id: I4a4c422373417d6bce194f3ea68ae52f1851900c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 20:06:46 +00:00
Zi Wang
f5bf74f35d Merge "Remove unused tagSplitter function" into main 2024-08-06 19:36:03 +00:00
Treehugger Robot
5d2439b3b1 Merge "Revert "Revert "Enable from-text stub generation in non-sdk java..."" into main am: 4f18cfdd7d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3205865

Change-Id: I7815c3207e9d41df6e581be31ce3ec1948f7cdba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 19:06:28 +00:00
Treehugger Robot
4f18cfdd7d Merge "Revert "Revert "Enable from-text stub generation in non-sdk java..."" into main 2024-08-06 18:50:04 +00:00
Treehugger Robot
3af7b11ed0 Merge "Disable ResourceProcessorBusyBox in kythe builds" into main am: 72ae33f6fa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3207856

Change-Id: I1df1b4f8b20aaff909a4838a7fd3c6d1d5cbd764
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 17:50:53 +00:00
mrziwang
d9279cd476 Remove unused tagSplitter function
Test: CI
Bug: 357675466
Change-Id: I844476e8afbf9f3cc9f4556ba27ea62f9262cb0c
2024-08-06 10:47:03 -07:00
Treehugger Robot
72ae33f6fa Merge "Disable ResourceProcessorBusyBox in kythe builds" into main 2024-08-06 17:34:36 +00:00
Spandan Das
9602753238 Move the installation rules of boot images to soong am: 29207b57cf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3200723

Change-Id: I8d99fe7855430a66f516ba3687faf51ace237c60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:18:00 +00:00
Treehugger Robot
fc413ce622 Merge "Hide unflagged mainline prebuilts with missing source." into main am: 9b10ca4711
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3203370

Change-Id: Idbd05e89c743e0b669092a0f77a1d70ebdfb350e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:15:41 +00:00
Jihoon Kang
ad5e953a7d Merge "Revert "Enable from-text stub generation in non-sdk java_sdk_library"" into main am: f6d9965cc5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3207397

Change-Id: I46b1257ff9b15143ebed6c3a3e36db5d2617acf2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:14:59 +00:00
Treehugger Robot
696cea31d3 Merge "Enable from-text stub generation in non-sdk java_sdk_library" into main am: 99417ba9ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2983176

Change-Id: I01a3955f2c44dddff31a0b61bf18af34d243856e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-06 10:09:34 +00:00
Spandan Das
29207b57cf Move the installation rules of boot images to soong
This CL adds moves the installation rules of boot images to soong. This
will eventually allow us to build devices by skipping `katiBuild` and
moving straight to `katiPackaging`

Details
1. Drop `no_full_install` from dex_bootjars singleton. This ensures that
   the files installed by this singleton module does not get skipped
when generating the soong installs file (out/soong/installs-*)
2. Replace PackageFile with InstallFile. This registers the installation
   rules for both make-built and soong-built images (e.g.
aosp_cf_system_x86_64)
3. Implement `AndroidMkEntries` for dex_bootjars singleton. OutputFile
   needs to be non-nil so that this module does not get elided when
generating out/soong/Android-*. `OutputFile` was abritrarily set to one
of the many files installed by this singleton.

Test: no diff in
target/product/vsoc_x86_64/obj/PACKAGING/system_intermediates/file_list.txt
(top of stack)
Bug: 355700341
Bug: 355703904

Change-Id: I3531defa6bba58ef78f6d66e881502a8222fc229
2024-08-06 02:27:17 +00:00
Spandan Das
a62d9563b4 Disable ResourceProcessorBusyBox in kythe builds
ResourceProcessorBusyBox generates the R.jar binary from R.txt without
creating an intermediate R.srcjar file. Disable this behavior in kythe
builds (ctx.Config().EmitXrefRules()) to support xrefs to R imports

Test: XREF_CORPUS=$internal_corpus m nothing
Test: aninja -t query out/soong/.intermediates/frameworks/libs/systemui/animationlib/animationlib_tests/android_common/animationlib_tests.kzip
Test: verified that an R.srcjar is present in its deps

Bug: 354854007
Change-Id: I2d63c3393c5bc58103c267c4593172ce77fbc79c
2024-08-06 00:45:49 +00:00
Jihoon Kang
b0f4c0239d Revert "Revert "Enable from-text stub generation in non-sdk java..."
Revert submission 3207397-revert-2982300-java_api_library_non_sdk-FIKZOSARQI

Reason for revert: Post submit build breakage culprit fixed

Reverted changes: /q/submissionid:3207397-revert-2982300-java_api_library_non_sdk-FIKZOSARQI

Change-Id: Ic79b7fd074f02febba94183cb1479874efe044b5
2024-08-06 00:15:25 +00:00
Treehugger Robot
9b10ca4711 Merge "Hide unflagged mainline prebuilts with missing source." into main 2024-08-05 23:10:53 +00:00
Jihoon Kang
f6d9965cc5 Merge "Revert "Enable from-text stub generation in non-sdk java_sdk_library"" into main 2024-08-05 20:51:31 +00:00
Liana Kazanova
a574cd28a8 Revert "Enable from-text stub generation in non-sdk java_sdk_library"
Revert submission 2982300-java_api_library_non_sdk

Reason for revert: DroidMonitor: Potential culprit for b/357648959 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:2982300-java_api_library_non_sdk

Change-Id: I5ef7afd9ec3e10ea99f82d02172843ad9b2cfda9
2024-08-05 19:45:03 +00:00
Spandan Das
85bd4625ed Hide unflagged mainline prebuilts with missing source.
Partner worksapces contain two versions of mainline prebuilts - BigAndroid
and Go. These two prebuilts export dexpreopt'd system server artifacts
to be installed in system image. Since the install paths are same, we
run into duplicate installation rules issue unless one of them is
hidden.

This hiding was previously done by creating a dependendency between
source aosp apex to BA and Go google prebuilts. However, this
implementaion had the unfortunate side effect on the packaging name of
the Google mainline prebuilts - the name becomes the aosp apex name.

Instead of creating the dependency to aosp apex, this CL hides all
mainline apex_set(s) if it has not been flagged using
RELEASE_APEX_CONTRIBUTIONS_*. Since there are some non mainline apex
prebuilts, apex_name will be used to determine whether the prebuilt is a
mainline module.

Test: m nothing --no-skip-soong-tests
Test: In partner workspaces, downloaded the CLs in b/355682304#comment7
Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt
verified that aosp apexes are not installed, but mainline prebuilts are
installed

Test: unset RELEASE_APEX_CONTRIBUTIONS_ADSERVICES to build from source
Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt
verified that aosp adservices is installed, and adservices prebuilt is
**not* installed.

Bug: 355682304
Change-Id: Idacb65313553bdea5c0593976694de478034229e
2024-08-05 18:25:37 +00:00
Treehugger Robot
99417ba9ea Merge "Enable from-text stub generation in non-sdk java_sdk_library" into main 2024-08-05 18:25:36 +00:00
Spandan Das
c9335250b2 Merge "Create an installation rule to copy vdex to common arch device directory" into main am: acfa26b5ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3200722

Change-Id: I25a5681cdec7fa2e105a251503041b38d25cf917
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-05 17:34:12 +00:00