Skip to content

Commit

Permalink
Add templates for plugins for Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
mraible committed Mar 21, 2024
1 parent d5d9ba4 commit cb131ac
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generators/quarkus/__snapshots__/generator.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,12 @@ exports[`SubGenerator quarkus of quarkus JHipster blueprint > run with oauth2 an
"buildSrc/gradle/libs.versions.toml": {
"stateCleared": "modified",
},
"buildSrc/src/main/groovy/jhipster.code-quality-conventions.gradle": {
"stateCleared": "modified",
},
"buildSrc/src/main/groovy/jhipster.docker-conventions.gradle": {
"stateCleared": "modified",
},
"checkstyle.xml": {
"stateCleared": "modified",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<%#
Copyright 2013-2024 the original author or authors from the JHipster project.
This file is part of the JHipster project, see https://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-%>
plugins {
id "jacoco"
id "org.sonarqube"
id "com.diffplug.spotless"
id "com.github.andygoossens.gradle-modernizer-plugin"
id "io.spring.nohttp"
}

jacoco {
toolVersion = "${libs.versions.jacoco.get()}"
}

jacocoTestReport {
executionData tasks.withType(Test)
classDirectories.from = files(sourceSets.main.output.classesDirs)
sourceDirectories.from = files(sourceSets.main.java.srcDirs)

reports {
xml.required = true
}
}

file("sonar-project.properties").withReader {
Properties sonarProperties = new Properties()
sonarProperties.load(it)

sonarProperties.each { key, value ->
sonarqube {
properties {
property key, value
}
}
}
}

spotless {
java {
target 'src/*/java/**/*.java'
// removeUnusedImports()
}
}

modernizer {
failOnViolations = true
includeTestClasses = true
}

checkstyle {
toolVersion "${libs.versions.checkstyle.get()}"
configFile file("checkstyle.xml")
checkstyleTest.enabled = false
}

nohttp {
source.include "build.gradle", "README.md"
}

// workaround for https://github.com/checkstyle/checkstyle/issues/14123
configurations.checkstyle {
resolutionStrategy.capabilitiesResolution.withCapability("com.google.collections:google-collections") {
select("com.google.guava:guava:0")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<%#
Copyright 2013-2024 the original author or authors from the JHipster project.
This file is part of the JHipster project, see https://www.jhipster.tech/
for more information.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-%>
plugins {
id "com.google.cloud.tools.jib"
}

jib {
from {
image = "<%- dockerContainers.javaJre %>"
platforms {
platform {
architecture = "${findProperty('jibArchitecture') ?: 'amd64'}"
os = "linux"
}
}
}
to {
image = "<%= baseName.toLowerCase() %>:latest"
}
container {
entrypoint = ["bash", "-c", "/entrypoint.sh"]
ports = ["<%= serverPort %>"<% if (cacheProviderHazelcast) { %>, "5701/udp" <% } %>]
environment = [
<%_ if (cacheProviderInfinispan) { _%>
JAVA_OPTS: "-Djgroups.tcp.address=NON_LOOPBACK -Djava.net.preferIPv4Stack=true",
<%_ } _%>
SPRING_OUTPUT_ANSI_ENABLED: "ALWAYS",
JHIPSTER_SLEEP: "0"
]
creationTime = "USE_CURRENT_TIMESTAMP"
user = 1000
}
extraDirectories {
paths = file("<%= dockerServicesDir %>jib")
permissions = ["/entrypoint.sh": "755"]
}
}

0 comments on commit cb131ac

Please sign in to comment.