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 | cb2c929 | 2017-09-23 19:57:16 -0700 | [diff] [blame] | 29 | ctx.Strict("TARGET_DEFAULT_BOOTCLASSPATH_LIBRARIES", strings.Join(DefaultBootclasspathLibraries, " ")) |
Colin Cross | 1369cdb | 2017-09-29 17:58:17 -0700 | [diff] [blame] | 30 | ctx.Strict("DEFAULT_SYSTEM_MODULES", DefaultSystemModules) |
Colin Cross | 6416271 | 2017-08-08 13:17:59 -0700 | [diff] [blame] | 31 | |
Colin Cross | 1369cdb | 2017-09-29 17:58:17 -0700 | [diff] [blame] | 32 | if ctx.Config().TargetOpenJDK9() { |
| 33 | ctx.Strict("DEFAULT_JAVA_LANGUAGE_VERSION", "1.9") |
| 34 | } else { |
| 35 | ctx.Strict("DEFAULT_JAVA_LANGUAGE_VERSION", "1.8") |
| 36 | } |
Colin Cross | 6416271 | 2017-08-08 13:17:59 -0700 | [diff] [blame] | 37 | |
| 38 | ctx.Strict("ANDROID_JAVA_HOME", "${JavaHome}") |
Tobias Thierer | 06ae582 | 2017-12-08 18:03:43 +0000 | [diff] [blame] | 39 | ctx.Strict("ANDROID_JAVA8_HOME", "prebuilts/jdk/jdk8/${hostPrebuiltTag}") |
| 40 | ctx.Strict("ANDROID_JAVA9_HOME", "prebuilts/jdk/jdk9/${hostPrebuiltTag}") |
Pete Gillin | 1f52e93 | 2019-10-09 17:10:08 +0100 | [diff] [blame] | 41 | ctx.Strict("ANDROID_JAVA11_HOME", "prebuilts/jdk/jdk11/${hostPrebuiltTag}") |
Colin Cross | 6416271 | 2017-08-08 13:17:59 -0700 | [diff] [blame] | 42 | ctx.Strict("ANDROID_JAVA_TOOLCHAIN", "${JavaToolchain}") |
Sasha Smundak | 26c6d9e | 2019-06-11 13:30:13 -0700 | [diff] [blame] | 43 | ctx.Strict("JAVA", "${JavaCmd} ${JavaVmFlags}") |
| 44 | ctx.Strict("JAVAC", "${JavacCmd} ${JavacVmFlags}") |
Colin Cross | 6416271 | 2017-08-08 13:17:59 -0700 | [diff] [blame] | 45 | ctx.Strict("JAR", "${JarCmd}") |
Colin Cross | ded8a97 | 2017-08-15 14:27:52 -0700 | [diff] [blame] | 46 | ctx.Strict("JAR_ARGS", "${JarArgsCmd}") |
Colin Cross | 6416271 | 2017-08-08 13:17:59 -0700 | [diff] [blame] | 47 | ctx.Strict("JAVADOC", "${JavadocCmd}") |
| 48 | ctx.Strict("COMMON_JDK_FLAGS", "${CommonJdkFlags}") |
Alan Leung | 9f31911 | 2017-11-30 15:50:39 -0800 | [diff] [blame] | 49 | |
Colin Cross | bafb897 | 2018-06-06 21:46:32 +0000 | [diff] [blame] | 50 | ctx.Strict("DX", "${D8Cmd}") |
| 51 | ctx.Strict("DX_COMMAND", "${D8Cmd} -JXms16M -JXmx2048M") |
Colin Cross | 66dbc0b | 2017-12-28 12:23:20 -0800 | [diff] [blame] | 52 | ctx.Strict("R8_COMPAT_PROGUARD", "${R8Cmd}") |
Alan Leung | 9f31911 | 2017-11-30 15:50:39 -0800 | [diff] [blame] | 53 | |
Nan Zhang | ed19fc3 | 2017-10-19 13:06:22 -0700 | [diff] [blame] | 54 | ctx.Strict("TURBINE", "${TurbineJar}") |
Colin Cross | 2aad9c2 | 2017-08-14 14:17:37 -0700 | [diff] [blame] | 55 | |
Colin Cross | 6654810 | 2018-06-19 22:47:35 -0700 | [diff] [blame] | 56 | if ctx.Config().RunErrorProne() { |
| 57 | ctx.Strict("ERROR_PRONE_JARS", strings.Join(ErrorProneClasspath, " ")) |
| 58 | ctx.Strict("ERROR_PRONE_FLAGS", "${ErrorProneFlags}") |
| 59 | ctx.Strict("ERROR_PRONE_CHECKS", "${ErrorProneChecks}") |
Colin Cross | 2aad9c2 | 2017-08-14 14:17:37 -0700 | [diff] [blame] | 60 | } |
Tobias Thierer | 77d0b41 | 2017-08-31 16:08:39 +0100 | [diff] [blame] | 61 | |
Sasha Smundak | 26c6d9e | 2019-06-11 13:30:13 -0700 | [diff] [blame] | 62 | ctx.Strict("TARGET_JAVAC", "${JavacCmd} ${JavacVmFlags} ${CommonJdkFlags}") |
| 63 | ctx.Strict("HOST_JAVAC", "${JavacCmd} ${JavacVmFlags} ${CommonJdkFlags}") |
Colin Cross | 6654810 | 2018-06-19 22:47:35 -0700 | [diff] [blame] | 64 | |
Colin Cross | 997262f | 2018-06-19 22:49:39 -0700 | [diff] [blame] | 65 | ctx.Strict("JLINK", "${JlinkCmd}") |
| 66 | ctx.Strict("JMOD", "${JmodCmd}") |
Colin Cross | a482065 | 2017-10-17 13:56:52 -0700 | [diff] [blame] | 67 | |
| 68 | ctx.Strict("SOONG_JAVAC_WRAPPER", "${SoongJavacWrapper}") |
Colin Cross | 43f08db | 2018-11-12 10:13:39 -0800 | [diff] [blame] | 69 | ctx.Strict("DEXPREOPT_GEN", "${DexpreoptGen}") |
Colin Cross | 436b765 | 2018-03-15 16:24:10 -0700 | [diff] [blame] | 70 | ctx.Strict("ZIPSYNC", "${ZipSyncCmd}") |
Colin Cross | cb93359 | 2017-11-22 13:49:43 -0800 | [diff] [blame] | 71 | |
| 72 | ctx.Strict("JACOCO_CLI_JAR", "${JacocoCLIJar}") |
| 73 | ctx.Strict("DEFAULT_JACOCO_EXCLUDE_FILTER", strings.Join(DefaultJacocoExcludeFilter, ",")) |
Colin Cross | 66f7882 | 2018-05-02 12:58:28 -0700 | [diff] [blame] | 74 | |
| 75 | ctx.Strict("EXTRACT_JAR_PACKAGES", "${ExtractJarPackagesCmd}") |
Colin Cross | 8bb10e8 | 2018-06-07 16:46:02 -0700 | [diff] [blame] | 76 | |
Colin Cross | 7211910 | 2019-05-20 13:14:18 -0700 | [diff] [blame] | 77 | ctx.Strict("MANIFEST_CHECK", "${ManifestCheckCmd}") |
Colin Cross | 8bb10e8 | 2018-06-07 16:46:02 -0700 | [diff] [blame] | 78 | ctx.Strict("MANIFEST_FIXER", "${ManifestFixerCmd}") |
Colin Cross | 3165695 | 2018-05-24 16:11:20 -0700 | [diff] [blame] | 79 | |
Colin Cross | 87ecbfe | 2019-02-26 22:14:04 -0800 | [diff] [blame] | 80 | ctx.Strict("ANDROID_MANIFEST_MERGER", "${ManifestMergerCmd}") |
Colin Cross | 8faf8fc | 2019-01-16 15:15:52 -0800 | [diff] [blame] | 81 | |
| 82 | ctx.Strict("CLASS2GREYLIST", "${Class2Greylist}") |
| 83 | ctx.Strict("HIDDENAPI", "${HiddenAPI}") |
Colin Cross | 6db4d4e | 2019-02-21 14:58:58 -0800 | [diff] [blame] | 84 | |
| 85 | ctx.Strict("DEX_FLAGS", "${DexFlags}") |
Colin Cross | bdf9514 | 2019-08-08 12:56:34 -0700 | [diff] [blame] | 86 | |
| 87 | ctx.Strict("AIDL", "${AidlCmd}") |
| 88 | ctx.Strict("AAPT2", "${Aapt2Cmd}") |
| 89 | ctx.Strict("ZIPALIGN", "${ZipAlign}") |
| 90 | ctx.Strict("SIGNAPK_JAR", "${SignapkCmd}") |
| 91 | ctx.Strict("SIGNAPK_JNI_LIBRARY_PATH", "${SignapkJniLibrary}") |
| 92 | |
| 93 | ctx.Strict("SOONG_ZIP", "${SoongZipCmd}") |
| 94 | ctx.Strict("MERGE_ZIPS", "${MergeZipsCmd}") |
| 95 | ctx.Strict("ZIP2ZIP", "${Zip2ZipCmd}") |
| 96 | |
| 97 | ctx.Strict("ZIPTIME", "${Ziptime}") |
| 98 | |
Colin Cross | 3e3e72d | 2017-06-22 17:20:19 -0700 | [diff] [blame] | 99 | } |