-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
196 lines (161 loc) · 5.64 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Kotlin library project to get you started.
*/
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM.
id 'org.jetbrains.kotlin.jvm' version '1.3.41'
// shadowJar
id 'com.github.johnrengelman.shadow' version '5.0.0'
}
def appVersion = "0.0.2"
group = 'com.hasanozgan'
def BUILD_NUMBER = System.getenv('CIRCLE_BUILD_NUM')
version = "$appVersion.$BUILD_NUMBER"
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: 'maven'
apply plugin: 'signing'
jacoco {
toolVersion = "0.8.4"
}
// versions
def javaVersion = JavaVersion.VERSION_1_8
def kotlinVersion = "1.3.41"
def kotlinXCoroutinesVersion = "1.3.0"
def arrowVersion = "0.9.0"
def rxjavaVersion = "2.2.0"
def rxKotlinVersion = "2.2.0"
def hamcrestVersion = "2.0.0.0"
def h2Version = "1.4.199"
def hikariVersion = "3.3.1"
def mockkVersion = "1.9.3"
def exposedVersion = "0.16.1"
def gsonVersion = "2.8.5"
def slf4jVersion = "1.7.25"
def logbackVersion = "1.2.3"
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
// integration test setup starting
configurations {
testIntegrationImplementation.extendsFrom testImplementation
testIntegrationRuntimeOnly.extendsFrom testRuntimeOnly
}
sourceSets {
main {
output.dir file("out")
}
test {
output.dir file("out")
}
testIntegration {
kotlin {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/test-integration/kotlin')
}
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/test-integration/java')
output.dir file('out')
}
resources.srcDir file('src/test-integration/resources')
}
}
test {
testLogging {
events "PASSED", "FAILED", "SKIPPED" //,"STARTED"
}
}
task testIntegration(type: Test) {
testClassesDirs = sourceSets.testIntegration.output.classesDirs
classpath = sourceSets.testIntegration.runtimeClasspath
mustRunAfter test
}
check.dependsOn testIntegration
testIntegration {
testLogging {
events "PASSED", "FAILED", "SKIPPED" //,"STARTED"
displayGranularity 1
}
}
shadowJar {
mergeServiceFiles()
}
idea {
module {
testSourceDirs += sourceSets.testIntegration.java.srcDirs
testSourceDirs += sourceSets.testIntegration.kotlin.srcDirs
testResourceDirs += sourceSets.testIntegration.resources.srcDirs
scopes.TEST.plus += [configurations.testIntegrationCompile]
}
}
// integration test setup finished
def allTestCoverageFile = "$buildDir/jacoco/allTestCoverage.exec"
task jacocoMergeTest(type: JacocoMerge) {
destinationFile = file(allTestCoverageFile)
executionData = project.fileTree(dir: '.', include: '**/build/jacoco/test*.exec')
}
task jacocoFullCoverageReport(type: JacocoReport) {
additionalSourceDirs = files(rootProject.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
executionData = fileTree(dir: '.', include: '**/build/jacoco/test*.exec')
reports {
xml.enabled = true
xml.destination = file("${buildDir}/reports/jacoco/test/coverage.xml")
}
}
// dependency kotlin hack: fixed different kotlin-reflect versions on dependencies
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'org.jetbrains.kotlin' && requested.name == 'kotlin-reflect') {
details.useVersion kotlinVersion
}
}
}
dependencies {
// Use the Kotlin JDK 8 standard library.
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
// KotlinX Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinXCoroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-reactive:$kotlinXCoroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx2:$kotlinXCoroutinesVersion"
// Arrow
implementation "io.arrow-kt:arrow-core-data:$arrowVersion"
implementation "io.arrow-kt:arrow-effects-extensions:$arrowVersion"
// RXJava
implementation "io.reactivex.rxjava2:rxjava:$rxjavaVersion"
implementation "io.reactivex.rxjava2:rxkotlin:$rxKotlinVersion"
// Reflection
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
// Hikari JPA datasource connection pool
implementation "com.zaxxer:HikariCP:$hikariVersion"
// Exposed DB library
api "org.jetbrains.exposed:exposed:$exposedVersion"
// GSON json library
implementation "com.google.code.gson:gson:$gsonVersion"
// Log4J and Logback
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "ch.qos.logback:logback-classic:$logbackVersion"
implementation "ch.qos.logback:logback-core:$logbackVersion"
// Use the Kotlin test library.
testImplementation 'org.jetbrains.kotlin:kotlin-test'
// Use the Kotlin JUnit integration.
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
// Hamcrest for Junit
testImplementation "org.hamcrest:hamcrest-junit:$hamcrestVersion"
// Mockk Version
testImplementation "io.mockk:mockk:$mockkVersion"
testIntegrationImplementation "com.h2database:h2:$h2Version"
}
apply from: 'publish.gradle'