Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6adc4fd authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add srcs of jarjar'd java libs back to module_bp_java_deps.json" into main

parents cf13b7c2 096b8d6b
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -2172,16 +2172,14 @@ func (j *Module) ClassLoaderContexts() dexpreopt.ClassLoaderContextMap {

// Collect information for opening IDE project files in java/jdeps.go.
func (j *Module) IDEInfo(ctx android.BaseModuleContext, dpInfo *android.IdeInfo) {
	// jarjar rules will repackage the sources. To prevent misleading results, IdeInfo should contain the
	// repackaged jar instead of the input sources.
	if j.expandJarjarRules != nil {
		dpInfo.Jarjar_rules = append(dpInfo.Jarjar_rules, j.expandJarjarRules.String())
		// Add the header jar so that the rdeps can be resolved to the repackaged classes.
		dpInfo.Jars = append(dpInfo.Jars, j.headerJarFile.String())
	} else {
	}
	dpInfo.Srcs = append(dpInfo.Srcs, j.expandIDEInfoCompiledSrcs...)
	dpInfo.SrcJars = append(dpInfo.SrcJars, j.compiledSrcJars.Strings()...)
	dpInfo.SrcJars = append(dpInfo.SrcJars, j.annoSrcJars.Strings()...)
	}
	dpInfo.Deps = append(dpInfo.Deps, j.CompilerDeps()...)
	dpInfo.Aidl_include_dirs = append(dpInfo.Aidl_include_dirs, j.deviceProperties.Aidl.Include_dirs...)
	dpInfo.Static_libs = append(dpInfo.Static_libs, j.staticLibs(ctx)...)
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ func TestCollectJavaLibraryWithJarJarRules(t *testing.T) {
	module := ctx.ModuleForTests("javalib", "android_common").Module().(*Library)
	dpInfo, _ := android.OtherModuleProvider(ctx, module, android.IdeInfoProviderKey)

	android.AssertBoolEquals(t, "IdeInfo.Srcs of repackaged library should be empty", true, len(dpInfo.Srcs) == 0)
	android.AssertStringEquals(t, "IdeInfo.Srcs of repackaged library should not be empty", "foo.java", dpInfo.Srcs[0])
	android.AssertStringEquals(t, "IdeInfo.Jar_rules of repackaged library should not be empty", "jarjar_rules.txt", dpInfo.Jarjar_rules[0])
	if !android.SubstringInList(dpInfo.Jars, "soong/.intermediates/javalib/android_common/jarjar/turbine/javalib.jar") {
		t.Errorf("IdeInfo.Jars of repackaged library should contain the output of jarjar-ing. All outputs: %v\n", dpInfo.Jars)