Colin Cross | 3e3e72d | 2017-06-22 17:20:19 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | package config |
| 16 | |
| 17 | import ( |
| 18 | "strings" |
| 19 | |
| 20 | "android/soong/android" |
| 21 | ) |
| 22 | |
| 23 | func init() { |
| 24 | android.RegisterMakeVarsProvider(pctx, makeVarsProvider) |
| 25 | } |
| 26 | |
| 27 | func makeVarsProvider(ctx android.MakeVarsContext) { |
| 28 | ctx.Strict("TARGET_DEFAULT_JAVA_LIBRARIES", strings.Join(DefaultLibraries, " ")) |
Colin Cross | 6416271 | 2017-08-08 13:17:59 -0700 | [diff] [blame] | 29 | |
| 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 Cross | ded8a97 | 2017-08-15 14:27:52 -0700 | [diff] [blame] | 37 | ctx.Strict("JAR_ARGS", "${JarArgsCmd}") |
Colin Cross | 6416271 | 2017-08-08 13:17:59 -0700 | [diff] [blame] | 38 | ctx.Strict("JAVADOC", "${JavadocCmd}") |
| 39 | ctx.Strict("COMMON_JDK_FLAGS", "${CommonJdkFlags}") |
Colin Cross | 2aad9c2 | 2017-08-14 14:17:37 -0700 | [diff] [blame^] | 40 | |
| 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 Cross | 3e3e72d | 2017-06-22 17:20:19 -0700 | [diff] [blame] | 48 | } |