summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2025-02-11 17:02:53 -0800
committer Cole Faust <colefaust@google.com> 2025-02-12 12:32:01 -0800
commita43fb2565c538de1768e8260168c8fd14df3a447 (patch)
treec05a7f0bfb34112bed1d75c5a7c6607b02b15420 /java
parentdc170e72fad31a5cef8e3427773d7f9d323c03f9 (diff)
Move dists to GenerateAndroidBuildActions
So that we're not as make-focused by disting in MakeVarsProviders. Bug: 395184523 Test: Verified ninja files were unchanged (on both m nothing and m nothing dist) Change-Id: I5fd94754d644162b355722fbb1e1fd6f085345b9
Diffstat (limited to 'java')
-rw-r--r--java/droidstubs.go22
-rw-r--r--java/java.go7
-rw-r--r--java/jdeps.go9
-rw-r--r--java/lint.go4
-rw-r--r--java/platform_compat_config.go7
5 files changed, 11 insertions, 38 deletions
diff --git a/java/droidstubs.go b/java/droidstubs.go
index c8f798a9b..caad6883e 100644
--- a/java/droidstubs.go
+++ b/java/droidstubs.go
@@ -1429,6 +1429,16 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {
d.setOutputFiles(ctx)
d.setPhonyRules(ctx)
+
+ if d.apiLintTimestamp != nil {
+ if d.apiLintReport != nil {
+ ctx.DistForGoalsWithFilename(
+ []string{fmt.Sprintf("%s-api-lint", d.Name()), "droidcore"},
+ d.apiLintReport,
+ fmt.Sprintf("apilint/%s-lint-report.txt", d.Name()),
+ )
+ }
+ }
}
func setDroidInfo(ctx android.ModuleContext, d *Droidstubs, info *StubsInfo, typ StubsType) {
@@ -1524,18 +1534,6 @@ var (
}
)
-func (d *Droidstubs) MakeVars(ctx android.MakeVarsModuleContext) {
- if d.apiLintTimestamp != nil {
- if d.apiLintReport != nil {
- ctx.DistForGoalsWithFilename(
- []string{fmt.Sprintf("%s-api-lint", d.Name()), "droidcore"},
- d.apiLintReport,
- fmt.Sprintf("apilint/%s-lint-report.txt", d.Name()),
- )
- }
- }
-}
-
func StubsDefaultsFactory() android.Module {
module := &DocDefaults{}
diff --git a/java/java.go b/java/java.go
index 91b7cf24b..383fc3ff8 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1282,13 +1282,6 @@ func (j *Library) createApiXmlFile(ctx android.ModuleContext) {
Input: j.implementationAndResourcesJar,
Output: j.apiXmlFile,
})
- }
-}
-
-var _ android.ModuleMakeVarsProvider = (*Library)(nil)
-
-func (j *Library) MakeVars(ctx android.MakeVarsModuleContext) {
- if j.apiXmlFile != nil {
ctx.DistForGoal("dist_files", j.apiXmlFile)
}
}
diff --git a/java/jdeps.go b/java/jdeps.go
index c2ce50383..927c1694d 100644
--- a/java/jdeps.go
+++ b/java/jdeps.go
@@ -37,8 +37,6 @@ type jdepsGeneratorSingleton struct {
outputPath android.Path
}
-var _ android.SingletonMakeVarsProvider = (*jdepsGeneratorSingleton)(nil)
-
const (
jdepsJsonFileName = "module_bp_java_deps.json"
)
@@ -101,13 +99,6 @@ func (j *jdepsGeneratorSingleton) GenerateBuildActions(ctx android.SingletonCont
Rule: android.Touch,
Output: jfpath,
})
-}
-
-func (j *jdepsGeneratorSingleton) MakeVars(ctx android.MakeVarsContext) {
- if j.outputPath == nil {
- return
- }
-
ctx.DistForGoal("general-tests", j.outputPath)
}
diff --git a/java/lint.go b/java/lint.go
index 3838745e4..66f7f8549 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -704,16 +704,12 @@ func (l *lintSingleton) generateLintReportZips(ctx android.SingletonContext) {
zip(l.referenceBaselineZip, func(l *LintInfo) android.Path { return l.ReferenceBaseline })
ctx.Phony("lint-check", l.htmlZip, l.textZip, l.xmlZip, l.referenceBaselineZip)
-}
-func (l *lintSingleton) MakeVars(ctx android.MakeVarsContext) {
if !ctx.Config().UnbundledBuild() {
ctx.DistForGoal("lint-check", l.htmlZip, l.textZip, l.xmlZip, l.referenceBaselineZip)
}
}
-var _ android.SingletonMakeVarsProvider = (*lintSingleton)(nil)
-
func init() {
android.RegisterParallelSingletonType("lint",
func() android.Singleton { return &lintSingleton{} })
diff --git a/java/platform_compat_config.go b/java/platform_compat_config.go
index bb9894400..d4d2fb5bb 100644
--- a/java/platform_compat_config.go
+++ b/java/platform_compat_config.go
@@ -278,12 +278,7 @@ func (p *platformCompatConfigSingleton) GenerateBuildActions(ctx android.Singlet
rule.Build("merged-compat-config", "Merge compat config")
p.metadata = outputPath
-}
-
-func (p *platformCompatConfigSingleton) MakeVars(ctx android.MakeVarsContext) {
- if p.metadata != nil {
- ctx.DistForGoal("droidcore", p.metadata)
- }
+ ctx.DistForGoal("droidcore", p.metadata)
}
func platformCompatConfigSingletonFactory() android.Singleton {