This repository has been archived by the owner on May 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
179 lines (142 loc) · 5.15 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
174
175
176
177
178
179
buildscript {
ext.kotlin_version = '1.2.41' // Required for Kotlin integration
ext.spring_boot_version = '2.0.1.RELEASE'
ext.jwt_version = '1.0.9.RELEASE'
ext.oauth_version = '2.3.2.RELEASE'
ext.h2_version = '1.4.197'
ext.postgresql_version = '42.2.2'
ext.hikari_version = '3.1.0'
ext.rx_version = '2.1.13'
ext.rxkotlin_version = '2.2.0'
ext.cmd_ext = System.getProperty("os.name").toUpperCase().contains("WINDOWS") ? ".cmd" : ""
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // Required for Kotlin integration
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
// See https://kotlinlang.org/docs/reference/compiler-plugins.html#kotlin-spring-compiler-plugin
classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_version"
classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.19.2"
}
}
apply plugin: 'kotlin'
apply plugin: "kotlin-spring"
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.palantir.docker'
jar {
baseName = 'betman'
version = '1.0.0'
}
repositories {
jcenter()
maven {
url = "https://dl.bintray.com/kotlin/exposed"
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" // Required for Kotlin integration
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-security'
compile "org.springframework.boot:spring-boot-configuration-processor"
compile 'org.springframework.boot:spring-boot-starter-webflux'
compile "org.postgresql:postgresql:$postgresql_version"
compile "com.h2database:h2:$h2_version"
compile 'io.github.microutils:kotlin-logging:1.4.9'
compile "io.reactivex.rxjava2:rxjava:$rx_version"
compile "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
compile 'io.jsonwebtoken:jjwt:0.9.0'
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.+"
compile "org.springframework.security:spring-security-jwt:$jwt_version"
compile "org.springframework.security.oauth:spring-security-oauth2:$oauth_version"
compile 'org.jetbrains.exposed:exposed:0.10.2'
compile 'com.google.cloud.sql:postgres-socket-factory:1.0.8'
compile 'com.github.ben-manes.caffeine:caffeine:2.6.2'
compile 'net.javacrumbs.future-converter:future-converter-rxjava2-java8:1.1.0'
compile 'org.apache.commons:commons-math3:3.6.1'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile "com.h2database:h2:$h2_version"
testCompile group: 'com.nhaarman', name: 'mockito-kotlin', version: '1.5.0'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testRuntime 'org.hamcrest:hamcrest-core:1.3'
compile "com.zaxxer:HikariCP:$hikari_version"
testImplementation 'junit:junit:4.12'
}
test {
testLogging {
showStandardStreams = true
}
}
def webappDir = "$projectDir/src/main/webapp"
sourceSets {
main {
resources {
srcDirs = ["$webappDir/dist", "$projectDir/src/main/resources"]
}
}
integrationTest {
kotlin {
compileClasspath += main.output + test.output
compileClasspath += test.output
compileClasspath += test.compileClasspath
runtimeClasspath += main.output + test.output
//noinspection GroovyAssignabilityCheck
srcDir file('src/integrationTest/kotlin')
}
}
}
// Otherwise integrationTests don't actually get the classpaths
configurations {
integrationTestImplementation.extendsFrom testImplementation
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
}
task integrationTest(type: Test) {
// So that Gradle knows where the integration test classes are:
testClassesDirs = sourceSets.integrationTest.output.classesDirs
// So that Gradle knows which runtime class path to use:
classpath = sourceSets.integrationTest.runtimeClasspath
// Otherwise these don't always run
outputs.upToDateWhen { false }
}
processResources {
dependsOn "buildAngular"
}
task testAngular(type: Exec) {
dependsOn "buildAngular"
workingDir "$webappDir"
inputs.dir "$webappDir"
group = BasePlugin.BUILD_GROUP
commandLine "ng${cmd_ext}", "test", "--browsers", "ChromeHeadless"
}
task buildAngular(type: Exec) {
dependsOn "installAngular"
workingDir "$webappDir"
inputs.dir "$webappDir"
group = BasePlugin.BUILD_GROUP
commandLine "ng${cmd_ext}", "build", "--prod"
}
task installAngular(type: Exec) {
workingDir "$webappDir"
inputs.dir "$webappDir"
group = BasePlugin.BUILD_GROUP
commandLine "npm${cmd_ext}", "install"
}
jar {
dependsOn "testAngular"
dependsOn "integrationTest"
}
bootJar {
baseName = 'betman'
version = '1.0.0'
}
docker {
// dependsOn build
name "${bootJar.baseName}"
dockerfile file("Dockerfile.plain")
files bootJar.archivePath
buildArgs(['JAR_FILE':"${bootJar.archiveName}"])
}