-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathbuild.gradle
110 lines (93 loc) · 3.34 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
plugins {
id "org.jetbrains.kotlin.jvm"
}
repositories {
mavenLocal()
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
}
sourceSets {
withGuavaTest {
kotlin
compileClasspath += sourceSets.test.runtimeClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation 'com.google.guava:guava:31.1-jre'
}
}
mavenTest {
kotlin
compileClasspath += sourceSets.test.runtimeClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
}
}
debugAgentTest {
kotlin
compileClasspath += sourceSets.test.runtimeClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-debug:$coroutines_version"
}
}
coreAgentTest {
kotlin
compileClasspath += sourceSets.test.runtimeClasspath
runtimeClasspath += sourceSets.test.runtimeClasspath
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
}
}
}
compileDebugAgentTestKotlin {
kotlinOptions {
freeCompilerArgs += ["-Xallow-kotlin-package"]
}
}
task withGuavaTest(type: Test) {
environment "version", coroutines_version
def sourceSet = sourceSets.withGuavaTest
testClassesDirs = sourceSet.output.classesDirs
classpath = sourceSet.runtimeClasspath
}
task mavenTest(type: Test) {
environment "version", coroutines_version
def sourceSet = sourceSets.mavenTest
testClassesDirs = sourceSet.output.classesDirs
classpath = sourceSet.runtimeClasspath
}
task debugAgentTest(type: Test) {
def sourceSet = sourceSets.debugAgentTest
def coroutinesDebugJar = sourceSet.runtimeClasspath.filter {it.name == "kotlinx-coroutines-debug-${coroutines_version}.jar" }.singleFile
jvmArgs ('-javaagent:' + coroutinesDebugJar)
testClassesDirs = sourceSet.output.classesDirs
classpath = sourceSet.runtimeClasspath
systemProperties project.properties.subMap(["overwrite.probes"])
}
task coreAgentTest(type: Test) {
def sourceSet = sourceSets.coreAgentTest
def coroutinesCoreJar = sourceSet.runtimeClasspath.filter {it.name == "kotlinx-coroutines-core-jvm-${coroutines_version}.jar" }.singleFile
jvmArgs ('-javaagent:' + coroutinesCoreJar)
testClassesDirs = sourceSet.output.classesDirs
classpath = sourceSet.runtimeClasspath
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
check {
dependsOn([withGuavaTest, mavenTest, debugAgentTest, coreAgentTest, 'smokeTest:build'])
}