blob: 29ef57d44db0706a6deac95a2d487fec343e6f3b [file] [log] [blame]
Colin Cross3e3e72d2017-06-22 17:20:19 -07001// Copyright 2017 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package config
16
17import (
18 "strings"
19
20 "android/soong/android"
21)
22
23func init() {
24 android.RegisterMakeVarsProvider(pctx, makeVarsProvider)
25}
26
27func makeVarsProvider(ctx android.MakeVarsContext) {
28 ctx.Strict("TARGET_DEFAULT_JAVA_LIBRARIES", strings.Join(DefaultLibraries, " "))
Colin Cross64162712017-08-08 13:17:59 -070029
30 ctx.Strict("DEFAULT_JAVA_LANGUAGE_VERSION", "${DefaultJavaVersion}")
31
32 ctx.Strict("ANDROID_JAVA_HOME", "${JavaHome}")
33 ctx.Strict("ANDROID_JAVA_TOOLCHAIN", "${JavaToolchain}")
34 ctx.Strict("JAVA", "${JavaCmd}")
35 ctx.Strict("JAVAC", "${JavacCmd}")
36 ctx.Strict("JAR", "${JarCmd}")
Colin Crossded8a972017-08-15 14:27:52 -070037 ctx.Strict("JAR_ARGS", "${JarArgsCmd}")
Colin Cross64162712017-08-08 13:17:59 -070038 ctx.Strict("JAVADOC", "${JavadocCmd}")
39 ctx.Strict("COMMON_JDK_FLAGS", "${CommonJdkFlags}")
Colin Cross2aad9c22017-08-14 14:17:37 -070040
41 if ctx.Config().IsEnvTrue("RUN_ERROR_PRONE") {
42 ctx.Strict("TARGET_JAVAC", "${ErrorProneCmd}")
43 ctx.Strict("HOST_JAVAC", "${ErrorProneCmd}")
44 } else {
45 ctx.Strict("TARGET_JAVAC", "${JavacCmd} ${CommonJdkFlags}")
46 ctx.Strict("HOST_JAVAC", "${JavacCmd} ${CommonJdkFlags}")
47 }
Colin Cross3e3e72d2017-06-22 17:20:19 -070048}