forked from codefreak/codefreak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
185 lines (164 loc) · 6.33 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
180
181
182
183
184
185
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
id 'org.jetbrains.kotlin.plugin.jpa' version '1.4.10'
id 'org.jetbrains.kotlin.plugin.spring' version '1.4.10'
id "org.jetbrains.kotlin.kapt" version "1.3.72"
id 'org.springframework.boot' version '2.3.4.RELEASE'
id 'com.diffplug.spotless' version '5.6.1'
id 'com.bertramlabs.asset-pipeline' version '3.0.10'
id 'jacoco'
id 'ua.eshepelyuk.ManifestClasspath' version '1.0.0'
id "com.gorylenko.gradle-git-properties" version "2.2.3"
id "org.sonarqube" version "3.0"
id 'net.researchgate.release' version '2.8.1'
id 'org.liquibase.gradle' version '2.0.4'
id 'com.google.cloud.tools.jib' version '2.5.1'
}
apply plugin: 'io.spring.dependency-management'
apply from: 'https://raw.githubusercontent.com/erikhofer/autodiff/1.0.2/autodiff.gradle'
project.autodiff.basePackage = "org.codefreak.codefreak.entity"
project.autodiff.changeLogMaster = "src/main/resources/db/changelog-master.yaml"
project.autodiff.changeLogDiff = project.hasProperty('changeLogDiff')
? project.property('changeLogDiff') : "src/main/resources/db/changelog-diff.yaml"
group = 'org.codefreak'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-ldap'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.security:spring-security-ldap'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.2'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.4.10'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10'
implementation 'com.spotify:docker-client:8.16.0'
implementation 'org.apache.commons:commons-compress:1.20'
implementation 'org.apache.commons:commons-csv:1.8'
implementation 'io.sentry:sentry-logback:1.7.30'
implementation 'com.github.hsingh:java-shortuuid:2a4d72f'
implementation 'com.github.Open-MBEE:junit-xml-parser:1.0.0'
implementation 'org.mitre:openid-connect-client:1.3.3'
implementation 'org.eclipse.jgit:org.eclipse.jgit:5.9.0.202009080501-r'
implementation 'org.eclipse.jgit:org.eclipse.jgit.archive:5.9.0.202009080501-r'
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:5.9.0.202009080501-r'
implementation 'org.liquibase:liquibase-core:4.0.0'
implementation 'com.graphql-java-kickstart:graphql-spring-boot-starter:7.1.0'
implementation 'com.expediagroup:graphql-kotlin-spring-server:2.1.2'
implementation 'com.vladmihalcea:hibernate-types-52:2.9.13'
implementation 'com.github.codefreak:templates:1.2.2'
implementation 'com.networknt:json-schema-validator:1.0.43'
implementation 'javax.validation:validation-api:2.0.1.Final'
implementation 'org.hibernate:hibernate-validator:6.1.5.Final'
implementation 'com.google.guava:guava:29.0-jre'
kapt 'org.springframework.boot:spring-boot-configuration-processor'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
runtimeOnly 'org.hsqldb:hsqldb'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.batch:spring-batch-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0'
testImplementation 'com.tngtech.archunit:archunit-junit4:0.11.0'
// workaround for https://github.com/spotify/docker-client/issues/1030
implementation 'org.glassfish.jersey.inject:jersey-hk2:2.32'
// workaround for https://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server/issues/1468
implementation 'org.springframework.security.oauth:spring-security-oauth2:2.5.0.RELEASE'
liquibaseRuntime 'org.liquibase.ext:liquibase-hibernate5:4.0.0'
liquibaseRuntime 'com.h2database:h2:1.4.200'
liquibaseRuntime 'org.yaml:snakeyaml:1.27'
liquibaseRuntime sourceSets.main.runtimeClasspath
liquibaseRuntime sourceSets.main.output
}
compileKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xjsr305=strict']
jvmTarget = '1.8'
}
}
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xjsr305=strict']
jvmTarget = '1.8'
}
}
bootJar {
// you can still build a fat jar for testing but this is NOT used for building
// the Docker production image with jib!
dependsOn 'deployFrontend'
}
spotless {
kotlin {
ktlint().userData(['indent_size': '2'])
}
}
jacoco {
toolVersion = '0.8.4'
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
springBoot {
mainClassName = 'org.codefreak.codefreak.CodeFreakApplicationKt'
}
test {
testLogging {
events "failed"
exceptionFormat "full"
}
}
task vagrantTest(type: Test) {
systemProperty "codefreak.docker.host", "http://localhost:2375"
testLogging {
events "failed"
exceptionFormat "full"
}
}
// Tests reports are required or Sonar will show 0% coverage
tasks.sonarqube.dependsOn jacocoTestReport
sonarqube {
properties {
property "sonar.projectKey", "code-freak_code-freak"
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml"
}
}
task generateGraphqlSchema(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = "org.codefreak.codefreak.graphql.SchemaPrinterKt"
args 'build/generated/graphql/schema.graphqls'
}
task deployFrontend(type: Copy) {
from 'client/build'
into 'build/resources/main/static'
dependsOn "client:bundle"
}
jib {
to {
image = "cfreak/codefreak"
}
container {
mainClass = springBoot.mainClassName
ports = ["8080"]
// set image build date to current timestamp
creationTime = "USE_CURRENT_TIMESTAMP"
environment = [
ENV: "prod",
SPRING_PROFILES_ACTIVE: "prod",
SENTRY_ENVIRONMENT: "prod",
SENTRY_RELEASE: project.version.toString()
]
}
}
tasks.jibDockerBuild.dependsOn deployFrontend