• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 import java.util.*
6 
<lambda>null7 plugins {
8     `kotlin-dsl`
9 }
10 
11 val cacheRedirectorEnabled = System.getenv("CACHE_REDIRECTOR")?.toBoolean() == true
12 val buildSnapshotTrain = properties["build_snapshot_train"]?.toString()?.toBoolean() == true
13 
<lambda>null14 repositories {
15     if (cacheRedirectorEnabled) {
16         maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
17         maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-eap")
18         maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlin-dev")
19     } else {
20         maven("https://plugins.gradle.org/m2")
21         maven("https://dl.bintray.com/kotlin/kotlin-eap")
22         maven("https://dl.bintray.com/kotlin/kotlin-dev")
23     }
24 
25     if (buildSnapshotTrain) {
26         mavenLocal()
27     }
28 }
29 
<lambda>null30 kotlinDslPluginOptions {
31     experimentalWarning.set(false)
32 }
33 
<lambda>null34 val props = Properties().apply {
35     file("../gradle.properties").inputStream().use { load(it) }
36 }
37 
versionnull38 fun 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 }
46 
<lambda>null47 dependencies {
48     implementation(kotlin("gradle-plugin", version("kotlin")))
49     implementation("org.jetbrains.dokka:dokka-gradle-plugin:${version("dokka")}")
50 }
51