-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
173 lines (146 loc) · 3.74 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
buildscript {
ext {
javaVersion = "1.8"
kotlinVersion = "1.2.21"
slf4jVersion = "1.7.25"
branchName = "mvn-repo"
mvnRepoDir = "$buildDir/$branchName"
}
}
plugins {
id "idea"
id "java"
id "maven"
id "eclipse"
id "application"
id "maven-publish" // ./gradlew publish
id "org.jetbrains.kotlin.jvm" version "1.2.21"
id "org.ajoberstar.git-publish" version "0.2.2"
id "com.github.johnrengelman.shadow" version "2.0.2"
id "com.avast.gradle.docker-compose" version "0.6.13"
id "org.jetbrains.kotlin.plugin.noarg" version "1.2.21"
id "org.jetbrains.kotlin.plugin.spring" version "1.2.21"
id "org.jetbrains.kotlin.plugin.allopen" version "1.2.21"
}
mainClassName = "daggerok.App"
shadowJar.mustRunAfter jar
group = "daggerok"
version = "0.0.3"
sourceCompatibility = targetCompatibility = "$javaVersion"
/*
kotlin {
experimental {
coroutines "enable"
}
}
*/
def incr = true
compileKotlin {
incremental = incr
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "$javaVersion"
}
}
compileTestKotlin {
incremental = incr
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "$javaVersion"
}
}
defaultTasks "clean", "build", "installDist", "distZip"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile("org.apache.curator:curator-test:4.0.1") {
exclude module: "slf4j-log4j12"
exclude module: "logback-classic"
}
compile("org.apache.zookeeper:zookeeper:3.4.10") {
exclude module: "slf4j-log4j12"
exclude module: "logback-classic"
}
compile("org.apache.kafka:kafka_2.12:1.0.0") {
exclude module: "slf4j-log4j12"
exclude module: "logback-classic"
}
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "ch.qos.logback:logback-classic:1.2.3"
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
//compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:0.21")
}
def profile = project.hasProperty("profile") ? project.getProperty("profile") : "gradle"
dockerCompose {
useComposeFiles = [project.file("docker-compose-${profile}.yaml")]
// captureContainersOutput = true
captureContainersOutput = false
stopContainers = true
removeContainers = true
removeImages = "Local"
removeVolumes = true
removeOrphans = true
forceRecreate = true
waitForTcpPorts = false
projectName = project.name
}
composeUp.dependsOn assemble
task wrapper(type: Wrapper) {
gradleVersion = "4.6-rc-2"
distributionType = "ALL"
}
test {
systemProperties "property": "value"
}
clean.doFirst {
["out"].each {
delete "$projectDir/out"
}
}
// maven-publish
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
publishing {
repositories {
maven {
// change to point to your repo, e.g. http://my.org/repo
url "$mvnRepoDir"
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
gitPublish {
// where to publish to (repo must exist)
repoUri = "git@github.com:daggerok/embedded-kafka.git"
// branch will be created if it doesn"t exist
branch = "$branchName"
contents {
from "$projectDir/src/main/travis/.nojekyll"
from "$projectDir/src/main/travis/.travis.yml"
from "$buildDir/libs/$shadowJar.archiveName"
from ("$mvnRepoDir") {
//from (javadoc) {
include "**/*.*"
into "."
}
}
// message used when committing changes
commitMessage = "Gradle artifacts for ${project.group}:${project.name}:$project.version" // defaults to "Generated by gradle-git-publish"
}
task deploy(dependsOn: gitPublishPush)
gitPublishPush.dependsOn publish
//task copyFatJar(type: Copy) {
// from "$buildDir/libs/$shadowJar.archiveName"
// into "$mvnRepoDir"
// include "**/*.*"
//}
//publish.dependsOn copyFatJar