blob: 773eb8e3ae45b1bd660e5cf607b36aa805379758 [file] [log] [blame]
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +01001import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
2import com.bmuschko.gradle.docker.tasks.image.DockerPushImage
3
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +01004plugins {
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +01005 id 'java'
6 id 'io.quarkus'
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +01007 id "com.bmuschko.docker-remote-api" version "${dockerPluginVersion}"
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +01008 id "com.diffplug.gradle.spotless" version "${spotlessPluginVersion}"
9 id "com.github.ben-manes.versions" version "${versionsPluginVersion}"
10 id "se.patrikerdes.use-latest-versions" version "${useLatestVersionsPluginVersion}"
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010011}
12
Matthias Andreas Benkard513deee2020-01-12 20:58:56 +010013sourceCompatibility = 11
14targetCompatibility = 11
15
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010016repositories {
17 mavenLocal()
18 mavenCentral()
19}
20
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010021tasks {
22 dependencyUpdates {
23 checkConstraints = true
24 gradleReleaseChannel = "current"
25 revision = "release"
26 }
27}
28
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010029dependencies {
30 implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
31
32 implementation 'io.quarkus:quarkus-agroal'
Matthias Andreas Benkardc27d1cb2020-01-26 11:11:24 +010033 implementation 'io.quarkus:quarkus-elytron-security-properties-file'
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010034 implementation 'io.quarkus:quarkus-flyway'
35 implementation 'io.quarkus:quarkus-hibernate-orm-panache'
36 implementation 'io.quarkus:quarkus-hibernate-validator'
37 implementation 'io.quarkus:quarkus-jdbc-postgresql'
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010038 implementation 'io.quarkus:quarkus-kubernetes'
39 implementation 'io.quarkus:quarkus-mailer'
Matthias Andreas Benkard24a25142020-01-24 13:25:54 +010040 implementation 'io.quarkus:quarkus-oidc'
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010041 implementation 'io.quarkus:quarkus-resteasy'
42 implementation 'io.quarkus:quarkus-resteasy-jsonb'
43 implementation 'io.quarkus:quarkus-resteasy-qute'
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010044 implementation 'io.quarkus:quarkus-scheduler'
Matthias Andreas Benkard2a1383f2020-02-01 23:53:17 +010045 implementation 'io.quarkus:quarkus-smallrye-jwt'
Matthias Andreas Benkarde5f81e52020-01-18 12:48:40 +010046
47 //implementation 'io.quarkus:quarkus-elytron-security'
48 //implementation 'io.quarkus:quarkus-elytron-security-jdbc'
49 //implementation 'io.quarkus:quarkus-elytron-security-oauth2'
50 //implementation 'io.quarkus:quarkus-keycloak-authorization'
Matthias Andreas Benkarde5f81e52020-01-18 12:48:40 +010051 //implementation 'io.quarkus:quarkus-quartz'
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010052 //implementation 'io.quarkus:quarkus-smallrye-fault-tolerance'
53 //implementation 'io.quarkus:quarkus-smallrye-health'
54 //implementation 'io.quarkus:quarkus-smallrye-metrics'
55 //implementation 'io.quarkus:quarkus-smallrye-openapi'
56
57 //implementation 'jakarta.transaction:jakarta.transaction-api'
58 //implementation 'org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec'
59 //implementation 'jakarta.persistence:jakarta.persistence-api'
60
Matthias Andreas Benkard2a1383f2020-02-01 23:53:17 +010061 implementation "org.bitbucket.b_c:jose4j"
62
Matthias Andreas Benkard5d71a9e2020-01-18 12:31:26 +010063 implementation 'org.mapstruct:mapstruct'
64 compileOnly 'org.mapstruct:mapstruct-processor'
65
66 compileOnly 'com.google.code.findbugs:jsr305'
67
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010068 implementation 'com.vladmihalcea:hibernate-types-52'
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010069
Matthias Andreas Benkard5d71a9e2020-01-18 12:31:26 +010070 implementation "jakarta.security.jacc:jakarta.security.jacc-api"
71 implementation "net.java.dev.jna:jna"
72
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010073 testImplementation 'io.quarkus:quarkus-junit5'
74 testImplementation 'io.rest-assured:rest-assured'
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010075
Matthias Andreas Benkard06849562020-02-14 20:13:17 +010076 implementation "org.jsoup:jsoup"
Matthias Andreas Benkard4e29a242020-01-25 05:38:27 +010077
Matthias Andreas Benkard424e16e2020-02-09 18:29:56 +010078 implementation "com.vladsch.flexmark:flexmark-all"
79
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010080 constraints {
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010081 implementation "com.vladmihalcea:hibernate-types-52:${hibernateTypesVersion}"
Matthias Andreas Benkard5d71a9e2020-01-18 12:31:26 +010082 implementation "org.mapstruct:mapstruct:${mapstructVersion}"
83 compileOnly "org.mapstruct:mapstruct-processor:${mapstructVersion}"
84 compileOnly "com.google.code.findbugs:jsr305:${findbugsJsr305Version}"
85 implementation "jakarta.security.jacc:jakarta.security.jacc-api:${jakartaJaccVersion}"
86 implementation "net.java.dev.jna:jna:${jnaVersion}"
Matthias Andreas Benkard2a1383f2020-02-01 23:53:17 +010087 implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
Matthias Andreas Benkard424e16e2020-02-09 18:29:56 +010088 implementation "com.vladsch.flexmark:flexmark-all:${flexmarkVersion}"
Matthias Andreas Benkard06849562020-02-14 20:13:17 +010089 implementation "org.jsoup:jsoup:${jsoupVersion}"
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010090 }
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010091}
92
93spotless {
Matthias Andreas Benkard4be112f2020-01-12 20:29:38 +010094 java {
95 googleJavaFormat()
96 removeUnusedImports()
97 }
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010098}
99
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100100group "eu.mulk"
101version "${projectVersion}"
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100102
103task yarnInstall(type:Exec) {
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100104 def resourceDir = "src/main/resources/META-INF/resources"
105
Matthias Andreas Benkardc52eb742020-02-02 19:06:54 +0100106 onlyIf { !project.hasProperty('skipWeb') }
107
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100108 inputs.file "${resourceDir}/package.json"
109 outputs.dir "${resourceDir}/node_modules"
110 outputs.file "${resourceDir}/yarn.lock"
111
112 workingDir resourceDir
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100113 commandLine "yarn", "install"
114}
115
116task snowpack(type:Exec) {
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100117 def resourceDir = "src/main/resources/META-INF/resources"
118
Matthias Andreas Benkardc52eb742020-02-02 19:06:54 +0100119 onlyIf { !project.hasProperty('skipWeb') }
120
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100121 dependsOn yarnInstall
122
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100123 inputs.dir "${resourceDir}/node_modules"
124 inputs.file "${resourceDir}/yarn.lock"
125 inputs.file "${resourceDir}/package.json"
126 outputs.dir "${resourceDir}/web_modules"
127
128 workingDir resourceDir
Matthias Andreas Benkard96a28ef2020-02-15 18:39:51 +0100129 commandLine "yarn", "run", "snowpack", "--optimize"
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100130}
131
Matthias Andreas Benkardb3a2c482020-02-15 20:40:30 +0100132task flow(type:Exec) {
133 def resourceDir = "src/main/resources/META-INF/resources"
134
135 onlyIf { !project.hasProperty('skipWeb') }
136
137 dependsOn snowpack
138
139 workingDir resourceDir
140 commandLine "yarn", "run", "flow", "--color=always"
141}
142
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100143task compileWeb {
144 dependsOn snowpack
Matthias Andreas Benkardb3a2c482020-02-15 20:40:30 +0100145 dependsOn flow
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100146
147 doLast {}
148}
149
Matthias Andreas Benkardb712a012020-01-26 08:10:49 +0100150processResources {
151 exclude("META-INF/resources/node_modules/**/*")
Matthias Andreas Benkard97130f92020-01-27 21:03:39 +0100152 exclude("META-INF/resources/package.json")
153 exclude("META-INF/resources/yarn.lock")
Matthias Andreas Benkardb712a012020-01-26 08:10:49 +0100154}
155
Matthias Andreas Benkardb428e522020-01-26 08:13:04 +0100156quarkusBuild.dependsOn compileWeb
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100157
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100158task buildDocker(type: DockerBuildImage) {
Matthias Andreas Benkardc52eb742020-02-02 19:06:54 +0100159 onlyIf { !project.hasProperty('skipDocker') }
160
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100161 inputDir = file(".")
162 dockerFile = file("src/main/docker/Dockerfile.jvm")
163 images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
164}
165
166buildDocker.dependsOn quarkusBuild
167assemble.dependsOn buildDocker
168
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100169task pushDocker(type: DockerPushImage) {
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100170 images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
171}
172
173pushDocker.dependsOn buildDocker