blob: d7c4fea98913a8aa4b7bea972cd84e04fc85193e [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 Benkard4e29a242020-01-25 05:38:27 +010076 implementation 'org.jsoup:jsoup:1.12.1'
77
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010078 constraints {
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010079 implementation "com.vladmihalcea:hibernate-types-52:${hibernateTypesVersion}"
Matthias Andreas Benkard5d71a9e2020-01-18 12:31:26 +010080 implementation "org.mapstruct:mapstruct:${mapstructVersion}"
81 compileOnly "org.mapstruct:mapstruct-processor:${mapstructVersion}"
82 compileOnly "com.google.code.findbugs:jsr305:${findbugsJsr305Version}"
83 implementation "jakarta.security.jacc:jakarta.security.jacc-api:${jakartaJaccVersion}"
84 implementation "net.java.dev.jna:jna:${jnaVersion}"
Matthias Andreas Benkard2a1383f2020-02-01 23:53:17 +010085 implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}"
Matthias Andreas Benkardf611d9e2020-01-13 05:04:52 +010086 }
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010087}
88
89spotless {
Matthias Andreas Benkard4be112f2020-01-12 20:29:38 +010090 java {
91 googleJavaFormat()
92 removeUnusedImports()
93 }
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010094}
95
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +010096group "eu.mulk"
97version "${projectVersion}"
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +010098
99task yarnInstall(type:Exec) {
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100100 def resourceDir = "src/main/resources/META-INF/resources"
101
Matthias Andreas Benkardc52eb742020-02-02 19:06:54 +0100102 onlyIf { !project.hasProperty('skipWeb') }
103
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100104 inputs.file "${resourceDir}/package.json"
105 outputs.dir "${resourceDir}/node_modules"
106 outputs.file "${resourceDir}/yarn.lock"
107
108 workingDir resourceDir
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100109 commandLine "yarn", "install"
110}
111
112task snowpack(type:Exec) {
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100113 def resourceDir = "src/main/resources/META-INF/resources"
114
Matthias Andreas Benkardc52eb742020-02-02 19:06:54 +0100115 onlyIf { !project.hasProperty('skipWeb') }
116
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100117 dependsOn yarnInstall
118
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100119 inputs.dir "${resourceDir}/node_modules"
120 inputs.file "${resourceDir}/yarn.lock"
121 inputs.file "${resourceDir}/package.json"
122 outputs.dir "${resourceDir}/web_modules"
123
124 workingDir resourceDir
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100125 commandLine "yarn", "run", "snowpack"
126}
127
128task compileWeb {
129 dependsOn snowpack
130
131 doLast {}
132}
133
Matthias Andreas Benkardb712a012020-01-26 08:10:49 +0100134processResources {
135 exclude("META-INF/resources/node_modules/**/*")
Matthias Andreas Benkard97130f92020-01-27 21:03:39 +0100136 exclude("META-INF/resources/package.json")
137 exclude("META-INF/resources/yarn.lock")
Matthias Andreas Benkardb712a012020-01-26 08:10:49 +0100138}
139
Matthias Andreas Benkardb428e522020-01-26 08:13:04 +0100140quarkusBuild.dependsOn compileWeb
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100141
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100142task buildDocker(type: DockerBuildImage) {
Matthias Andreas Benkardc52eb742020-02-02 19:06:54 +0100143 onlyIf { !project.hasProperty('skipDocker') }
144
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100145 inputDir = file(".")
146 dockerFile = file("src/main/docker/Dockerfile.jvm")
147 images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
148}
149
150buildDocker.dependsOn quarkusBuild
151assemble.dependsOn buildDocker
152
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100153task pushDocker(type: DockerPushImage) {
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100154 images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
155}
156
157pushDocker.dependsOn buildDocker