-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
102 lines (80 loc) · 2.55 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
buildscript {
ext.kotlin_version = '1.2.21'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
group 'eece513'
version '1.0'
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
sourceSets {
test {
kotlin {
srcDirs += "src/test/unit/kotlin"
}
}
distributedTest {
kotlin {
srcDirs += "src/test/distributed/kotlin"
}
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
}
configurations {
distributedTestCompile.extendsFrom testCompile
distributedTestRuntime.extendsFrom testRuntime
}
dependencies {
// kotlin
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
// tinylog
compile group: 'org.tinylog', name: 'tinylog', version: '1.3.2'
// junit
testCompile group: 'junit', name: 'junit', version: '4.12'
distributedTestCompile group: 'junit', name: 'junit', version: '4.12'
// mockito
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.13.0'
distributedTestCompile group: 'org.mockito', name: 'mockito-core', version: '2.13.0'
testCompile group: 'com.nhaarman', name: 'mockito-kotlin', version: '1.5.0'
distributedTestCompile group: 'com.nhaarman', name: 'mockito-kotlin', version: '1.5.0'
testCompile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: '1.2.20'
distributedTestCompile group: 'org.jetbrains.kotlin', name: 'kotlin-reflect', version: '1.2.20'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jar {
manifest {
attributes "Main-Class": "eece513.server.GrepServer"
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task distributedTest(type: Test, description: 'Runs the distributed tests.', group: 'Verification') {
setTestClassesDirs sourceSets.distributedTest.output.classesDirs
classpath = sourceSets.distributedTest.runtimeClasspath
}
task configBootstrapAws {
doLast {
if (!project.hasProperty("pem")) {
throw new InvalidUserDataException("must provide path to PEM file!")
}
bootstrapAws.commandLine "./scripts/deploymentScript", project.pem, "--all"
}
}
task bootstrapAws(type: Exec, description: 'Configure AWS servers', group: 'Configuration') {
dependsOn = ['configBootstrapAws']
}