-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add JVM toolchain setup. Configure project to use JDK 1.8 toolchain to compile itself and run the tests. * Add separate task to run tests on JDK 11. This task utilizes toolchain feature. CI was updated to run only on agents with JDK 1.8 preinstalled. JDK 11 will be installed by Gradle. * Update Dokka to 1.6.0 release.
- Loading branch information
1 parent
161925b
commit 1e7cf75
Showing
23 changed files
with
103 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import gradle.kotlin.dsl.accessors._80e422bfb44acd38519c1b2ed4303c90.javaToolchains | ||
import org.gradle.api.Project | ||
import org.gradle.api.tasks.testing.Test | ||
import org.gradle.jvm.toolchain.JavaLanguageVersion | ||
import org.gradle.kotlin.dsl.register | ||
|
||
const val testsOnJDK11TaskName: String = "testOnJdk11" | ||
|
||
fun Project.addJdk11Tests() { | ||
val testTask = tasks.register<Test>(testsOnJDK11TaskName) { | ||
javaLauncher.set( | ||
javaToolchains.launcherFor { | ||
languageVersion.set(JavaLanguageVersion.of(11)) | ||
} | ||
) | ||
} | ||
|
||
tasks.named("check") { | ||
dependsOn(testTask) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
id("org.jetbrains.kotlin.jvm") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
jvmToolchain { | ||
(this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8)) | ||
} | ||
|
||
// Do not enable explicit api for cli project | ||
if (project.name != "ktlint") { | ||
explicitApiWarning() | ||
} | ||
} | ||
|
||
tasks | ||
.withType<KotlinCompile>() | ||
.configureEach { | ||
kotlinOptions { | ||
apiVersion = "1.4" | ||
@Suppress("SuspiciousCollectionReassignment") | ||
freeCompilerArgs += listOf("-Xopt-in=kotlin.RequiresOptIn") | ||
} | ||
} | ||
|
||
addJdk11Tests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-publication' | ||
id 'ktlint-kotlin-common' | ||
} | ||
|
||
dependencies { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-publication' | ||
id 'ktlint-kotlin-common' | ||
} | ||
|
||
dependencies { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'org.jetbrains.kotlin.jvm' | ||
id 'ktlint-kotlin-common' | ||
id 'ktlint-publication' | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters