blob: 7302b0da2ae12dcea04634166caf7b31ec97e100 [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
102 inputs.file "${resourceDir}/package.json"
103 outputs.dir "${resourceDir}/node_modules"
104 outputs.file "${resourceDir}/yarn.lock"
105
106 workingDir resourceDir
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100107 commandLine "yarn", "install"
108}
109
110task snowpack(type:Exec) {
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100111 def resourceDir = "src/main/resources/META-INF/resources"
112
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100113 dependsOn yarnInstall
114
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100115 inputs.dir "${resourceDir}/node_modules"
116 inputs.file "${resourceDir}/yarn.lock"
117 inputs.file "${resourceDir}/package.json"
118 outputs.dir "${resourceDir}/web_modules"
119
120 workingDir resourceDir
Matthias Andreas Benkard2a107552020-01-23 10:47:52 +0100121 commandLine "yarn", "run", "snowpack"
122}
123
124task compileWeb {
125 dependsOn snowpack
126
127 doLast {}
128}
129
Matthias Andreas Benkardb712a012020-01-26 08:10:49 +0100130processResources {
131 exclude("META-INF/resources/node_modules/**/*")
Matthias Andreas Benkard97130f92020-01-27 21:03:39 +0100132 exclude("META-INF/resources/package.json")
133 exclude("META-INF/resources/yarn.lock")
Matthias Andreas Benkardb712a012020-01-26 08:10:49 +0100134}
135
Matthias Andreas Benkardb428e522020-01-26 08:13:04 +0100136quarkusBuild.dependsOn compileWeb
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100137
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100138task buildDocker(type: DockerBuildImage) {
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100139 inputDir = file(".")
140 dockerFile = file("src/main/docker/Dockerfile.jvm")
141 images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
142}
143
144buildDocker.dependsOn quarkusBuild
145assemble.dependsOn buildDocker
146
Matthias Andreas Benkard02e10f12020-02-02 18:46:56 +0100147task pushDocker(type: DockerPushImage) {
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +0100148 images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
149}
150
151pushDocker.dependsOn buildDocker