Matthias Andreas Benkard | 02e10f1 | 2020-02-02 18:46:56 +0100 | [diff] [blame] | 1 | import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage |
| 2 | import com.bmuschko.gradle.docker.tasks.image.DockerPushImage |
| 3 | |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 4 | plugins { |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 5 | id 'java' |
| 6 | id 'io.quarkus' |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 7 | id "com.bmuschko.docker-remote-api" version "${dockerPluginVersion}" |
Matthias Andreas Benkard | f611d9e | 2020-01-13 05:04:52 +0100 | [diff] [blame] | 8 | 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 Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 11 | } |
| 12 | |
Matthias Andreas Benkard | 513deee | 2020-01-12 20:58:56 +0100 | [diff] [blame] | 13 | sourceCompatibility = 11 |
| 14 | targetCompatibility = 11 |
| 15 | |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 16 | repositories { |
| 17 | mavenLocal() |
| 18 | mavenCentral() |
| 19 | } |
| 20 | |
Matthias Andreas Benkard | f611d9e | 2020-01-13 05:04:52 +0100 | [diff] [blame] | 21 | tasks { |
| 22 | dependencyUpdates { |
| 23 | checkConstraints = true |
| 24 | gradleReleaseChannel = "current" |
| 25 | revision = "release" |
| 26 | } |
| 27 | } |
| 28 | |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 29 | dependencies { |
| 30 | implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") |
| 31 | |
| 32 | implementation 'io.quarkus:quarkus-agroal' |
Matthias Andreas Benkard | c27d1cb | 2020-01-26 11:11:24 +0100 | [diff] [blame] | 33 | implementation 'io.quarkus:quarkus-elytron-security-properties-file' |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 34 | 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 Benkard | 84db379 | 2020-03-15 12:48:29 +0100 | [diff] [blame] | 38 | //implementation 'io.quarkus:quarkus-kubernetes' |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 39 | implementation 'io.quarkus:quarkus-mailer' |
Matthias Andreas Benkard | 24a2514 | 2020-01-24 13:25:54 +0100 | [diff] [blame] | 40 | implementation 'io.quarkus:quarkus-oidc' |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 41 | implementation 'io.quarkus:quarkus-resteasy' |
| 42 | implementation 'io.quarkus:quarkus-resteasy-jsonb' |
| 43 | implementation 'io.quarkus:quarkus-resteasy-qute' |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 44 | implementation 'io.quarkus:quarkus-scheduler' |
Matthias Andreas Benkard | 2a1383f | 2020-02-01 23:53:17 +0100 | [diff] [blame] | 45 | implementation 'io.quarkus:quarkus-smallrye-jwt' |
Matthias Andreas Benkard | e5f81e5 | 2020-01-18 12:48:40 +0100 | [diff] [blame] | 46 | |
| 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 Benkard | e5f81e5 | 2020-01-18 12:48:40 +0100 | [diff] [blame] | 51 | //implementation 'io.quarkus:quarkus-quartz' |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 52 | //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 Benkard | 2a1383f | 2020-02-01 23:53:17 +0100 | [diff] [blame] | 61 | implementation "org.bitbucket.b_c:jose4j" |
| 62 | |
Matthias Andreas Benkard | 5d71a9e | 2020-01-18 12:31:26 +0100 | [diff] [blame] | 63 | implementation 'org.mapstruct:mapstruct' |
| 64 | compileOnly 'org.mapstruct:mapstruct-processor' |
| 65 | |
| 66 | compileOnly 'com.google.code.findbugs:jsr305' |
| 67 | |
Matthias Andreas Benkard | f611d9e | 2020-01-13 05:04:52 +0100 | [diff] [blame] | 68 | implementation 'com.vladmihalcea:hibernate-types-52' |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 69 | |
Matthias Andreas Benkard | 5d71a9e | 2020-01-18 12:31:26 +0100 | [diff] [blame] | 70 | implementation "jakarta.security.jacc:jakarta.security.jacc-api" |
| 71 | implementation "net.java.dev.jna:jna" |
| 72 | |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 73 | testImplementation 'io.quarkus:quarkus-junit5' |
| 74 | testImplementation 'io.rest-assured:rest-assured' |
Matthias Andreas Benkard | f611d9e | 2020-01-13 05:04:52 +0100 | [diff] [blame] | 75 | |
Matthias Andreas Benkard | 981f279 | 2020-02-16 14:54:54 +0100 | [diff] [blame] | 76 | implementation "com.rometools:rome" |
Matthias Andreas Benkard | 424e16e | 2020-02-09 18:29:56 +0100 | [diff] [blame] | 77 | implementation "com.vladsch.flexmark:flexmark-all" |
Matthias Andreas Benkard | 981f279 | 2020-02-16 14:54:54 +0100 | [diff] [blame] | 78 | implementation "org.jsoup:jsoup" |
Matthias Andreas Benkard | 424e16e | 2020-02-09 18:29:56 +0100 | [diff] [blame] | 79 | |
Matthias Andreas Benkard | 404ac1d | 2020-02-22 11:29:37 +0100 | [diff] [blame] | 80 | annotationProcessor "org.hibernate:hibernate-jpamodelgen" |
| 81 | |
Matthias Andreas Benkard | f611d9e | 2020-01-13 05:04:52 +0100 | [diff] [blame] | 82 | constraints { |
Matthias Andreas Benkard | f611d9e | 2020-01-13 05:04:52 +0100 | [diff] [blame] | 83 | implementation "com.vladmihalcea:hibernate-types-52:${hibernateTypesVersion}" |
Matthias Andreas Benkard | 5d71a9e | 2020-01-18 12:31:26 +0100 | [diff] [blame] | 84 | implementation "org.mapstruct:mapstruct:${mapstructVersion}" |
| 85 | compileOnly "org.mapstruct:mapstruct-processor:${mapstructVersion}" |
| 86 | compileOnly "com.google.code.findbugs:jsr305:${findbugsJsr305Version}" |
| 87 | implementation "jakarta.security.jacc:jakarta.security.jacc-api:${jakartaJaccVersion}" |
| 88 | implementation "net.java.dev.jna:jna:${jnaVersion}" |
Matthias Andreas Benkard | 2a1383f | 2020-02-01 23:53:17 +0100 | [diff] [blame] | 89 | implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}" |
Matthias Andreas Benkard | 424e16e | 2020-02-09 18:29:56 +0100 | [diff] [blame] | 90 | implementation "com.vladsch.flexmark:flexmark-all:${flexmarkVersion}" |
Matthias Andreas Benkard | 0684956 | 2020-02-14 20:13:17 +0100 | [diff] [blame] | 91 | implementation "org.jsoup:jsoup:${jsoupVersion}" |
Matthias Andreas Benkard | 981f279 | 2020-02-16 14:54:54 +0100 | [diff] [blame] | 92 | implementation "com.rometools:rome:${romeVersion}" |
Matthias Andreas Benkard | 404ac1d | 2020-02-22 11:29:37 +0100 | [diff] [blame] | 93 | annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}" |
Matthias Andreas Benkard | f611d9e | 2020-01-13 05:04:52 +0100 | [diff] [blame] | 94 | } |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | spotless { |
Matthias Andreas Benkard | 4be112f | 2020-01-12 20:29:38 +0100 | [diff] [blame] | 98 | java { |
| 99 | googleJavaFormat() |
| 100 | removeUnusedImports() |
| 101 | } |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 102 | } |
| 103 | |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 104 | group "eu.mulk" |
| 105 | version "${projectVersion}" |
Matthias Andreas Benkard | 2a10755 | 2020-01-23 10:47:52 +0100 | [diff] [blame] | 106 | |
| 107 | task yarnInstall(type:Exec) { |
Matthias Andreas Benkard | 02e10f1 | 2020-02-02 18:46:56 +0100 | [diff] [blame] | 108 | def resourceDir = "src/main/resources/META-INF/resources" |
| 109 | |
Matthias Andreas Benkard | c52eb74 | 2020-02-02 19:06:54 +0100 | [diff] [blame] | 110 | onlyIf { !project.hasProperty('skipWeb') } |
| 111 | |
Matthias Andreas Benkard | 02e10f1 | 2020-02-02 18:46:56 +0100 | [diff] [blame] | 112 | inputs.file "${resourceDir}/package.json" |
| 113 | outputs.dir "${resourceDir}/node_modules" |
| 114 | outputs.file "${resourceDir}/yarn.lock" |
| 115 | |
| 116 | workingDir resourceDir |
Matthias Andreas Benkard | 2a10755 | 2020-01-23 10:47:52 +0100 | [diff] [blame] | 117 | commandLine "yarn", "install" |
| 118 | } |
| 119 | |
| 120 | task snowpack(type:Exec) { |
Matthias Andreas Benkard | 02e10f1 | 2020-02-02 18:46:56 +0100 | [diff] [blame] | 121 | def resourceDir = "src/main/resources/META-INF/resources" |
| 122 | |
Matthias Andreas Benkard | c52eb74 | 2020-02-02 19:06:54 +0100 | [diff] [blame] | 123 | onlyIf { !project.hasProperty('skipWeb') } |
| 124 | |
Matthias Andreas Benkard | 2a10755 | 2020-01-23 10:47:52 +0100 | [diff] [blame] | 125 | dependsOn yarnInstall |
| 126 | |
Matthias Andreas Benkard | 02e10f1 | 2020-02-02 18:46:56 +0100 | [diff] [blame] | 127 | inputs.dir "${resourceDir}/node_modules" |
| 128 | inputs.file "${resourceDir}/yarn.lock" |
| 129 | inputs.file "${resourceDir}/package.json" |
| 130 | outputs.dir "${resourceDir}/web_modules" |
| 131 | |
| 132 | workingDir resourceDir |
Matthias Andreas Benkard | 96a28ef | 2020-02-15 18:39:51 +0100 | [diff] [blame] | 133 | commandLine "yarn", "run", "snowpack", "--optimize" |
Matthias Andreas Benkard | 2a10755 | 2020-01-23 10:47:52 +0100 | [diff] [blame] | 134 | } |
| 135 | |
Matthias Andreas Benkard | b3a2c48 | 2020-02-15 20:40:30 +0100 | [diff] [blame] | 136 | task flow(type:Exec) { |
| 137 | def resourceDir = "src/main/resources/META-INF/resources" |
| 138 | |
| 139 | onlyIf { !project.hasProperty('skipWeb') } |
| 140 | |
| 141 | dependsOn snowpack |
| 142 | |
| 143 | workingDir resourceDir |
| 144 | commandLine "yarn", "run", "flow", "--color=always" |
| 145 | } |
| 146 | |
Matthias Andreas Benkard | e5f071f | 2020-02-15 21:33:55 +0100 | [diff] [blame] | 147 | task eslint(type:Exec) { |
| 148 | def resourceDir = "src/main/resources/META-INF/resources" |
| 149 | |
| 150 | onlyIf { !project.hasProperty('skipWeb') } |
| 151 | |
| 152 | dependsOn snowpack |
| 153 | |
| 154 | workingDir resourceDir |
| 155 | commandLine "yarn", "run", "eslint", "cms2", "bookmarks", "--color" |
| 156 | } |
| 157 | |
Matthias Andreas Benkard | 2a10755 | 2020-01-23 10:47:52 +0100 | [diff] [blame] | 158 | task compileWeb { |
| 159 | dependsOn snowpack |
Matthias Andreas Benkard | b3a2c48 | 2020-02-15 20:40:30 +0100 | [diff] [blame] | 160 | dependsOn flow |
Matthias Andreas Benkard | e5f071f | 2020-02-15 21:33:55 +0100 | [diff] [blame] | 161 | dependsOn eslint |
Matthias Andreas Benkard | 2a10755 | 2020-01-23 10:47:52 +0100 | [diff] [blame] | 162 | |
| 163 | doLast {} |
| 164 | } |
| 165 | |
Matthias Andreas Benkard | b712a01 | 2020-01-26 08:10:49 +0100 | [diff] [blame] | 166 | processResources { |
| 167 | exclude("META-INF/resources/node_modules/**/*") |
Matthias Andreas Benkard | 97130f9 | 2020-01-27 21:03:39 +0100 | [diff] [blame] | 168 | exclude("META-INF/resources/package.json") |
| 169 | exclude("META-INF/resources/yarn.lock") |
Matthias Andreas Benkard | b712a01 | 2020-01-26 08:10:49 +0100 | [diff] [blame] | 170 | } |
| 171 | |
Matthias Andreas Benkard | b428e52 | 2020-01-26 08:13:04 +0100 | [diff] [blame] | 172 | quarkusBuild.dependsOn compileWeb |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 173 | |
Matthias Andreas Benkard | 02e10f1 | 2020-02-02 18:46:56 +0100 | [diff] [blame] | 174 | task buildDocker(type: DockerBuildImage) { |
Matthias Andreas Benkard | c52eb74 | 2020-02-02 19:06:54 +0100 | [diff] [blame] | 175 | onlyIf { !project.hasProperty('skipDocker') } |
| 176 | |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 177 | inputDir = file(".") |
| 178 | dockerFile = file("src/main/docker/Dockerfile.jvm") |
| 179 | images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}") |
| 180 | } |
| 181 | |
| 182 | buildDocker.dependsOn quarkusBuild |
| 183 | assemble.dependsOn buildDocker |
| 184 | |
Matthias Andreas Benkard | 02e10f1 | 2020-02-02 18:46:56 +0100 | [diff] [blame] | 185 | task pushDocker(type: DockerPushImage) { |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 186 | images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}") |
| 187 | } |
| 188 | |
| 189 | pushDocker.dependsOn buildDocker |