blob: 394c42c5911527f91c14cd138dafe4ac1717d402 [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 Liutikas526389b2018-02-27 14:01:24 -080018import androidx.build.DacOptions
Sergey Vasilinetsc74c7fb52018-05-29 14:50:22 -070019import androidx.build.PublishDocsRulesKt
Jake Wharton0af47772018-07-25 16:44:39 -040020import androidx.build.jacoco.Jacoco
Alan Viverettecc5197e2016-06-13 12:45:07 -040021
Jeff Gastond79ef852018-01-09 17:53:15 -050022def currentJvmVersion = org.gradle.api.JavaVersion.current()
23if (currentJvmVersion.getMajorVersion() != "8") {
24throw new Exception("Unsupported java version '" + currentJvmVersion.toString() + "'. Please install java 8.\n" +
25"\n" +
26"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.")
27}
28
29
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080030buildscript {
Yigit Boyar88c16ce2017-02-08 16:06:14 -080031ext.supportRootFolder = project.projectDir
Aurimas Liutikas9ab3b4c32017-04-19 09:33:27 -070032apply from: 'buildSrc/repos.gradle'
Yigit Boyar88c16ce2017-02-08 16:06:14 -080033apply from: 'buildSrc/init.gradle'
Sergey Vasilinets6aa53ca2017-11-03 12:20:28 -070034apply from: 'buildSrc/build_dependencies.gradle'
Yigit Boyar95c6a872017-03-03 10:54:49 -080035init.setSdkInLocalPropertiesFile()
Aurimas Liutikas9ab3b4c32017-04-19 09:33:27 -070036repos.addMavenRepositories(repositories)
Aurimas Liutikas75b3d2e2017-03-15 10:34:55 -070037
38dependencies {
Sergey Vasilinets6aa53ca2017-11-03 12:20:28 -070039classpath build_libs.gradle
Chris Craik15486292018-01-17 15:34:59 -080040classpath build_libs.kotlin.gradle_plugin
Jake Wharton0af47772018-07-25 16:44:39 -040041
42// AGP only declares a compileOnly dependency on Jacoco. This forces an explicit version.
43classpath Jacoco.CORE_DEPENDENCY
Aurimas Liutikas75b3d2e2017-03-15 10:34:55 -070044}
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080045}
Aurimas Liutikasf09d8582017-01-20 21:49:51 -080046
Aurimas Liutikas9ab3b4c32017-04-19 09:33:27 -070047repos.addMavenRepositories(repositories)
Alan Viverettecc5197e2016-06-13 12:45:07 -040048
Yigit Boyar88c16ce2017-02-08 16:06:14 -080049init.setupRepoOutAndBuildNumber()
Alan Viverettecc5197e2016-06-13 12:45:07 -040050
Yigit Boyar88c16ce2017-02-08 16:06:14 -080051init.configureSubProjects()
Alan Viverettecc5197e2016-06-13 12:45:07 -040052
Jake Wharton3f008832018-07-19 17:30:31 -040053init.configureBuildOnServer()
Aurimas Liutikas38e8f4d92017-06-16 08:31:03 -070054
Jake Wharton3c3f8f42018-07-17 22:40:28 -040055apply plugin: AndroidXPlugin
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080056
Jake Wharton3c3f8f42018-07-17 22:40:28 -040057// AndroidX needed before jetify since it accesses the createArchive task name directly.
Jeff Gaston5d480f82018-01-29 11:41:32 -050058apply from: 'buildSrc/jetify.gradle'
59