forked from spekframework/spek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (95 loc) · 3.11 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
111
112
113
114
115
buildscript {
project.ext.set("junitVersion", "4.12")
project.ext.set("kotlinVersion", "1.0.0")
project.version = '0.1-SNAPSHOT'
repositories {
mavenCentral()
maven {
url 'https://dl.bintray.com/kotlin/kotlin-eap'
}
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
}
}
if (hasProperty("teamcity") && kotlinVersion != '0.1-SNAPSHOT') {
version = teamcity["build.number"]
} else
version = "0.1-SNAPSHOT"
group = 'org.jetbrains.spek'
apply plugin: 'kotlin'
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
allprojects {
repositories {
mavenCentral()
}
apply plugin: 'idea'
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
}
subprojects {
buildscript {
repositories {
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
configurations {
include_unpacked_jars /// used when packing 'spek.jar' for download
}
def junitDependency = "junit:junit:${junitVersion}"
repositories {
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
compile "org.jetbrains.kotlin:kotlin-runtime:${kotlinVersion}"
compile "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
compile "org.jetbrains.kotlin:kotlin-test:${kotlinVersion}"
compile junitDependency
include_unpacked_jars junitDependency
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
}
tasks.withType(Jar) { task ->
task.manifest {
attributes \
'Implementation-Title': "Spek", \
'Implementation-Version': rootProject.version, \
'Implementation-Kotlin-Version': kotlinVersion, \
'Build-Time': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
}
}
test {
// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "512m"
// set JVM arguments for the test JVM(s)
jvmArgs '-XX:MaxPermSize=256m'
}
}
task wrapper(type: Wrapper) {
gradleVersion = 1.11
doLast() {
def gradleOpts = "-XX:MaxPermSize=300m -Xmx1024m"
def gradlew_sh = file("gradlew")
def gradlew_bat = file("gradlew.bat")
gradlew_sh.text = gradlew_sh.text.replace("DEFAULT_JVM_OPTS=",
"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
gradlew_bat.text = gradlew_bat.text.replace("set DEFAULT_JVM_OPTS=",
"set GRADLE_OPTS=$gradleOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
}
}