File tree Expand file tree Collapse file tree 6 files changed +77
-2
lines changed Expand file tree Collapse file tree 6 files changed +77
-2
lines changed Original file line number Diff line number Diff line change
1
+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
+
1
3
/*
2
4
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
5
*/
@@ -25,6 +27,18 @@ jmhJar {
25
27
destinationDirectory = file(" $rootDir " )
26
28
}
27
29
30
+ // to include benchmark-module jmh source set compilation during build to verify that it is also compiled succesfully
31
+ assemble. dependsOn jmhClasses
32
+
33
+ tasks. withType(KotlinCompile ). configureEach {
34
+ kotlinOptions {
35
+ if (rootProject. ext. kotlin_lv_override != null ) {
36
+ languageVersion = rootProject. ext. kotlin_lv_override
37
+ freeCompilerArgs + = " -Xsuppress-version-warnings"
38
+ }
39
+ }
40
+ }
41
+
28
42
dependencies {
29
43
implementation ' org.openjdk.jmh:jmh-core:1.35'
30
44
implementation ' com.google.guava:guava:31.1-jre'
Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
buildscript {
6
- if (project. hasProperty(" bootstrap" )) {
6
+ /**
7
+ * Overrides for Teamcity 'K2 User Projects' + 'Aggregate build / Kotlinx libraries compilation' configuration:
8
+ * kotlin_repo_url - local repository with snapshot Kotlin compiler
9
+ * kotlin_version - kotlin version to use
10
+ * kotlin_language_version - LV to use
11
+ */
12
+ ext. snapshotRepoUrl = rootProject. properties[" kotlin_repo_url" ]
13
+ ext. kotlin_lv_override = rootProject. properties[" kotlin_language_version" ]
14
+ if (snapshotRepoUrl != null && snapshotRepoUrl != " " ) {
15
+ ext. kotlin_version = rootProject. properties[" kotlin_version" ]
16
+ repositories {
17
+ maven { url snapshotRepoUrl }
18
+ }
19
+ } else if (project. hasProperty(" bootstrap" )) {
7
20
ext. kotlin_version = property(' kotlin.version.snapshot' )
8
21
ext[" kotlin.native.home" ] = System . getenv(" KONAN_LOCAL_DIST" )
9
22
} else {
@@ -125,6 +138,13 @@ allprojects {
125
138
}
126
139
}
127
140
141
+ if (snapshotRepoUrl != null && snapshotRepoUrl != " " ) {
142
+ // Snapshot-specific for K2 CI configurations
143
+ repositories {
144
+ maven { url snapshotRepoUrl }
145
+ }
146
+ }
147
+
128
148
configurations. all {
129
149
resolutionStrategy. eachDependency { DependencyResolveDetails details ->
130
150
if (details. requested. group == ' org.jetbrains.kotlin' ) {
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ plugins {
12
12
repositories {
13
13
mavenCentral()
14
14
mavenLocal()
15
+ if (project.hasProperty(" kotlin_repo_url" )) {
16
+ maven(project.properties[" kotlin_repo_url" ] as String )
17
+ }
18
+ // kotlin-dev with space redirector
19
+ maven(" https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" )
15
20
}
16
21
17
22
val kotlinVersion = run {
@@ -20,9 +25,14 @@ val kotlinVersion = run {
20
25
require(! ver.isNullOrBlank()) {" kotlin_snapshot_version must be present if build_snapshot_train is used" }
21
26
return @run ver
22
27
}
28
+ if (project.hasProperty(" kotlin_repo_url" )) {
29
+ val ver = project.properties[" kotlin_version" ] as ? String
30
+ require(! ver.isNullOrBlank()) {" kotlin_version must be present if kotlin_repo_url is used" }
31
+ return @run ver
32
+ }
23
33
val targetProp = if (project.hasProperty(" bootstrap" )) " kotlin.version.snapshot" else " kotlin.version"
24
34
FileInputStream (file(" ../gradle.properties" )).use { propFile ->
25
- val ver = Properties ().apply { load(propFile) }[targetProp]
35
+ val ver = project.findProperty( " kotlin.version " )?.toString() ? : Properties ().apply { load(propFile) }[targetProp]
26
36
require(ver is String ) { " $targetProp must be string in ../gradle.properties, got $ver instead" }
27
37
ver
28
38
}
Original file line number Diff line number Diff line change
1
+ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
2
+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3
+
1
4
/*
2
5
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
6
*/
@@ -12,6 +15,15 @@ compileKotlin {
12
15
}
13
16
}
14
17
18
+ tasks. withType(KotlinCompile ). configureEach {
19
+ kotlinOptions {
20
+ if (rootProject. ext. kotlin_lv_override != null ) {
21
+ languageVersion = rootProject. ext. kotlin_lv_override
22
+ freeCompilerArgs + = " -Xsuppress-version-warnings"
23
+ }
24
+ }
25
+ }
26
+
15
27
java {
16
28
sourceCompatibility = JavaVersion . VERSION_1_8
17
29
targetCompatibility = JavaVersion . VERSION_1_8
Original file line number Diff line number Diff line change @@ -95,6 +95,14 @@ kotlin {
95
95
}
96
96
97
97
targets. all {
98
+ compilations. all {
99
+ kotlinOptions {
100
+ if (rootProject. ext. kotlin_lv_override != null ) {
101
+ languageVersion = rootProject. ext. kotlin_lv_override
102
+ freeCompilerArgs + = " -Xsuppress-version-warnings"
103
+ }
104
+ }
105
+ }
98
106
compilations. main {
99
107
kotlinOptions {
100
108
allWarningsAsErrors = true
Original file line number Diff line number Diff line change
1
+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
+
1
3
/*
2
4
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
5
*/
@@ -9,6 +11,15 @@ kotlin {
9
11
jvmToolchain(8 )
10
12
}
11
13
14
+ tasks. withType(KotlinCompile ). configureEach {
15
+ kotlinOptions {
16
+ if (rootProject. ext. kotlin_lv_override != null ) {
17
+ languageVersion = rootProject. ext. kotlin_lv_override
18
+ freeCompilerArgs + = " -Xsuppress-version-warnings"
19
+ }
20
+ }
21
+ }
22
+
12
23
dependencies {
13
24
testImplementation " org.jetbrains.kotlin:kotlin-test-junit"
14
25
testImplementation " org.jetbrains.kotlinx:kotlinx-knit-test:$knit_version "
You can’t perform that action at this time.
0 commit comments