diff options
author | Colin Cross <ccross@android.com> | 2017-08-08 13:17:59 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-08-11 15:24:11 -0700 |
commit | 6416271a1f6ec76e5dfac4573eec78bbd4f3ba3b (patch) | |
tree | 817090b78efd6d66fcdcb2a137399e080886a894 /android | |
parent | 74d73e2bfb016bd137a4fb7e125576b5f9a6cda4 (diff) | |
download | build_soong-6416271a1f6ec76e5dfac4573eec78bbd4f3ba3b.tar.gz build_soong-6416271a1f6ec76e5dfac4573eec78bbd4f3ba3b.tar.bz2 build_soong-6416271a1f6ec76e5dfac4573eec78bbd4f3ba3b.zip |
Bring java support closer to current version of make
Make the javac arguments match what is used by make, and export them
back to make. A future change will switch make to use the the
exported ones.
This makes a dx.jar compiled with soong have identical class files
as one compiled with make.
Test: manual
Change-Id: Ia5196f1f42bc564e99de22e32e72fd2930e9fbae
Diffstat (limited to 'android')
-rw-r--r-- | android/package_ctx.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/android/package_ctx.go b/android/package_ctx.go index 53044039..2bc98aaf 100644 --- a/android/package_ctx.go +++ b/android/package_ctx.go @@ -75,6 +75,22 @@ func (p AndroidPackageContext) SourcePathVariable(name, path string) blueprint.V }) } +// 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. +// 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) SourcePathVariableWithEnvOverride(name, path, env string) blueprint.Variable { + return p.VariableFunc(name, func(config interface{}) (string, error) { + ctx := &configErrorWrapper{p, config.(Config), []error{}} + p := safePathForSource(ctx, path) + if len(ctx.errors) > 0 { + return "", ctx.errors[0] + } + return config.(Config).GetenvWithDefault(env, p.String()), nil + }) +} + // HostBinVariable returns a Variable whose value is the path to a host tool // in the bin directory for host targets. It may only be called during a Go // package's initialization - either from the init() function or as part of a |