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

Commit 7af39672 authored by Dan Willemsen's avatar Dan Willemsen Committed by android-build-merger
Browse files

Expose all deps on genrules am: ddf504ca

am: 4ccc49a2

Change-Id: I4cbbfb0604365b42f08f23abd0c6334e7c652dc6
parents 13758af5 4ccc49a2
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ var (
)

func init() {
	pctx.Import("android/soong/android")
	pctx.HostBinToolVariable("sboxCmd", "sbox")
}

@@ -425,7 +426,24 @@ func (g *Module) generateSourceFile(ctx android.ModuleContext, task generateTask
	for _, outputFile := range task.out {
		g.outputFiles = append(g.outputFiles, outputFile)
	}
	g.outputDeps = append(g.outputDeps, task.out[0])

	// For <= 6 outputs, just embed those directly in the users. Right now, that covers >90% of
	// the genrules on AOSP. That will make things simpler to look at the graph in the common
	// case. For larger sets of outputs, inject a phony target in between to limit ninja file
	// growth.
	if len(task.out) <= 6 {
		g.outputDeps = g.outputFiles
	} else {
		phonyFile := android.PathForModuleGen(ctx, "genrule-phony")

		ctx.Build(pctx, android.BuildParams{
			Rule:   android.Phony,
			Output: phonyFile,
			Inputs: g.outputFiles,
		})

		g.outputDeps = android.Paths{phonyFile}
	}
}

// Collect information for opening IDE project files in java/jdeps.go.