Skip to content

Commit 71a6114

Browse files
woainikkmvicsokolova
authored andcommitted
Set up Integration Tests step in Train
1 parent f3527c9 commit 71a6114

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

integration-testing/build.gradle

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,52 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
6+
buildscript {
7+
8+
/*
9+
* These property group is used to build kotlinx.coroutines against Kotlin compiler snapshot.
10+
* How does it work:
11+
* When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version,
12+
* atomicfu_version is overwritten by TeamCity environment (AFU is built with snapshot and published to mavenLocal
13+
* as previous step or the snapshot build).
14+
* Additionally, mavenLocal and Sonatype snapshots are added to repository list and stress tests are disabled.
15+
* DO NOT change the name of these properties without adapting kotlinx.train build chain.
16+
*/
17+
def prop = rootProject.properties['build_snapshot_train']
18+
ext.build_snapshot_train = prop != null && prop != ""
19+
if (build_snapshot_train) {
20+
ext.kotlin_version = rootProject.properties['kotlin_snapshot_version']
21+
if (kotlin_version == null) {
22+
throw new IllegalArgumentException("'kotlin_snapshot_version' should be defined when building with snapshot compiler")
23+
}
24+
}
25+
ext.native_targets_enabled = rootProject.properties['disable_native_targets'] == null
26+
27+
// Determine if any project dependency is using a snapshot version
28+
ext.using_snapshot_version = build_snapshot_train
29+
rootProject.properties.each { key, value ->
30+
if (key.endsWith("_version") && value instanceof String && value.endsWith("-SNAPSHOT")) {
31+
println("NOTE: USING SNAPSHOT VERSION: $key=$value")
32+
ext.using_snapshot_version = true
33+
}
34+
}
35+
36+
if (using_snapshot_version) {
37+
repositories {
38+
mavenLocal()
39+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
40+
}
41+
}
42+
43+
}
44+
545
plugins {
646
id "org.jetbrains.kotlin.jvm" version "$kotlin_version"
747
}
848

949
repositories {
50+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
1051
mavenLocal()
1152
mavenCentral()
1253
}
@@ -19,6 +60,7 @@ java {
1960
dependencies {
2061
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
2162
testImplementation "org.ow2.asm:asm:$asm_version"
63+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
2264
}
2365

2466
sourceSets {
@@ -130,3 +172,8 @@ compileTestKotlin {
130172
check {
131173
dependsOn([jvmCoreTest, debugDynamicAgentTest, mavenTest, debugAgentTest, coreAgentTest, 'smokeTest:build'])
132174
}
175+
compileKotlin {
176+
kotlinOptions {
177+
jvmTarget = "1.8"
178+
}
179+
}

integration-testing/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ coroutines_version=1.6.4-SNAPSHOT
33
asm_version=9.3
44

55
kotlin.code.style=official
6+
kotlin.mpp.stability.nowarn=true

integration-testing/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pluginManagement {
22
repositories {
33
mavenCentral()
44
maven { url "https://plugins.gradle.org/m2/" }
5+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
56
mavenLocal()
67
}
78
}

integration-testing/smokeTest/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ repositories {
66
// Coroutines from the outer project are published by previous CI buils step
77
mavenLocal()
88
mavenCentral()
9+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
910
}
1011

1112
kotlin {
@@ -40,4 +41,12 @@ kotlin {
4041
}
4142
}
4243
}
44+
targets {
45+
configure([]) {
46+
tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions {
47+
jvmTarget = "1.8"
48+
}
49+
}
50+
}
4351
}
52+

0 commit comments

Comments
 (0)