/
Build.kt
150 lines (129 loc) · 4.4 KB
/
Build.kt
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
import com.beust.kobalt.api.Project
import com.beust.kobalt.plugin.kotlin.kotlinCompiler
import com.beust.kobalt.plugin.packaging.assemble
import com.beust.kobalt.plugin.publish.autoGitTag
import com.beust.kobalt.plugin.publish.bintray
import com.beust.kobalt.project
import org.apache.maven.model.Developer
import org.apache.maven.model.License
import org.apache.maven.model.Model
import org.apache.maven.model.Scm
object Versions {
// Java
const val java = "1.8"
// Kystrix
const val kystrix = "0.1.8-SNAPSHOT"
// Compile versions
const val kotlin = "1.3.31"
const val hystrix = "1.5.12"
const val reactorCore = "3.1.9.RELEASE"
const val reactiveStreams = "1.2.1"
// Test versions
const val assertj = "3.11.1"
const val slf4j = "1.7.25"
const val jackson = "2.9.6"
const val restAssured = "3.1.1"
const val asyncHttpClient = "2.5.3"
const val javalin = "2.1.1"
const val junit = "4.12"
const val reactorNetty = "0.7.8.RELEASE"
const val webflux = "5.0.8.RELEASE"
}
const val KYSTRIX_GROUP_NAME = "se.haleby.kystrix"
val core = project {
name = "kystrix-core"
group = KYSTRIX_GROUP_NAME
artifactId = name
version = Versions.kystrix
directory = "core"
dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")
compile("com.netflix.hystrix:hystrix-core:${Versions.hystrix}")
}
dependenciesTest {
compile("junit:junit:${Versions.junit}")
compile("io.javalin:javalin:${Versions.javalin}")
compile("io.rest-assured:rest-assured:${Versions.restAssured}")
compile("org.asynchttpclient:async-http-client:${Versions.asyncHttpClient}")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:${Versions.jackson}")
compile("org.slf4j:slf4j-simple:${Versions.slf4j}")
compile("org.assertj:assertj-core:${Versions.assertj}")
}
// Create maven pom so that we can sync with Maven central
assemble {
mavenJars {
}
}
// Enable Bintray integration
bintray {
publish = true
sign = true
}
// Automatically create a git tag when publishing a release
autoGitTag {
enabled = false
annotated = true
tag = "$version"
message = "Released $version"
}
pom = kystrixPom("Kystrix is a small Kotlin DSL over Hystrix")
}
val spring = project(core) {
name = "kystrix-spring"
group = KYSTRIX_GROUP_NAME
artifactId = name
version = Versions.kystrix
directory = "spring"
kotlinCompiler {
args("-jvm-target", Versions.java)
}
dependencies {
compile("io.projectreactor:reactor-core:${Versions.reactorCore}")
compile("io.reactivex:rxjava-reactive-streams:${Versions.reactiveStreams}")
compile("org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}")
compile("com.netflix.hystrix:hystrix-core:${Versions.hystrix}")
}
dependenciesTest {
compile("junit:junit:${Versions.junit}")
compile("org.assertj:assertj-core:${Versions.assertj}")
compile("io.javalin:javalin:${Versions.javalin}")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:${Versions.jackson}")
compile("io.projectreactor.ipc:reactor-netty:${Versions.reactorNetty}")
compile("org.springframework:spring-webflux:${Versions.webflux}")
}
// Create maven pom so that we can sync with Maven central
assemble {
mavenJars {
}
}
// Enable Bintray integration
bintray {
publish = true
sign = true
}
// Automatically create a git tag when publishing a release
autoGitTag {
enabled = false
annotated = true
tag = "$version"
message = "Released $version"
}
pom = kystrixPom("Kystrix Spring adds Spring support for Kystrix")
}
private fun Project.kystrixPom(desc: String) = Model().apply {
name = project.name
description = desc
url = "https://kystrix.haleby.se/"
licenses = listOf(License().apply {
name = "Apache-2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0"
})
scm = Scm().apply {
url = "https://github.com/johanhaleby/kystrix"
connection = "https://github.com/johanhaleby/kystrix.git"
developerConnection = "git@github.com:johanhaleby/kystrix.git"
}
developers = listOf(Developer().apply {
name = "Johan Haleby"
})
}