-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add templates for plugins for Gradle
- Loading branch information
Showing
3 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...s/quarkus/templates/buildSrc/src/main/groovy/jhipster.code-quality-conventions.gradle.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
generators/quarkus/templates/buildSrc/src/main/groovy/jhipster.docker-conventions.gradle.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} | ||
} |