blob: adcbd90fe149730085ab05f85bc4337ea994619c [file] [log] [blame]
Roman Elizarov85b1a2b2020-09-14 17:48:17 +03001/*
Aurimas Liutikase64dad72021-05-12 21:56:16 +00002 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Roman Elizarov85b1a2b2020-09-14 17:48:17 +03003 */
4
Victor Turansky964cd922020-05-02 19:52:56 +03005import java.util.*
6
Victor Turansky64d23a02020-04-24 15:41:07 +03007plugins {
8 `kotlin-dsl`
9}
10
Roman Elizarov85b1a2b2020-09-14 17:48:17 +030011val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR")?.toBoolean() == true
Vsevolod Tolstopyatov22c43012020-10-23 07:32:51 -070012val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoolean() == true
Roman Elizarov85b1a2b2020-09-14 17:48:17 +030013
Victor Turansky64d23a02020-04-24 15:41:07 +030014repositories {
Roman Elizarov85b1a2b2020-09-14 17:48:17 +030015 if (cacheRedirectorEnabled) {
16 maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
Aurimas Liutikase64dad72021-05-12 21:56:16 +000017 maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap")
Roman Elizarov85b1a2b2020-09-14 17:48:17 +030018 maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
19 } else {
20 maven("https://plugins.gradle.org/m2")
Aurimas Liutikase64dad72021-05-12 21:56:16 +000021 maven("https://dl.bintray.com/kotlin/kotlin-eap")
Roman Elizarov85b1a2b2020-09-14 17:48:17 +030022 maven("https://dl.bintray.com/kotlin/kotlin-dev")
23 }
Vsevolod Tolstopyatov22c43012020-10-23 07:32:51 -070024
25 if (buildSnapshotTrain) {
26 mavenLocal()
27 }
Victor Turansky64d23a02020-04-24 15:41:07 +030028}
29
30kotlinDslPluginOptions {
31 experimentalWarning.set(false)
32}
Victor Turansky964cd922020-05-02 19:52:56 +030033
Vsevolod Tolstopyatov3af136f2020-10-05 10:07:06 -070034val props = Properties().apply {
Victor Turansky964cd922020-05-02 19:52:56 +030035 file("../gradle.properties").inputStream().use { load(it) }
36}
37
Vsevolod Tolstopyatov22c43012020-10-23 07:32:51 -070038fun version(target: String): String {
39 // Intercept reading from properties file
40 if (target == "kotlin") {
41 val snapshotVersion = properties["kotlin_snapshot_version"]
42 if (snapshotVersion != null) return snapshotVersion.toString()
43 }
44 return props.getProperty("${target}_version")
45}
Victor Turansky964cd922020-05-02 19:52:56 +030046
47dependencies {
48 implementation(kotlin("gradle-plugin", version("kotlin")))
49 implementation("org.jetbrains.dokka:dokka-gradle-plugin:${version("dokka")}")
50}