diff options
author | Colin Cross <ccross@android.com> | 2017-08-14 14:16:06 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-08-28 11:12:38 -0700 |
commit | c6bbef326f1bd842f612fcb6f8548910346da791 (patch) | |
tree | 4c1a79ebbc2a61deaa52c38f1d53ad86443c2c92 /android/package_ctx.go | |
parent | 8edbb3acc9e0acc4b12abc431515d081571886f8 (diff) | |
download | build_soong-c6bbef326f1bd842f612fcb6f8548910346da791.tar.gz build_soong-c6bbef326f1bd842f612fcb6f8548910346da791.tar.bz2 build_soong-c6bbef326f1bd842f612fcb6f8548910346da791.zip |
Add error-prone support
Add support for compiling java sources with the error-prone tool.
Test: m -j checkbuild
Change-Id: Ieb4ee0e05f8f34a52ed7bcf1c7cbacf1c9c4d0b5
Diffstat (limited to 'android/package_ctx.go')
-rw-r--r-- | android/package_ctx.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/android/package_ctx.go b/android/package_ctx.go index 2bc98aaf..6743fb3f 100644 --- a/android/package_ctx.go +++ b/android/package_ctx.go @@ -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. |