File: build.gradle

package info (click to toggle)
kotlinx-coroutines 1.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,628 kB
  • sloc: xml: 418; sh: 322; javascript: 60; makefile: 17; java: 8
file content (66 lines) | stat: -rw-r--r-- 2,100 bytes parent folder | download
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
/*
 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

dependencies {
    testCompile "com.devexperts.lincheck:core:$lincheck_version"
    testCompile "com.esotericsoftware:kryo:4.0.0"
}

task checkJdk16() {
    // only fail w/o JDK_16 when actually trying to compile, not during project setup phase
    doLast {
        if (!System.env.JDK_16) {
            throw new GradleException("JDK_16 environment variable is not defined. " +
                    "Can't build against JDK 1.6 runtime and run JDK 1.6 compatibility tests. " +
                    "Please ensure JDK 1.6 is installed and that JDK_16 points to it.")
        }
    }
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
    kotlinOptions.jdkHome = System.env.JDK_16
    // only fail when actually trying to compile, not during project setup phase
    dependsOn(checkJdk16)
}

tasks.withType(Test) {
    minHeapSize = '1g'
    maxHeapSize = '1g'
    enableAssertions = true
    systemProperty 'java.security.manager', 'kotlinx.coroutines.TestSecurityManager'
}

test {
    exclude '**/*LFTest.*'
    systemProperty 'kotlinx.coroutines.scheduler.keep.alive.sec', '100000' // any unpark problem hangs test
}

task lockFreedomTest(type: Test, dependsOn: testClasses) {
    classpath = files(configurations.testRuntime,
            sourceSets.main.output.classesDirs, //clear, untransformed classes
            sourceSets.test.output.classesDirs)
    include '**/*LFTest.*'
}

task jdk16Test(type: Test, dependsOn: [testClasses, checkJdk16]) {
    executable = "$System.env.JDK_16/bin/java"
    exclude '**/*LinearizabilityTest.*'
    exclude '**/*LFTest.*'
    exclude '**/exceptions/**'
    exclude '**/ExceptionsGuideTest.*'
}

// Run these tests only during nightly stress test
jdk16Test.onlyIf { project.properties['stressTest'] != null }

// Always run those tests
task moreTest(dependsOn: [lockFreedomTest, jdk16Test])

build.dependsOn moreTest

task testsJar(type: Jar, dependsOn: testClasses) {
    classifier = 'tests'
    from sourceSets.test.output
}