blob: 657db328a34a548f759faa8b56b2b35b4f65c8c9 [file] [log] [blame]
Sergey Vasilinets70a2e822017-11-03 12:20:28 -07001/*
2 * Copyright 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
Louis Pullen-Freilich1dff6782019-10-17 18:12:39 +010017def isUiProject = System.getenv("DIST_SUBDIR") == "/ui"
18
Jake Wharton7495cc12018-01-05 11:05:13 -050019def build_versions = [:]
20
Louis Pullen-Freilich08e53df2019-10-24 20:00:35 +010021// NOTE: lint versions *must* be kept in sync with agp
Louis Pullen-Freilich1dff6782019-10-17 18:12:39 +010022if (isUiProject) {
Jim Sproch7fe92eb2020-08-13 13:52:40 -070023 build_versions.kotlin = "1.4.0"
Andrey Kulikov9b3a88a2020-05-11 13:34:24 +010024 build_versions.kotlin_coroutines = "1.3.6"
Aurimas Liutikas6a800af2020-07-28 17:27:43 -070025 build_versions.agp = '4.2.0-alpha06'
26 build_versions.lint = '27.2.0-alpha06'
Aurimas Liutikasaa460b02019-04-25 16:03:21 -070027} else {
Dustin Lam40b5ddc2020-03-25 12:19:01 -070028 build_versions.kotlin = "1.3.71"
Zac Sweers83b0d9c2020-07-03 00:22:37 -040029 build_versions.kotlin_coroutines = "1.3.7"
Aurimas Liutikas6a800af2020-07-28 17:27:43 -070030 build_versions.agp = '4.2.0-alpha06'
Rahul Ravikumarce3f4fb2020-06-11 12:34:26 -070031 // NOTE: When updating the lint version we also need to update the `api` version supported
32 // by `IssueRegistry`'s.' For e.g. aosp/1331903
Aurimas Liutikas6a800af2020-07-28 17:27:43 -070033 build_versions.lint = '27.2.0-alpha06'
Aurimas Liutikasaa460b02019-04-25 16:03:21 -070034}
Louis Pullen-Freilich1dff6782019-10-17 18:12:39 +010035
Aurimas Liutikas5941b522020-03-04 15:21:52 -080036def agpOverride = System.getenv("GRADLE_PLUGIN_VERSION")
37if (agpOverride != null) {
38 logger.warn("Using custom version ${agpOverride} of AGP due to GRADLE_PLUGIN_VERSION being set.")
39 build_versions.agp = agpOverride
Aurimas Liutikas48541242020-03-04 12:56:08 -080040}
41
Jeff Gastonfb6f8442020-05-26 17:53:58 -040042// gets the version of Dokka defined in source
43def getSourceDokkaVersion() {
44 def dokkaProps = new Properties()
45 FileInputStream f = new FileInputStream(project.file("${project.ext.supportRootFolder}/../../external/dokka/gradle.properties"))
46 dokkaProps.load(f)
47 f.close()
48
49 return dokkaProps["dokka_version"]
50}
51
52if (System.getenv("BUILD_DOKKA") != null) {
53 build_versions.dokka = getSourceDokkaVersion()
54} else {
Andrea Falconed821b262020-06-25 16:20:00 -040055 build_versions.dokka = '0.9.17-g013'
Jeff Gastonfb6f8442020-05-26 17:53:58 -040056}
Jeff Gaston149350d2019-03-08 20:32:29 -050057
Jake Wharton7495cc12018-01-05 11:05:13 -050058rootProject.ext['build_versions'] = build_versions
59
Sergey Vasilinets70a2e822017-11-03 12:20:28 -070060def build_libs = [:]
61
Louis Pullen-Freilich1dff6782019-10-17 18:12:39 +010062build_libs.agp = "com.android.tools.build:gradle:${build_versions.agp}"
Jeff Gastondb2929e2018-03-07 13:52:32 -050063
Oussama Ben Abdelbakif825eb52018-12-04 16:17:00 -050064build_libs.lint = [
Louis Pullen-Freilich08e53df2019-10-24 20:00:35 +010065 core: "com.android.tools.lint:lint:${build_versions.lint}",
66 api: "com.android.tools.lint:lint-api:${build_versions.lint}",
67 tests: "com.android.tools.lint:lint-tests:${build_versions.lint}"
Oussama Ben Abdelbakif825eb52018-12-04 16:17:00 -050068]
69
Jake Wharton7495cc12018-01-05 11:05:13 -050070build_libs.kotlin = [
Louis Pullen-Freilich08e53df2019-10-24 20:00:35 +010071 stdlib: "org.jetbrains.kotlin:kotlin-stdlib:${build_versions.kotlin}",
72 gradle_plugin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${build_versions.kotlin}"
Jake Wharton7495cc12018-01-05 11:05:13 -050073]
Sam Gilbert9d1cee22019-08-12 11:23:10 -040074build_libs.dex_member_list = "com.jakewharton.dex:dex-member-list:4.1.1"
Jeff Gastone8b45d42019-01-17 16:43:49 -050075build_libs.dokka_gradle = [
Louis Pullen-Freilich08e53df2019-10-24 20:00:35 +010076 "org.jetbrains.dokka:dokka-android-gradle-plugin:${build_versions.dokka}",
Jeff Gastone8b45d42019-01-17 16:43:49 -050077]
Louis Pullen-Freilich5c6b11e2020-02-06 18:19:09 +000078build_libs.kotlinpoet = "com.squareup:kotlinpoet:1.4.0"
Aurimas Liutikas419f9932017-12-18 12:53:17 -080079
Sergey Vasilinets70a2e822017-11-03 12:20:28 -070080rootProject.ext['build_libs'] = build_libs