Commit Graph

241 Commits

Author SHA1 Message Date
Cole Faust
b36d31d870 Add ctx argument to IDEInfo()
The IDEInfo() methods read properties. To make those properties
configurable, we need a context to evaluate them with.

Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: I26d4b7084439b3006e50b02277298f74a929e1aa
2024-08-27 16:04:28 -07:00
Jihoon Kang
fa3f0782f7 Remove suffix based stub matching logic
This change prevents non-stub modules with stub suffix from being
determined as the stub module, and instead makes the check more robust
by determining the condition based on the user-hidden
`Stub_contributing_api` property, which is only set for the stub
submodules generated by `java_sdk_library`.

Test: m nothing --no-skip-soong-tests
Bug: 361179822
Change-Id: I28a599c5b4fe1e8460e60580c0535aaf19e39ba3
2024-08-22 22:05:03 +00:00
Treehugger Robot
a5289ac9ef Merge changes Ia0e1b307,I63c7c33e into main
* changes:
  Define unstable container
  Define additional exception functions for container enforcement
2024-08-17 04:07:00 +00:00
Jihoon Kang
224ea08ee6 Define additional exception functions for container enforcement
These exception functions allow restriction to be loosened for some
inter-container dependencies.

Note that these functions are still no-op. Restriction enforcement will
be done in the child change.

Test: m nothing
Bug: 338660802
Change-Id: I63c7c33e33f271d4c2a84cc6070eb4896e030ab4
2024-08-16 22:57:39 +00:00
Treehugger Robot
08e76d9591 Merge "Run "ravenizer" on ravenwood jars" into main 2024-08-16 22:16:41 +00:00
Colin Cross
f0df94a76d Merge "Move kotlin stdlib to normal dependency tag" into main 2024-08-16 21:01:23 +00:00
Makoto Onuki
7ded3827a4 Run "ravenizer" on ravenwood jars
Ravenizer is a new tool to preprocess ravenwood tests.

It can optionally be applied to other java targets (for analyzing them,
etc).

The actual tool is being implemented internally, so in AOSP, we just
use a script that copies the jar file as a replacement.

Test: manual -- run `m RavenwoodBivalentTest` and make sure the ravenizer
    log message shows up.
Flag: EXEMPT host test change only
Bug: 360390999
Change-Id: I6d1f81e7c425397b16c37e7c30267957097387fd
2024-08-16 12:08:35 -07:00
Colin Cross
882d600d79 Move kotlin stdlib to normal dependency tag
The kotlin standard library was added with a custom dependency tag,
which then required special handling later.  We know up front whether
it will be treated the same as a static_libs or libs dependency, so
just reuse staticLibTag or libTag, and remove all the special handling.

Bug: 308016794
Test: TestKotlin
Flag: exempt REFACTOR
Change-Id: I2c5601faec284d88f28e13378d9cbffc24560efa
2024-08-14 15:28:34 -07: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
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
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
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
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
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
d40aac1340 Merge "Don't hold on to WritablePath" into main 2024-08-07 20:48:50 +00:00
Colin Cross
7707b246ef Don't hold on to WritablePath
Since only a single rule can write to a given WritablePath, it is
unecessary to hold on to the WritablePath once the rule has been
created.  Keeping a WritablePath causes complications, as it
prevents using the input Path as the output when no modifications to
the input file are necessary.  The normal pattern should be to create
a WritablePath using PathForModuleOut, build the rule that writes to
the WritablePath, and then store the WritablePath as a Path for use
as an input to any future rules.

WithoutRel previously only existed on OutputPath, which required
keeping the output path of the module as an OutputPath for as long
as possible in order to call WithoutRel on it at the end of the module.

Add WithoutRel to Path, make it always return a Path type, and implement
it on all the types that implement Path by using a helper in basePath.

Replace long-lived WritablePaths with Paths.

Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I40f28075ce151e4be80d6cfc7ec173dfa46f9bbf
2024-07-30 14:46:13 -07:00
Joe Onorato
a5d171773d Add jarjar_rename property to java modules.
It's the same mechanism that aconfig uses, but now it's exposed directly
to Android.bp files.  (I had wanted to test it out there before making
it a property just in case it didn't work well)

Bug: 352385368
Test: go test -v -run TestJarJar.*
Change-Id: I72d797d08a250be93779ee4b038a1b8fc62123b7
2024-07-20 17:46:15 -07:00
Spandan Das
8aac993b94 Add all compile deps to module_bp_java_deps.json
`Dependencies` in module_bp_java_deps.json currently only contains the
`libs` and `static_libs` of the corresponding module. This is only a
subset of the dependencies which are required to compile the java
module. Most notably, the SDK deps (determined using `sdk_version`) are
missing.

This CL adds all the compile dependencies to the json file. Implementation
details:
1. Add a `compileDepNames` to java.Module in base.go. Almost all the
   module types in java package are composed with the java.Module
struct.
2. Populate this property in java.Module.collectDeps. This function is
   used by java.Module.compile to determine the classpath used for
compilation.
3. Return `compileDepNames` in java.Module.CompilerDeps.

Since `compileDepNames` is populated in `GenerateAndroidBuildActions`,
update existing unit tests that check for correctness of IDEInfo.Deps

Bug: 353811607
Test: m nothing --no-skip-soong-tests
Test: cat out/soong/module_bp_java_deps.json | jq '."DebuggingRestrictionController".dependencies'
[
  "android_system_stubs_current", <-- missing previously
  "core-lambda-stubs", <-- missing previously
  "core-public-stubs-system-modules", <-- missing previously
  "com.google.android.material_material",
  ...
  ...
]

Change-Id: I166c0eaf6e87ca7adc98bb4e21447cf82612d103
2024-07-19 01:03:27 +00:00
Treehugger Robot
9678733731 Merge changes I861a60e1,I01bf99fa,I9d16dfec into main
* changes:
  Add util method HasIntersection(...)
  Implement InstallableModule for Java modules
  Collect container informations
2024-07-16 00:43:04 +00:00
Jihoon Kang
f86fe9a876 Implement InstallableModule for Java modules
This change enables the container information to be collected for Java
modules.

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: I01bf99fa274275a608601ad6248d577ae8f6dffc
2024-07-15 23:46:01 +00:00
mrziwang
9f7b9f4a9a Use OutputFilesProvider on java modules
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: I3c9f0b766325dd490bc903dc65259c3953d34606
2024-07-10 12:18:06 -07:00
Treehugger Robot
4c8f885b84 Merge "release_config: various cleanup" into main am: 000fe5ac5d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3129154

Change-Id: Iddd2935b353fdfb8a22fccdbe5aa56c6cc17496d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-14 01:51:17 +00:00
LaMont Jones
09721868db release_config: various cleanup
- move WriteMakefile to release_config.go
- use slices.Sort instead of slices.SortFunc where applicable.
- improve error message when inheriting an invalid release config

Bug: None
Test: manual
Change-Id: Id959ddccc75fad912518d5cce8d14da506e0bbea
2024-06-13 09:18:03 -07:00
Sam Saccone
695908cf6d Merge "Only generate kythe xrefs on the primary module" into main am: 6ace4cf906
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3126514

Change-Id: Id836a095e7f3c3f22fca1ed470b832da6677fb59
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-11 23:17:50 +00:00
Cole Faust
9decf834ce Only generate kythe xrefs on the primary module
Currently the kythe build is hitting the 6 hour timeout, but we're
generating kythe files for all variants. Generating them only for
the primary variant should drastically cut its runtime.

Bug: 345440993
Test: Presubmits
Change-Id: I3846b25c7f0bc22153e4f0a0cb81c5015854dd70
2024-06-11 11:50:47 -07:00
Treehugger Robot
5149417e90 Merge "Make dex_preopt.enable_prof_rewrite=false an error for optimized apps" into main am: 6e1a3815d8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3108767

Change-Id: I249dea1d5c71054ef022ec674d78dd936078ca4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 02:35:21 +00:00
Spandan Das
15a67111f8 Make dex_preopt.enable_prof_rewrite=false an error for optimized apps
If profile guided dexpreopt _and_ optimization/obfuscation is true, then
apps must use the rewritten profile created by r8/d8

Bug: 335418838
Test: m nothing --no-skip-soong-tests
Change-Id: Iac45b614f43e52ac40ad1d13df0338bcafa788c3
2024-05-30 20:44:44 +00:00
Treehugger Robot
b18a30edde Merge "Use r8/d8 optimized profile for dexpreopt" into main am: 8723705fad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3095860

Change-Id: Ifc3c21a58ff94bf7ece2a23b1f66c35eb7e51872
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-29 02:33:11 +00:00
Spandan Das
3dbda18e80 Use r8/d8 optimized profile for dexpreopt
Currently, dexpreopt supports profile guided optimization. This does not
work well with r8/d8 optimization, since the checked-in profile will not
match the dex signatures after r8/d8 has optimized the dex code.

This CL introduces a new property `dex_preopt.enable_profile_rewrting`.
If set, the checked-in profile will passed as `input` to r8 via
`--art-profile <input> <output>`. The <output> from the previous command
will be used as the profile for dexpreopt.

Test: m nothing --no-skip-soong-tests
Test: m CredentialManager with https://ag.corp.google.com/27448930
and obfuscation turned on
Test: nm -U symbol.odex # contains obfuscated methods

Bug: 335418838

Change-Id: I53beed9ed76f013262f1c503de0f2b74997c2a7f
2024-05-29 01:05:05 +00:00
Xin Li
8a31520ef8 Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550
Merged-In: I4a6dd1c5e48db7085ea41035def31f0844948a46
Change-Id: If8ad1d0d87495bbd685f5f9f03f5eb7ea78bf192
2024-05-24 08:25:18 -07:00
Jihoon Kang
46d66de1c1 Propagate DirectlyInAnyApex to transitive dependencies
`UpdateDirectlyInAnyApex` is used to propagate the ApexProperties
`DirectlyInAnyApex` and `InAnyApex` to the direct dependencies of the
direct dependencies of an apex bundle. In other words, this will be
propagated only to two-levels max dependency from the apex bundle.

However, the implementation library of the sdk library can have longer
dependency chain from the apex bundle than two levels:
e.g. apex -> bcpf -> sdk_lib -> sdk_lib impl lib

Therefore, even if the implementation library of the sdk library is
registered as a dependency using the "CopyDirectlyInAnyApexTag"
dependency tag, the ApexProperties would not be propagated to the
implementation library. In order to resolve this issue and recognize
the implementation library to be directly in apex and allow
instrumentation for the implementation library, this change proposes
propagating `DirectlyInAnyApex` and `InAnyApex` to transitive
dependencies on top of direct dependencies.

Test: DIST_DIR=dist_dir TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86_64 COVERAGE_MODULES="uwb" ./vendor/google/build/build_unbundled_coverage_mainline_module.sh && \
unzip -l out/target/product/module_x86_64/jacoco-report-classes-all.jar and ensure that framework-uwb is included
Bug: 341170242

Change-Id: I27d7a74f6e5bc3e0a044d13c619f4897b6b2eb57
2024-05-23 22:40:35 +00:00
Treehugger Robot
b07e7fd542 Merge "Instrument impl library belonging to apexes" into main 2024-05-22 19:01:41 +00:00
Jihoon Kang
690df2e31b Instrument impl library belonging to apexes
https://r.android.com/3094444 has removed instrumentation from the
implementation library of the java sdk library. However, given that the
top level java sdk library was not being instrumented before removing
the compilation action, there is no way to get the coverage data for the
java sdk library included in the mainline modules with the
aforementioned change.

As seen in b/340174053, instrumenting all impl libraries by default
may lead to double instrumentation execution time error in some edge
cases (especially with make to soong dependency).

Given the above two conditions, this change allows instrumentation for
the implementation library of the java sdk library that belongs to
apex(es).

Test: lunch husky-trunk_staging-userdebug && EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m droid dist
Test: DIST_DIR=dist_dir TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86_64 COVERAGE_MODULES="uwb" ./vendor/google/build/build_unbundled_coverage_mainline_module.sh
Bug: 341170242
Change-Id: I175e02f61e139296f5a177e6fc1c3ded760ac028
2024-05-22 04:27:38 +00:00
Spandan Das
b9c58350ca Support min_sdk_version overrides in apps
This replaces the global override of min_sdk_version (via
`APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE`) with an min_sdk_version override
that can be set by each individual soong override_app.

The use case for this are go apps which are only installed in T and
above, even though the base AOSP apexes might be installable on < T
devices.

Test: added a unit test

Bug: 295311875
Change-Id: Ie2e738a6786bb24417c675617f7c78358017c96c
2024-05-17 21:15:04 +00:00
Justin Yun
40182b6ff3 Remove duplicated CollectDependencyAconfigFiles()
android.ModuleBase already calls aconfigUpdateAndroidBuildActions()
that is the same with CollectDependencyAconfigFiles(). Remove the
CollectDependencyAconfigFiles() to avoid duplication with
aconfigUpdateAndroidBuildActions().

To make the aconfig information available in
GenerateAndroidBuildActions() of all modules, call
aconfigUpdateAndroidBuildActions() before calling
GenerateAndroidBuildActions() of each module.

Also, we don't need SetAconfigFileMkEntries(), which is a duplicate
of aconfigUpdateAndroidMkData()

Bug: 335363964
Test: diff `adb shell printflags` before and after the change.
Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
2024-05-10 10:00:14 +09:00
Jihoon Kang
a3a05460b4 Revert^2 "Remove compilation actions from java sdk library"
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.

This change relands https://r.android.com/3035972. Implementation
changes from the original change:
- "all_apex_contributions" is added as a dependecy to the implementation
  library modules where the parent sdk_library module has a prebuilt
  equivalent. This allows the source apex variant to be hidden from make
  when the prebuilt is active.

Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing
Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257
2024-05-08 17:46:31 +00:00
Treehugger Robot
9a8255f48e Merge changes from topic "cherrypicker-L27000030003160683:N90900030051335582" into main
* changes:
  Propagate transitive missing optional_uses_libs.
  Refactor the contruction of the manifest check inputs.
2024-04-16 13:35:54 +00:00
Jiakai Zhang
369370818f Propagate transitive missing optional_uses_libs.
Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
Change-Id: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
2024-04-15 12:16:21 +00:00
Jiakai Zhang
f98da19a07 Refactor the contruction of the manifest check inputs.
This is a no-op change for a majority of cases.

Before this change, the contruction of the manifest check inputs is
confusing. It mutates uses_libs properties in place just for the
manifest check, by replacing module names with library names for
direct dependencies and merging library names from CLC for both direct
denpendencies and transitive denpendencies, and then constructs manifest
check inputs from those mutated uses_libs properties. This is
error-prone and leads to insistency: the goal is to check that the CLC
matches the manifest, but the inputs to the check don't reflect the CLC.

After this change, we no longer mutate uses_libs properties in place.
Instead, we maintain a separate list of missing denpendencies, and then
construct manifest check inputs directly from the CLC for all existing
libraries, no matter they are direct or transtive, and from the separate
list of missing libraries. This change makes the logic more
consistent and straightforward, and it also allows us to easily do the
next change, which is to propagate transtive missing denpendencies.

In fact, this change revealed several bugs around library optionality
and order in CLC construction, and fixed them.

Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: I0de82e76c47995b54aba9efd41538d950256a95f
Change-Id: I0de82e76c47995b54aba9efd41538d950256a95f
2024-04-15 11:15:41 +00:00
Ronald Braunstein
cdc66f4268 Add "test-only" flag for java modules
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for java modules.

We let users set "test-only" on java_library, but not on other modules
where the module kind is implicitly test-only, like java_test.
The implementation, not the user decides it is test-only.
We also exclude it from java_defaults.

	% gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind'
	+--------------------------+----------+
	|        teams.kind        | count(*) |
	+--------------------------+----------+
	| android_test             |     1382 |
	| android_test_helper_app  |     1680 |
	| java_fuzz                |        5 |
	| java_test                |      774 |
	| java_test_helper_library |       29 |
	+--------------------------+----------+

	 % gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true and teams.kind not like "%cc_%" group by teams.kind'
	+--------------+----------+
	|  teams.kind  | count(*) |
	+--------------+----------+
	| android_test |     1382 |
	| java_fuzz    |        5 |
	| java_test    |      774 |
	+--------------+----------+

Test: m nothing --no-skip-soong-tests
Test: go test ./java
Test: m all_teams

Bug: b/327280661
Change-Id: I9c3ad947dc3d68d6427abada27449526d69daa6b
2024-04-12 11:42:10 -07:00
Jihoon Kang
033ffb9533 Merge "Collect aconfig_declarations of the dependent java_aconfig_library modules" into main 2024-04-11 17:37:58 +00:00
Zi Wang
ddb2ee512c Move jarjar repackage action before combine action
With this change, the jarjar repackage actions are only on
the local classes of each module instead of the combined jar
that contains the static libs. The static libs don't need
jarjar repackage action on this module level because it has
been repackaged when building itself.

This change also removes the skip_jarjar_repackage property
since it's incompatible with this change. Actually skipping
jarjar repackage on a dep may result in incomplete repackage
on the module output.

Test: CI and observing the build time of SystemUIGoogle
Bug: 328067025
Ignore-AOSP-First: Will cp to aosp
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:78ffdd47a658dec4bf79e63d11a5f0f3b94876a4)
Merged-In: I476d959af025c46d2ba6d3f48ea378a086666a33
Change-Id: I476d959af025c46d2ba6d3f48ea378a086666a33
2024-04-02 16:44:02 +00:00
Jihoon Kang
3921f0b356 Collect aconfig_declarations of the dependent java_aconfig_library modules
droidstubs module require aconfig_declarations modules to be specified
when the module depends on the java_aconfig_library module in order to
generate the "exportable" stubs. This adds burden to the droidstubs or
java_sdk_library module owners, as module should specify both the
java_aconfig_library and aconfig_declarations modules to genreate the
"exportable" stubs, although the necessary information from the
aconfig_declarations module can be provided from the
java_aconfig_library modules.

In order to resolve such burden, this change enables the intermediate
cache files from the associated aconfig_declarations module of a
java_aconfig_library module to be propagated to its reverse dependencies
without having the specify the aconfig_declarations modules in the
droidstubs or java_sdk_library modules definitions.

This does not mean that the intermediate cache files of every transitive
dependencies of the java_sdk_library or the droidstubs will be passed to
aconfig to retrieve the state of the aconfig flags.

Specifically, only the java_aconfig_library modules or the java_library
modules that have static dependency on java_aconfig_library modules that
are passed to droidstubs via `libs` or `srcs` (using
":module_name{.tag}" syntax) will provide the intermediate cache files
to generate the "exportable" stubs. For java_sdk_library, all modules
listed as `libs`, `static_libs`, `stub_only_libs`, and `apiScope.libs`
are passed as `libs` and all modules listed as `api_srcs` and `srcs` are
passed as `srcs` to the droidstubs modules dynamically generated in
java_sdk_library module per api scope, thus these properties will be
affected.

Note that the test is being added in the apex package. This is because
trying to register the codegen package build components in the java
package leads to circular dependency between the codegen and the java
package, as codegen package imports the java package.

Test: m nothing --no-skip-soong-tests
Bug: 329284345
Change-Id: I7953ab64776f6947808321ce8a3598154501bcfe
2024-03-29 01:11:32 +00:00
Kiyoung Kim
9743bab964 Ensure java level inter partition dependency with VNDK deprecation.
Previously JAVA dependency over partition was checked only when device
VNDK version is not empty. This change updates logic to enforce inter
partition dependency despite of VNDK version based on VNDK deprecation.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: I7444ad612aa6c525e61cc5c2a89f5421ab4465b4
2024-03-28 06:50:11 +00:00
Colin Cross
cde5534ccd Support transitive proguard specs in android_library_import
Add support for android_library_import to propagate the proguard specs
from its static dependencies.

Bug: 326265727
Test: TestExportedProguardFlagFiles
Change-Id: I174c1d7937a529958f8d240214b279062ef74868
2024-03-27 14:14:09 -07:00
Treehugger Robot
064b145365 Merge "Change java stem attribute for both device and host" into main 2024-03-20 01:05:50 +00:00
Jihoon Kang
705e63e362 Propagate intermediateCacheFiles in java modules and filegroup
This change propagates the intermediateCacheFiles generated by the
aconfig_declarations to the static rdeps that are java modules or the
rdeps that are filegroups.

Test: m nothing
Bug: 329284345
Change-Id: I02431336c1aa0378d03248f3bb6edf2f57ec3b7f
2024-03-19 20:54:05 +00:00
yangbill
2af0b6edd7 Change java stem attribute for both device and host
Bug: 329762127
Test: cd build/soong/java ; go test -run TestJavaLibHostWithStem
Test: cd build/soong/java ; go test -run TestAppStem
Test: cd build/soong/java ; go test -run TestAndroidAppImport_ArchVariants
Test: cd build/soong/java ; go test -run TestOverrideAndroidAppStem
Test: cd build/soong/java ; go test -run TestOverrideAndroidApp
Test: cd build/soong/java ; go test -run TestPackageNameOverride

Change-Id: I8fbdc82116f9a0c68121fbbeb1ef4f78f2b6fea3
2024-03-19 09:11:59 +00:00
Yu Liu
f509eba41d Merge "Validate aconfig libs are built with the correct modes." into main 2024-03-14 18:39:12 +00:00