summaryrefslogtreecommitdiff
path: root/java/lint.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2022-03-24 16:38:20 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2022-03-24 16:38:20 +0000
commitad40fffa644ada1c0113b9de18bdaa2bb1e1490f (patch)
treeb4def10988ce8df06bf8b6acc804eaef203fb027 /java/lint.go
parentb47e89f2d1a05409e7fdd7a598e76fbfef3d743d (diff)
parentd9c23abeca23bfe13c65fd4d341a4d6b2b59d5be (diff)
Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217
* changes: Do not propagate strict updatability linting to libcore/ Create allowlist to skip strict updatability lint check Propagate strict_updatability_linting to transitive deps of updatable apexes Export LintDepSetsIntf from java package
Diffstat (limited to 'java/lint.go')
-rw-r--r--java/lint.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/java/lint.go b/java/lint.go
index 7845c336b..e97c9c225 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -102,12 +102,12 @@ type lintOutputsIntf interface {
lintOutputs() *lintOutputs
}
-type lintDepSetsIntf interface {
+type LintDepSetsIntf interface {
LintDepSets() LintDepSets
// Methods used to propagate strict_updatability_linting values.
- getStrictUpdatabilityLinting() bool
- setStrictUpdatabilityLinting(bool)
+ GetStrictUpdatabilityLinting() bool
+ SetStrictUpdatabilityLinting(bool)
}
type LintDepSets struct {
@@ -158,15 +158,15 @@ func (l *linter) LintDepSets() LintDepSets {
return l.outputs.depSets
}
-func (l *linter) getStrictUpdatabilityLinting() bool {
+func (l *linter) GetStrictUpdatabilityLinting() bool {
return BoolDefault(l.properties.Lint.Strict_updatability_linting, false)
}
-func (l *linter) setStrictUpdatabilityLinting(strictLinting bool) {
+func (l *linter) SetStrictUpdatabilityLinting(strictLinting bool) {
l.properties.Lint.Strict_updatability_linting = &strictLinting
}
-var _ lintDepSetsIntf = (*linter)(nil)
+var _ LintDepSetsIntf = (*linter)(nil)
var _ lintOutputsIntf = (*linter)(nil)
@@ -273,7 +273,7 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, rule *android.Ru
cmd.FlagForEachArg("--error_check ", l.properties.Lint.Error_checks)
cmd.FlagForEachArg("--fatal_check ", l.properties.Lint.Fatal_checks)
- if l.getStrictUpdatabilityLinting() {
+ if l.GetStrictUpdatabilityLinting() {
// Verify the module does not baseline issues that endanger safe updatability.
if baselinePath := l.getBaselineFilepath(ctx); baselinePath.Valid() {
cmd.FlagWithInput("--baseline ", baselinePath.Path())
@@ -382,7 +382,7 @@ func (l *linter) lint(ctx android.ModuleContext) {
depSetsBuilder := NewLintDepSetBuilder().Direct(html, text, xml)
ctx.VisitDirectDepsWithTag(staticLibTag, func(dep android.Module) {
- if depLint, ok := dep.(lintDepSetsIntf); ok {
+ if depLint, ok := dep.(LintDepSetsIntf); ok {
depSetsBuilder.Transitive(depLint.LintDepSets())
}
})
@@ -660,10 +660,10 @@ func lintZip(ctx android.BuilderContext, paths android.Paths, outputPath android
// Enforce the strict updatability linting to all applicable transitive dependencies.
func enforceStrictUpdatabilityLintingMutator(ctx android.TopDownMutatorContext) {
m := ctx.Module()
- if d, ok := m.(lintDepSetsIntf); ok && d.getStrictUpdatabilityLinting() {
+ if d, ok := m.(LintDepSetsIntf); ok && d.GetStrictUpdatabilityLinting() {
ctx.VisitDirectDepsWithTag(staticLibTag, func(d android.Module) {
- if a, ok := d.(lintDepSetsIntf); ok {
- a.setStrictUpdatabilityLinting(true)
+ if a, ok := d.(LintDepSetsIntf); ok {
+ a.SetStrictUpdatabilityLinting(true)
}
})
}