-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
110 lines (93 loc) · 3.27 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
buildscript {
ext {
kotlinVersion = "1.2.51"
springBootVersion = "2.0.5.RELEASE"
exposedVersion = "0.10.5"
dockerVersion = "0.20.1"
arrowVersion = "0.7.3"
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
classpath("org.jetbrains.kotlin:kotlin-allopen:${kotlinVersion}")
classpath("gradle.plugin.com.palantir.gradle.docker:gradle-docker:${dockerVersion}")
}
}
apply plugin: "kotlin"
apply plugin: "kotlin-spring"
apply plugin: "kotlin-kapt"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "com.palantir.docker"
group = "com.strydal"
version = "0.0.1-SNAPSHOT"
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "1.8"
}
}
repositories {
mavenCentral()
maven { setUrl("https://dl.bintray.com/kotlin/exposed") }
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-security")
compile("com.auth0:java-jwt:3.4.0")
compile("com.fasterxml.jackson.module:jackson-module-kotlin")
compile("com.fasterxml.jackson.datatype:jackson-datatype-joda")
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
compile("org.jetbrains.kotlin:kotlin-reflect")
compile("org.postgresql:postgresql")
compile("org.springframework.boot:spring-boot-starter-jdbc")
compile("org.jetbrains.exposed:exposed:$exposedVersion")
compile("org.jetbrains.exposed:spring-transaction:$exposedVersion")
compile("io.arrow-kt:arrow-core:$arrowVersion")
compile("io.arrow-kt:arrow-syntax:$arrowVersion")
compile("io.arrow-kt:arrow-typeclasses:$arrowVersion")
compile("io.arrow-kt:arrow-data:$arrowVersion")
compile("io.arrow-kt:arrow-instances-core:$arrowVersion")
compile("io.arrow-kt:arrow-instances-data:$arrowVersion")
kapt("io.arrow-kt:arrow-annotations-processor:$arrowVersion")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
bootJar {
baseName = "strydal-backend"
version = "0.0.4"
}
task prepareDockerfile {
doLast {
def dockerfileTemplate = new File("${project.buildDir}/docker/Dockerfile").getText('UTF-8')
def dockerfile = dockerfileTemplate.replaceAll('\\$\\{JAR_FILE}', bootJar.archiveName)
new File("${project.buildDir}/docker/Dockerfile").write(dockerfile, 'UTF-8')
}
}
docker {
dependsOn build
name "${project.group}/${bootJar.baseName}"
files bootJar.archivePath, "now.json"
buildArgs(['JAR_FILE': "${bootJar.archiveName}"])
}
task prepareDeployment(type: Copy) {
dependsOn "docker", "prepareDockerfile"
from "${project.buildDir}/docker"
into "${project.buildDir}/strydal-backend/"
doFirst {
def strydalBackend = new File("${project.buildDir}/strydal-backend/")
strydalBackend.deleteDir()
}
}