Sergey Vasilinets | 70a2e82 | 2017-11-03 12:20:28 -0700 | [diff] [blame] | 1 | /* |
| 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-Freilich | 1dff678 | 2019-10-17 18:12:39 +0100 | [diff] [blame] | 17 | def isUiProject = System.getenv("DIST_SUBDIR") == "/ui" |
| 18 | |
Jake Wharton | 7495cc1 | 2018-01-05 11:05:13 -0500 | [diff] [blame] | 19 | def build_versions = [:] |
| 20 | |
Louis Pullen-Freilich | 08e53df | 2019-10-24 20:00:35 +0100 | [diff] [blame] | 21 | // NOTE: lint versions *must* be kept in sync with agp |
Louis Pullen-Freilich | 1dff678 | 2019-10-17 18:12:39 +0100 | [diff] [blame] | 22 | if (isUiProject) { |
Jim Sproch | 7fe92eb | 2020-08-13 13:52:40 -0700 | [diff] [blame^] | 23 | build_versions.kotlin = "1.4.0" |
Andrey Kulikov | 9b3a88a | 2020-05-11 13:34:24 +0100 | [diff] [blame] | 24 | build_versions.kotlin_coroutines = "1.3.6" |
Aurimas Liutikas | 6a800af | 2020-07-28 17:27:43 -0700 | [diff] [blame] | 25 | build_versions.agp = '4.2.0-alpha06' |
| 26 | build_versions.lint = '27.2.0-alpha06' |
Aurimas Liutikas | aa460b0 | 2019-04-25 16:03:21 -0700 | [diff] [blame] | 27 | } else { |
Dustin Lam | 40b5ddc | 2020-03-25 12:19:01 -0700 | [diff] [blame] | 28 | build_versions.kotlin = "1.3.71" |
Zac Sweers | 83b0d9c | 2020-07-03 00:22:37 -0400 | [diff] [blame] | 29 | build_versions.kotlin_coroutines = "1.3.7" |
Aurimas Liutikas | 6a800af | 2020-07-28 17:27:43 -0700 | [diff] [blame] | 30 | build_versions.agp = '4.2.0-alpha06' |
Rahul Ravikumar | ce3f4fb | 2020-06-11 12:34:26 -0700 | [diff] [blame] | 31 | // 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 Liutikas | 6a800af | 2020-07-28 17:27:43 -0700 | [diff] [blame] | 33 | build_versions.lint = '27.2.0-alpha06' |
Aurimas Liutikas | aa460b0 | 2019-04-25 16:03:21 -0700 | [diff] [blame] | 34 | } |
Louis Pullen-Freilich | 1dff678 | 2019-10-17 18:12:39 +0100 | [diff] [blame] | 35 | |
Aurimas Liutikas | 5941b52 | 2020-03-04 15:21:52 -0800 | [diff] [blame] | 36 | def agpOverride = System.getenv("GRADLE_PLUGIN_VERSION") |
| 37 | if (agpOverride != null) { |
| 38 | logger.warn("Using custom version ${agpOverride} of AGP due to GRADLE_PLUGIN_VERSION being set.") |
| 39 | build_versions.agp = agpOverride |
Aurimas Liutikas | 4854124 | 2020-03-04 12:56:08 -0800 | [diff] [blame] | 40 | } |
| 41 | |
Jeff Gaston | fb6f844 | 2020-05-26 17:53:58 -0400 | [diff] [blame] | 42 | // gets the version of Dokka defined in source |
| 43 | def 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 | |
| 52 | if (System.getenv("BUILD_DOKKA") != null) { |
| 53 | build_versions.dokka = getSourceDokkaVersion() |
| 54 | } else { |
Andrea Falcone | d821b26 | 2020-06-25 16:20:00 -0400 | [diff] [blame] | 55 | build_versions.dokka = '0.9.17-g013' |
Jeff Gaston | fb6f844 | 2020-05-26 17:53:58 -0400 | [diff] [blame] | 56 | } |
Jeff Gaston | 149350d | 2019-03-08 20:32:29 -0500 | [diff] [blame] | 57 | |
Jake Wharton | 7495cc1 | 2018-01-05 11:05:13 -0500 | [diff] [blame] | 58 | rootProject.ext['build_versions'] = build_versions |
| 59 | |
Sergey Vasilinets | 70a2e82 | 2017-11-03 12:20:28 -0700 | [diff] [blame] | 60 | def build_libs = [:] |
| 61 | |
Louis Pullen-Freilich | 1dff678 | 2019-10-17 18:12:39 +0100 | [diff] [blame] | 62 | build_libs.agp = "com.android.tools.build:gradle:${build_versions.agp}" |
Jeff Gaston | db2929e | 2018-03-07 13:52:32 -0500 | [diff] [blame] | 63 | |
Oussama Ben Abdelbaki | f825eb5 | 2018-12-04 16:17:00 -0500 | [diff] [blame] | 64 | build_libs.lint = [ |
Louis Pullen-Freilich | 08e53df | 2019-10-24 20:00:35 +0100 | [diff] [blame] | 65 | 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 Abdelbaki | f825eb5 | 2018-12-04 16:17:00 -0500 | [diff] [blame] | 68 | ] |
| 69 | |
Jake Wharton | 7495cc1 | 2018-01-05 11:05:13 -0500 | [diff] [blame] | 70 | build_libs.kotlin = [ |
Louis Pullen-Freilich | 08e53df | 2019-10-24 20:00:35 +0100 | [diff] [blame] | 71 | stdlib: "org.jetbrains.kotlin:kotlin-stdlib:${build_versions.kotlin}", |
| 72 | gradle_plugin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${build_versions.kotlin}" |
Jake Wharton | 7495cc1 | 2018-01-05 11:05:13 -0500 | [diff] [blame] | 73 | ] |
Sam Gilbert | 9d1cee2 | 2019-08-12 11:23:10 -0400 | [diff] [blame] | 74 | build_libs.dex_member_list = "com.jakewharton.dex:dex-member-list:4.1.1" |
Jeff Gaston | e8b45d4 | 2019-01-17 16:43:49 -0500 | [diff] [blame] | 75 | build_libs.dokka_gradle = [ |
Louis Pullen-Freilich | 08e53df | 2019-10-24 20:00:35 +0100 | [diff] [blame] | 76 | "org.jetbrains.dokka:dokka-android-gradle-plugin:${build_versions.dokka}", |
Jeff Gaston | e8b45d4 | 2019-01-17 16:43:49 -0500 | [diff] [blame] | 77 | ] |
Louis Pullen-Freilich | 5c6b11e | 2020-02-06 18:19:09 +0000 | [diff] [blame] | 78 | build_libs.kotlinpoet = "com.squareup:kotlinpoet:1.4.0" |
Aurimas Liutikas | 419f993 | 2017-12-18 12:53:17 -0800 | [diff] [blame] | 79 | |
Sergey Vasilinets | 70a2e82 | 2017-11-03 12:20:28 -0700 | [diff] [blame] | 80 | rootProject.ext['build_libs'] = build_libs |