Add error-prone support

Add support for compiling java sources with the error-prone tool.

Test: m -j checkbuild
Change-Id: Ieb4ee0e05f8f34a52ed7bcf1c7cbacf1c9c4d0b5
This commit is contained in:
Colin Cross
2017-08-14 14:16:06 -07:00
parent 8edbb3acc9
commit c6bbef326f
5 changed files with 183 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ package android
import (
"fmt"
"strings"
"github.com/google/blueprint"
"github.com/google/blueprint/pathtools"
@@ -75,6 +76,25 @@ func (p AndroidPackageContext) SourcePathVariable(name, path string) blueprint.V
})
}
// SourcePathsVariable returns a Variable whose value is the source directory
// appended with the supplied paths, joined with separator. It may only be
// called during a Go package's initialization - either from the init()
// function or as part of a package-scoped variable's initialization.
func (p AndroidPackageContext) SourcePathsVariable(name, separator string, paths ...string) blueprint.Variable {
return p.VariableFunc(name, func(config interface{}) (string, error) {
ctx := &configErrorWrapper{p, config.(Config), []error{}}
var ret []string
for _, path := range paths {
p := safePathForSource(ctx, path)
if len(ctx.errors) > 0 {
return "", ctx.errors[0]
}
ret = append(ret, p.String())
}
return strings.Join(ret, separator), nil
})
}
// SourcePathVariableWithEnvOverride returns a Variable whose value is the source directory
// appended with the supplied path, or the value of the given environment variable if it is set.
// The environment variable is not required to point to a path inside the source tree.