@@ -23,10 +23,24 @@ static def platformOf(project) {
23
23
}
24
24
25
25
buildscript {
26
- ext. useKotlinSnapshot = rootProject. properties[' kotlinSnapshot' ] != null
27
- if (useKotlinSnapshot) {
28
- ext. kotlin_version = ' 1.2-SNAPSHOT'
26
+ /*
27
+ * These property group is used to build kotlinx.coroutines against Kotlin compiler snapshot.
28
+ * How does it work:
29
+ * When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version,
30
+ * atomicfu_version is overwritten by TeamCity environment (AFU is built with snapshot and published to mavenLocal
31
+ * as previous step or the snapshot build).
32
+ * Additionally, mavenLocal and Sonatype snapshots are added to repository list and stress tests are disabled.
33
+ * DO NOT change the name of these properties without adapting kotlinx.train build chain.
34
+ */
35
+ def prop = rootProject. properties[' build_snapshot_train' ]
36
+ ext. build_snapshot_train = prop != null && prop != " "
37
+ if (build_snapshot_train) {
38
+ ext. kotlin_version = rootProject. properties[' kotlin_snapshot_version' ]
39
+ if (kotlin_version == null ) {
40
+ throw new IllegalArgumentException (" 'kotlin_snapshot_version' should be defined when building with snapshot compiler" )
41
+ }
29
42
repositories {
43
+ mavenLocal()
30
44
maven { url " https://oss.sonatype.org/content/repositories/snapshots" }
31
45
}
32
46
}
@@ -43,7 +57,7 @@ buildscript {
43
57
classpath " org.jfrog.buildinfo:build-info-extractor-gradle:$artifactory_plugin_version "
44
58
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
45
59
classpath " org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version "
46
- classpath " org.jetbrains.kotlinx:atomicfu-gradle-plugin:$a tomicFU_version "
60
+ classpath " org.jetbrains.kotlinx:atomicfu-gradle-plugin:$a tomicfu_version "
47
61
classpath " com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version "
48
62
classpath " com.moowork.gradle:gradle-node-plugin:$gradle_node_version "
49
63
@@ -57,17 +71,27 @@ buildscript {
57
71
allprojects {
58
72
// the only place where HostManager could be instantiated
59
73
project. ext. hostManager = new HostManager ()
60
- }
61
-
62
- allprojects {
63
- apply plugin : ' kotlinx-atomicfu'
64
-
65
74
def deployVersion = properties[' DeployVersion' ]
66
75
if (deployVersion != null ) version = deployVersion
67
- if (useKotlinSnapshot) {
68
- kotlin_version = ' 1.2-SNAPSHOT'
76
+
77
+ if (build_snapshot_train) {
78
+ ext. kotlin_version = rootProject. properties[' kotlin_snapshot_version' ]
79
+ println " Using Kotlin $kotlin_version for project $it "
80
+
81
+ if (version != atomicfu_version) {
82
+ throw new IllegalStateException (" Current deploy version is $version , but atomicfu version is not overridden ($atomicfu_version ) for $it " )
83
+ }
84
+
85
+ kotlin_version = rootProject. properties[' kotlin_snapshot_version' ]
86
+ repositories {
87
+ mavenLocal()
88
+ maven { url " https://oss.sonatype.org/content/repositories/snapshots" }
89
+ }
69
90
}
91
+ }
70
92
93
+ allprojects {
94
+ apply plugin : ' kotlinx-atomicfu'
71
95
def projectName = it. name
72
96
repositories {
73
97
/*
@@ -96,7 +120,7 @@ allprojects {
96
120
dependencies {
97
121
// See comment below for rationale, it will be replaced with "project" dependency
98
122
compile " org.jetbrains.kotlinx:kotlinx-coroutines-core:$version "
99
- compileOnly " org.jetbrains.kotlinx:atomicfu:$a tomicFU_version "
123
+ compileOnly " org.jetbrains.kotlinx:atomicfu:$a tomicfu_version "
100
124
101
125
// the only way IDEA can resolve test classes
102
126
testCompile project(" :$coreModule " ). kotlin. targets. jvm. compilations. test. output. allOutputs
@@ -110,6 +134,19 @@ allprojects {
110
134
}
111
135
}
112
136
137
+ if (build_snapshot_train) {
138
+ println " Hacking test tasks, removing stress and flaky tests"
139
+ allprojects {
140
+ tasks. withType(Test ). all {
141
+ exclude ' **/*LinearizabilityTest*.*'
142
+ exclude ' **/*LFTest.*'
143
+ exclude ' **/*StressTest.*'
144
+ exclude ' **/*scheduler.*'
145
+ exclude ' **/*Timeout.*'
146
+ }
147
+ }
148
+ }
149
+
113
150
/*
114
151
* Hack to trick nmpp plugin: we are renaming artifacts in order to provide backward compatibility for dependencies,
115
152
* but publishing plugin does not re-read artifact names for kotlin-jvm projects, so renaming is not applied in pom files
0 commit comments