Home | History | Annotate | Download | only in support
      1 /*
      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  */
     16 
     17 import androidx.build.DacOptions
     18 import androidx.build.PublishDocsRulesKt
     19 
     20 def currentJvmVersion = org.gradle.api.JavaVersion.current()
     21 if (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 
     27 
     28 buildscript {
     29     ext.supportRootFolder = project.projectDir
     30     apply from: 'buildSrc/repos.gradle'
     31     apply from: 'buildSrc/init.gradle'
     32     apply from: 'buildSrc/build_dependencies.gradle'
     33     init.setSdkInLocalPropertiesFile()
     34     repos.addMavenRepositories(repositories)
     35 
     36     dependencies {
     37         classpath build_libs.gradle
     38         classpath build_libs.jacoco
     39         classpath build_libs.kotlin.gradle_plugin
     40     }
     41 }
     42 
     43 repos.addMavenRepositories(repositories)
     44 
     45 init.setupRepoOutAndBuildNumber()
     46 
     47 init.configureSubProjects()
     48 
     49 def buildTask = init.configureBuildOnServer()
     50 
     51 init.setupRelease()
     52 
     53 apply from: 'buildSrc/jetify.gradle'
     54 
     55 def allDocs = init.enableDoclavaAndJDiff(this, new DacOptions("androidx", "ANDROIDX_DATA"),
     56         [PublishDocsRulesKt.RELEASE_RULE])
     57 
     58 buildTask.dependsOn(allDocs)
     59 
     60 ///// FLATFOOT START
     61 
     62 ///// FLATFOOT END
     63