-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
109 lines (87 loc) · 2.51 KB
/
build.gradle
File metadata and controls
109 lines (87 loc) · 2.51 KB
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
buildscript {
ext {
kotlin_version = '1.1.4-2'
vertx_version = '3.4.2'
gradleDockerVersion = '1.2'
technogiDockerGroup = 'technogi'
technogiBaseImage = "openjdk:8-jdk-alpine"
}
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("se.transmode.gradle:gradle-docker:${gradleDockerVersion}")
}
}
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '1.2.3'
}
apply plugin: 'kotlin'
apply plugin: 'docker'
apply from: 'gradle/docker.gradle'
group 'com.technogi.microservices'
version = '0.0.5'
sourceCompatibility = '1.8'
mainClassName = 'io.vertx.core.Launcher'
def mainVerticleName = 'com.technogi.microservices.mxpostalcodes.HttpServer'
repositories {
jcenter()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "io.vertx:vertx-core:${vertx_version}"
compile "io.vertx:vertx-web:${vertx_version}"
compile "io.vertx:vertx-consul-client:${vertx_version}"
compile "io.vertx:vertx-health-check:${vertx_version}"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
run {
args = ['run', mainVerticleName,
"--launcher-class=$mainClassName",
"--redeploy=src/**/*.*",
"--on-redeploy=./gradlew classes",
"-conf 'conf/conf.json'"
]
}
shadowJar {
baseName = 'mx-postal-codes'
classifier = 'shadow'
manifest {
attributes 'Main-Verticle': mainVerticleName
}
mergeServiceFiles {
include 'META-INF/services/io.vertx.core.spi.VerticleFactory'
}
}
// Heroku relies on the 'stage' task to deploy.
task stage {
dependsOn shadowJar
}
//bootBuildInfo.mustRunAfter cleanResources
task('increment') {
doLast {
def v = buildFile.getText().find(version) //get this build file's text and extract the version value
String minor = v.substring(v.lastIndexOf('.') + 1)
int m = 1 + minor.toInteger()
String major = v.substring(0, v.length() - minor.size())
String s = buildFile.getText().replaceFirst("version = '$version'", "version = '" + major + m + "'")
buildFile.setText(s)
}
}
task release(type: Exec) {
//commandLine = "git add --all"
commandLine = ['sh', '-c', "git add --all && git commit -am ${version} && git tag -a '${version}' -m 'Version $version'"]
//ext.output = {
// println(standardOutput.toString())
// return standardOutput.toString()
//}
}
release.dependsOn('clean','increment', 'build')