aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-01 17:38:49 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-07-02 12:48:53 +0200
commit012190fbfd049f56637b1039f4ae1f69becea881 (patch)
treed762840339419bdb9c5e75a4e20817c8207c1db0
parent2e02e56818609c683f95ba4f17fa749eb9e1c705 (diff)
downloaddokka-012190fbfd049f56637b1039f4ae1f69becea881.tar.gz
dokka-012190fbfd049f56637b1039f4ae1f69becea881.tar.bz2
dokka-012190fbfd049f56637b1039f4ae1f69becea881.zip
Gradle integration tests: Use dokka_it_kotlin_version over kotlin_version
-rw-r--r--buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt20
-rw-r--r--integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle2
-rw-r--r--integration-tests/gradle/projects/it-basic/build.gradle.kts4
-rw-r--r--integration-tests/gradle/projects/it-basic/gradle.properties1
-rw-r--r--integration-tests/gradle/projects/it-basic/settings.gradle.kts4
-rw-r--r--integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt6
6 files changed, 22 insertions, 15 deletions
diff --git a/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt
index 5bd35415..d5fd3e78 100644
--- a/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt
+++ b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt
@@ -7,13 +7,17 @@ import org.gradle.kotlin.dsl.provideDelegate
fun Project.configureDokkaVersion(): String {
var dokka_version: String? by this.extra
if (dokka_version == null) {
- val buildNumber = System.getenv("BUILD_NUMBER")
val dokka_version_base: String by this
- dokka_version = dokka_version_base + if (buildNumber == null || System.getenv("FORCE_SNAPSHOT") != null) {
- "-SNAPSHOT"
- } else {
- "-$buildNumber"
- }
+ dokka_version = dokkaVersionFromBase(dokka_version_base)
}
- return dokka_version!!
-} \ No newline at end of file
+ return checkNotNull(dokka_version)
+}
+
+private fun dokkaVersionFromBase(baseVersion: String): String {
+ val buildNumber = System.getenv("BUILD_NUMBER")
+ val forceSnapshot = System.getenv("FORCE_SNAPSHOT") != null
+ if (forceSnapshot || buildNumber == null) {
+ return "$baseVersion-SNAPSHOT"
+ }
+ return "$baseVersion-$buildNumber"
+}
diff --git a/integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle b/integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle
index 2420107c..0092b76c 100644
--- a/integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle
+++ b/integration-tests/gradle-integration-tests/testData/androidApp/app/build.gradle
@@ -42,4 +42,4 @@ android {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$test_kotlin_version"
dokkaRuntime files(dokka_fatjar)
-} \ No newline at end of file
+}
diff --git a/integration-tests/gradle/projects/it-basic/build.gradle.kts b/integration-tests/gradle/projects/it-basic/build.gradle.kts
index 3e451fd3..80c2bbea 100644
--- a/integration-tests/gradle/projects/it-basic/build.gradle.kts
+++ b/integration-tests/gradle/projects/it-basic/build.gradle.kts
@@ -1,5 +1,3 @@
-import org.jetbrains.dokka.gradle.dokka
-
plugins {
kotlin("jvm")
id("org.jetbrains.dokka")
@@ -18,5 +16,5 @@ dependencies {
afterEvaluate {
logger.quiet("Gradle version: ${gradle.gradleVersion}")
- logger.quiet("Kotlin version: ${findProperty("kotlin_version")}")
+ logger.quiet("Kotlin version: ${properties["dokka_it_kotlin_version"]}")
}
diff --git a/integration-tests/gradle/projects/it-basic/gradle.properties b/integration-tests/gradle/projects/it-basic/gradle.properties
new file mode 100644
index 00000000..7ebac3ad
--- /dev/null
+++ b/integration-tests/gradle/projects/it-basic/gradle.properties
@@ -0,0 +1 @@
+dokka_it_kotlin_version=1.3.72
diff --git a/integration-tests/gradle/projects/it-basic/settings.gradle.kts b/integration-tests/gradle/projects/it-basic/settings.gradle.kts
index 9bfd026f..10447365 100644
--- a/integration-tests/gradle/projects/it-basic/settings.gradle.kts
+++ b/integration-tests/gradle/projects/it-basic/settings.gradle.kts
@@ -1,11 +1,11 @@
@file:Suppress("LocalVariableName", "UnstableApiUsage")
pluginManagement {
- val kotlin_version = "1.3.72"
+ val dokka_it_kotlin_version: String by settings
val dokka_version = "0.11.0-SNAPSHOT"
plugins {
- id("org.jetbrains.kotlin.jvm") version kotlin_version
+ id("org.jetbrains.kotlin.jvm") version dokka_it_kotlin_version
id("org.jetbrains.dokka") version dokka_version
}
diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
index 34114c74..d8a9a60f 100644
--- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
+++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt
@@ -23,7 +23,11 @@ abstract class AbstractGradleIntegrationTest {
.withProjectDir(projectDir)
.withGradleVersion(buildVersions.gradleVersion)
.forwardOutput()
- .withArguments("-Pkotlin_version=${buildVersions.kotlinVersion}", *arguments)
+ .withArguments(
+ "-Pkotlin_version=${buildVersions.kotlinVersion}",
+ "-Pdokka_it_kotlin_version=${buildVersions.kotlinVersion}",
+ * arguments
+ )
.withDebug(true)
}