-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
100 lines (86 loc) · 2.93 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
buildscript {
ext {
kotlinVersion = '1.3.21'
kodeinVersion = '6.1.0'
spekVersion = '2.0.0'
expektVersion = '0.5.0'
mockitoVersion = '2.8.47'
guavaVersion = '25.0-jre'
retrofitVersion = '2.5.0'
mockWebServerVersion = '3.11.0'
junitVersion = '5.4.0'
}
repositories {
mavenCentral()
jcenter()
maven { url 'http://central.maven.org/maven2/' }
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath('org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1')
}
}
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
sourceSets {
main.kotlin.srcDirs += 'src/main/kotlin'
test.kotlin.srcDirs += 'src/test/kotlin'
main.resources.srcDirs += 'src/main/resource'
test.resources.srcDirs += 'src/test/resource'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.omnitrade'
version = '0.1.0'
repositories {
maven { url 'http://jcenter.bintray.com' }
maven { url 'http://repo.maven.apache.org/maven2' }
}
dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
compile("org.kodein.di:kodein-di-generic-jvm:$kodeinVersion")
compile("com.squareup.retrofit2:retrofit:$retrofitVersion")
compile("com.squareup.retrofit2:converter-gson:$retrofitVersion")
compile("com.google.guava:guava:$guavaVersion")
testCompile("org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion")
testCompile("com.winterbe:expekt:$expektVersion")
testCompile("org.mockito:mockito-core:$mockitoVersion")
testCompile("com.squareup.okhttp3:mockwebserver:$mockWebServerVersion")
testCompile("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testCompile("org.spekframework.spek2:spek-dsl-jvm:$spekVersion") {
exclude group: 'org.jetbrains.kotlin'
}
testRuntime("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion") {
exclude group: 'org.junit.platform'
exclude group: 'org.jetbrains.kotlin'
}
testRuntimeOnly("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
}
test {
useJUnitPlatform {
includeEngines 'spek2'
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
pom.withXml {
asNode().dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
model {
tasks.generatePomFileForMavenPublication {
destination = file("$buildDir/libs/${rootProject.name}-${version}.pom")
}
}