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
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
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
`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
This reverts commit 323dc60712.
Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests
Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
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
This allows a jarjar rule to be shared among multiple targets in
different directories.
Bug: 86259915
Test: use filegroup jarjar_rules
Change-Id: I3fa476c4e87e2460ab9fabfb34229f471c80e6b0
- Register a singleton and implement GenerateBuildActions func in java/jdeps.go.
- Declare a interface and a struct to collect info in android/module.go.
- Implement IDEInfo for Library & Import module in java/jdeps.go.
- Implement IDEInfo for Genrule module in genrule/genrule.go.
- Implement IDEInfo for fileGroup module in android/filegroup.go.
- Test codes for jdeps.go in java/jdeps_test.go.
Bug: 111044346
Test: export SOONG_COLLECT_JAVA_DEPS=1;mmm packages/apps/Settings
out/soong/module_bp_java_deps.json will be generated
Change-Id: If61da77b4d7614c2c5da438b6af4c725ceccc5c3