-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (67 loc) · 2.44 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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
id 'application'
}
group = 'me.qq185'
version = '1.0-SNAPSHOT'
ext.kotlin_version = '1.6.10'
ext.junit_version = '1.8.2'
ext.junit5_version = '5.8.2'
ext.spek_version = '1.1.5'
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
}
dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5_version"
testImplementation "org.jetbrains.spek:spek-api:$spek_version"
testImplementation "org.hamcrest:hamcrest-all:1.3"
testImplementation 'org.mockito:mockito-core:4.2.0'
testImplementation 'com.nhaarman:mockito-kotlin-kt1.1:1.6.0'
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5_version"
testRuntimeOnly "org.jetbrains.spek:spek-junit-platform-engine:$spek_version"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junit_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "com.github.inamik.text.tables:inamik-text-tables:1.0-SNAPSHOT"
implementation 'org.apache.commons:commons-csv:1.8'
implementation group: 'commons-cli', name: 'commons-cli', version: '1.4'
}
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions.jvmTarget = '1.8'
}
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}
application {
mainClassName = 'MainKt'
}
task enabledMockingFinalClasses doLast {
{
def mockMakerFile = new File("$projectDir/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker")
mockMakerFile.parentFile.mkdirs()
mockMakerFile.createNewFile()
mockMakerFile.write("mock-maker-inline")
}
}
jar {
task updateProjectVersion {
def versionFile = new File("$projectDir/src/main/resources/version.properties")
versionFile.parentFile.mkdirs()
versionFile.createNewFile()
versionFile.write("application.version=${version}")
}
manifest {
attributes 'Main-Class': 'main.MainKt'
}
// This line of code recursively collects and copies all of a project's files
// and adds them to the JAR itself. One can extend this task, to skip certain
// files or particular types at will
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}