Louis Pullen-Freilich | 834c8a9 | 2019-05-07 15:00:30 +0100 | [diff] [blame] | 1 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile |
| 2 | |
Sergey Vasilinets | 70a2e82 | 2017-11-03 12:20:28 -0700 | [diff] [blame] | 3 | buildscript { |
Jeff Gaston | fb6f844 | 2020-05-26 17:53:58 -0400 | [diff] [blame] | 4 | project.ext.supportRootFolder = project.projectDir.getParentFile() |
Nikolay Igotti | a380109 | 2021-05-25 16:43:47 +0300 | [diff] [blame] | 5 | apply from: "repos.gradle" |
| 6 | repos.addMavenRepositories(repositories) |
Sergey Vasilinets | ccb3fcb | 2017-10-16 23:46:48 +0000 | [diff] [blame] | 7 | |
Sergey Vasilinets | 70a2e82 | 2017-11-03 12:20:28 -0700 | [diff] [blame] | 8 | dependencies { |
Aurimas Liutikas | 4a228f7 | 2021-08-05 15:43:18 -0700 | [diff] [blame] | 9 | classpath(libs.kotlinGradlePluginz) |
Sergey Vasilinets | 70a2e82 | 2017-11-03 12:20:28 -0700 | [diff] [blame] | 10 | } |
Jake Wharton | 7495cc1 | 2018-01-05 11:05:13 -0500 | [diff] [blame] | 11 | |
| 12 | configurations.classpath.resolutionStrategy { |
| 13 | eachDependency { details -> |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 14 | if (details.requested.group == "org.jetbrains.kotlin") { |
Aurimas Liutikas | e1b8458 | 2021-04-23 14:17:30 -0700 | [diff] [blame] | 15 | details.useVersion libs.versions.kotlin.get() |
Jake Wharton | 7495cc1 | 2018-01-05 11:05:13 -0500 | [diff] [blame] | 16 | } |
| 17 | } |
| 18 | } |
Sergey Vasilinets | 70a2e82 | 2017-11-03 12:20:28 -0700 | [diff] [blame] | 19 | } |
Jeff Gaston | 79a43f2 | 2019-04-09 16:19:12 -0400 | [diff] [blame] | 20 | |
| 21 | apply from: "out.gradle" |
| 22 | init.chooseOutDir() |
| 23 | |
Aurimas Liutikas | 9ab3b4c3 | 2017-04-19 09:33:27 -0700 | [diff] [blame] | 24 | ext.supportRootFolder = project.projectDir.getParentFile() |
Jim Sproch | 9e38b4f | 2021-01-06 14:21:06 -0800 | [diff] [blame] | 25 | apply from: "repos.gradle" |
Sergey Vasilinets | 164c38d | 2018-02-02 00:50:57 -0800 | [diff] [blame] | 26 | apply plugin: "kotlin" |
Aurimas Liutikas | 9ab3b4c3 | 2017-04-19 09:33:27 -0700 | [diff] [blame] | 27 | |
Oussama Ben Abdelbaki | f825eb5 | 2018-12-04 16:17:00 -0500 | [diff] [blame] | 28 | allprojects { |
| 29 | repos.addMavenRepositories(repositories) |
Jake Wharton | a0576c3 | 2018-07-27 13:09:42 -0400 | [diff] [blame] | 30 | |
Louis Pullen-Freilich | 834c8a9 | 2019-05-07 15:00:30 +0100 | [diff] [blame] | 31 | tasks.withType(KotlinCompile).configureEach { |
| 32 | kotlinOptions { |
Jim Sproch | 666614b | 2021-08-18 07:43:56 -0700 | [diff] [blame] | 33 | jvmTarget = "11" |
Alan Viverette | 5baaf85 | 2020-06-04 16:10:19 +0000 | [diff] [blame] | 34 | freeCompilerArgs += [ |
| 35 | "-Werror", |
Jim Sproch | a88c07a | 2020-06-25 13:00:03 -0700 | [diff] [blame] | 36 | "-Xskip-metadata-version-check", |
Alan Viverette | 5baaf85 | 2020-06-04 16:10:19 +0000 | [diff] [blame] | 37 | // Allow `@OptIn` and `@UseExperimental` |
Jim Sproch | bcbd33a | 2022-01-12 14:45:37 -0800 | [diff] [blame] | 38 | "-opt-in=kotlin.RequiresOptIn", |
Jim Sproch | e238bad | 2021-03-23 16:47:15 -0700 | [diff] [blame] | 39 | // Issue where sam conversion in gradle's kts file causes task-out-of-date |
| 40 | // Details: KT-46445 and https://github.com/gradle/gradle/issues/17052 |
| 41 | "-Xsam-conversions=class" |
Alan Viverette | 5baaf85 | 2020-06-04 16:10:19 +0000 | [diff] [blame] | 42 | ] |
Aurimas Liutikas | 78bc297 | 2021-11-04 14:23:46 -0700 | [diff] [blame] | 43 | languageVersion = "1.5" |
| 44 | apiVersion = "1.5" |
Louis Pullen-Freilich | 834c8a9 | 2019-05-07 15:00:30 +0100 | [diff] [blame] | 45 | } |
| 46 | } |
Oussama Ben Abdelbaki | f825eb5 | 2018-12-04 16:17:00 -0500 | [diff] [blame] | 47 | } |
Sergey Vasilinets | bb245e08 | 2017-10-11 00:16:04 -0700 | [diff] [blame] | 48 | |
Aurimas Liutikas | 9697da7 | 2016-12-22 15:50:42 -0800 | [diff] [blame] | 49 | dependencies { |
Jeff Gaston | d72edf2 | 2021-08-24 11:53:54 -0400 | [diff] [blame] | 50 | api(project("plugins")) |
Jeff Gaston | 52d044a | 2020-06-12 18:19:29 -0400 | [diff] [blame] | 51 | } |