blob: a583e164c2419abb25b4677ff23353ded12c2094 [file] [log] [blame]
Yigit Boyar88c16ce2017-02-08 16:06:14 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Aurimas Liutikas526389b2018-02-27 14:01:24 -080016
Jake Wharton3c3f8f42018-07-17 22:40:28 -040017import androidx.build.AndroidXPlugin
Aurimas Liutikas55b44ec72018-07-27 16:29:35 -070018import androidx.build.SdkHelperKt
Alan Viverettecc5197e2016-06-13 12:45:07 -040019
Jeff Gastond79ef852018-01-09 17:53:15 -050020def currentJvmVersion = org.gradle.api.JavaVersion.current()
21if (currentJvmVersion.getMajorVersion() != "8") {
22 throw new Exception("Unsupported java version '" + currentJvmVersion.toString() + "'. Please install java 8.\n" +
23"\n" +
24"If you have already installed java 8, you can instruct Gradle to use it by setting the environment variable JAVA_HOME equal to its file path.")
25}
26
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080027buildscript {
Yigit Boyar88c16ce2017-02-08 16:06:14 -080028 ext.supportRootFolder = project.projectDir
Aurimas Liutikas9ab3b4c32017-04-19 09:33:27 -070029 apply from: 'buildSrc/repos.gradle'
Sergey Vasilinets6aa53ca2017-11-03 12:20:28 -070030 apply from: 'buildSrc/build_dependencies.gradle'
Aurimas Liutikas9ab3b4c32017-04-19 09:33:27 -070031 repos.addMavenRepositories(repositories)
Aurimas Liutikas55b44ec72018-07-27 16:29:35 -070032 SdkHelperKt.setSdkInLocalPropertiesFile(ext.supportRootFolder)
Aurimas Liutikas75b3d2e2017-03-15 10:34:55 -070033
34 dependencies {
Sergey Vasilinets6aa53ca2017-11-03 12:20:28 -070035 classpath build_libs.gradle
Chris Craik15486292018-01-17 15:34:59 -080036 classpath build_libs.kotlin.gradle_plugin
Jeff Gastona7fd9a32018-09-26 17:04:43 -040037 classpath build_libs.dokka_gradle
Aurimas Liutikas75b3d2e2017-03-15 10:34:55 -070038 }
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080039}
Aurimas Liutikasf09d8582017-01-20 21:49:51 -080040
Aurimas Liutikas00c7dff2019-04-16 15:12:37 -070041allprojects {
42 repos.addMavenRepositories(repositories)
43}
Alan Viverettecc5197e2016-06-13 12:45:07 -040044
Aurimas Liutikas00c7dff2019-04-16 15:12:37 -070045apply from: "buildSrc/dependencies.gradle"
46apply from: "buildSrc/out.gradle"
47init.chooseOutDir()
Alan Viverettecc5197e2016-06-13 12:45:07 -040048
Jake Wharton3c3f8f42018-07-17 22:40:28 -040049apply plugin: AndroidXPlugin
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080050