Commit graph

14 commits

Author SHA1 Message Date
LaMont Jones
0c10e4dcc0 Parallelize singleton execution
Bug: 281536768
Test: manual, presubmits
Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
2023-05-19 20:31:32 +00:00
Inseob Kim
48aa22380e Consider only preferred modules for jdeps
Bug: 263327259
Test: run atest and see modules to be built
Change-Id: I208a07e2453b924f8af25db340d970ec039c5f32
2023-01-11 13:26:04 +09:00
Yike
f628202aab Export Java library dependency information
Write `static_libs` and `libs` of Java library and Android app modules to module_bp_java_deps.json. This enables downstream tools to correctly set up the runtime environment. Note that while static libraries don't need to be on the Java classpath these modules could have non-static library dependencies that do need to be present.

Test: m out/soong/module_bp_java_deps.json
Bug: 227538646
Change-Id: I7c4aecb2fb03c890f0d2aaae80e619f6176809ef
2022-04-18 10:23:28 +08:00
Jim Tang
c44ba2a6f9 Dump deps for native and java to json files.
Abandon the use of SOONG_COLLECT_CC_DEPS and SOONG_COLLECT_JAVA_DEPS,
soong can generate module_bp_cc_deps.json and module_bp_java_deps.json
without passing any variables.

BUG: 204397180

Test: rm out/soong/module_bp*json
"m nothing" should see both json files were generated.

Change-Id: If30ad5dbabb6709f834134cbc9a513a9bdc9d9de
2021-11-05 12:06:15 +08:00
Colin Cross
dcf71b299c Convert java.Dependency to JavaInfo provider
Export information about java dependencies through a Provider
instead of accessing the module directly.

Test: java_test.go
Test: no changes to build.ninja
Change-Id: Ifc5d566bf6f6ebc0ad399e948effaa1ef6a22876
2021-02-09 15:36:25 -08:00
Liz Kammer
5e07d0ccbb Add soong cc and java deps to general-tests dist
Test: m SOONG_COLLECT_CC_DEPS=true SOONG_COLLECT_JAVA_DEPS=true dist
  general-tests and verify module_bp_java_deps.json and
  module_bp_cc_deps.json is in out/dist
Test: m SOONG_COLLECT_CC_DEPS=true SOONG_COLLECT_JAVA_DEPS=true
  checkbuild dist general-tests
Bug: 154845369

Change-Id: I683fe1d7e17f7abaab40206770d09db705493ffb
2020-07-06 16:19:56 -07:00
bralee
1fbf44089e AIDEGen: Add path attribute to okhttp module.
Bug: 157115477
Test: 1. aidegen Settings -n
         open merged_module_info.json
	 "okhttp": {
	     ...
	     "path": ["external/okhttp"]
         },
	 modules: "mimemap-testing-res.jar", "mimemap-res.jar"
                  "services.core.priorityboosted", "framework-tethering"
                  "bouncycastle_ike_digests",
                  "robolectric-sqlite4java-native"
                  have the 'path' attribute.
Change-Id: If3628887866c29dcc948dd427727f175a5199edc
2020-05-21 11:25:51 +08:00
Colin Cross
988414c2cf Sandbox soong_build by changing to root directory
This relands I12a0f907753fefd1997ab8b4ea2ac331234093cf along with
a fix to blueprint for absolute paths.

Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Change-Id: I24ac485677aa102eec1a2521d16820da6ee1ae77
Fixes: 146437378
Test: m checkbuild
Test: m OUT_DIR=/tmp/out nothing
2020-01-11 01:11:46 +00:00
Colin Cross
47e4f9e1e8 Revert "Sandbox soong_build by changing to root directory"
This reverts commit 05c25ccb4a.

Reason for revert: broke absolute OUT_DIR
Bug: 146437378

Change-Id: I523ed79d40e1c1ef040212ba794a7a084abea75d
2020-01-10 18:51:04 +00:00
Colin Cross
05c25ccb4a Sandbox soong_build by changing to root directory
Store the current working directory and then change to the root
directory so that all file accesses must go through helpers in
the android package that properly track dependencies.

Fixes: 146437378
Test: m checkbuild
Change-Id: I12a0f907753fefd1997ab8b4ea2ac331234093cf
2020-01-09 14:19:46 -08:00
patricktu
18c82ffea7 AIDEGen: Collect the srcjar into out/soong/module_bp_java_deps.json
Build module_bp_java_deps.json without this change:
Build time: 3m53.761s
File size: 12,955,363 Bytes

Build module_bp_java_deps.json with this change:
Build time: 3m49.106s
File size: 13,361,647 Bytes

Bug: 132407603
Test: 1. SOONG_COLLECT_JAVA_DEPS=false make nothing
      2. SOONG_COLLECT_JAVA_DEPS=true make nothing
      3. Check module_bp_java_deps.json in /out/soong.
         In SettingsProvider section there should contain
         "srcjars": [
             "out/soong/.intermediates/frameworks/base/packages/SettingsProvider/SettingsProvider/android_common/gen/R.jar"
         ]

Change-Id: I800a4d4f13b280d7ef87005e599cbd0aaf8c93f4
2019-05-27 11:34:10 +00:00
Colin Cross
c48428a6bb Don't visit disabled modules with SOONG_COLLECT_JAVA_DEPS=true
Calling AndroidMk() on a disabled module may not be safe because
the module will not have had GenerateAndroidBuildActions() called
on it to initialize the data structures that AndroidMk() expects
to exist.  Check module.Enabled() before generating IDE info.

Fixes: 129089976
Test: SOONG_COLLECT_JAVA_DEPS=true m nothing
Change-Id: Icd79088c532c1842801f2bf89d92bc1a67109936
2019-03-23 04:42:57 +00:00
shinwang
7f1b38fa83 Modify jar dependencies collection from dexpreopt to jar with resource
Soong build system modify the jar installed path to dexpreopt, however, the jar only contains dex without java information. This patch modify the jar collection from installed path to ImplementationJars.

Bug: 121231786

Test: 1. m aidegen
      2. $ANDROID_HOST_OUT/bin/aidegen framework
      3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
	 denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

Change-Id: I8f24f3a3476e125d3fd808e0047db425e15046ac
2018-12-21 10:37:03 +00:00
Brandon Lee
5d45c6f6f8 Collect modules' info to create IDE project file.
- 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
2018-09-18 17:44:10 +00:00