Skip to content

Commit 14a35c8

Browse files
authored
SONARGO-52 Create a new repository for common Gradle scripts (#1)
1 parent df112be commit 14a35c8

9 files changed

Lines changed: 516 additions & 0 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
/gradlew.bat text eol=crlf
3+
/gradlew text eol=lf

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# ---- Gradle
2+
build/
3+
.gradle
4+
.kotlin
5+
6+
# ---- Sonar Scanners
7+
.scannerwork
8+
.sonar
9+
10+
# ---- Mac OS X
11+
.DS_Store
12+
Icon?
13+
# Thumbnails
14+
._*
15+
# Files that might appear on external disk
16+
.Spotlight-V100
17+
.Trashes
18+
19+
# ---- Windows
20+
# Windows image file caches
21+
Thumbs.db
22+
# Folder config file
23+
Desktop.ini
24+
25+
# ---- IntelliJ IDEA
26+
*.iws
27+
*.iml
28+
*.ipr
29+
.idea/
30+
.run/

gradle-modules/build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* SonarSource Cloud Native Gradle Modules
3+
* Copyright (C) 2024-2024 SonarSource SA
4+
* mailto:info AT sonarsource DOT com
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
plugins {
21+
`kotlin-dsl`
22+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* SonarSource Cloud Native Gradle Modules
3+
* Copyright (C) 2024-2024 SonarSource SA
4+
* mailto:info AT sonarsource DOT com
5+
*
6+
* This program is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 3 of the License, or (at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License
17+
* along with this program; if not, write to the Free Software Foundation,
18+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19+
*/
20+
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
21+
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
22+
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED
23+
24+
plugins {
25+
`java-library`
26+
jacoco
27+
}
28+
29+
java {
30+
withSourcesJar()
31+
withJavadocJar()
32+
sourceCompatibility = JavaVersion.VERSION_17
33+
targetCompatibility = JavaVersion.VERSION_17
34+
}
35+
36+
tasks.withType<JavaCompile> {
37+
options.encoding = "UTF-8"
38+
}
39+
40+
tasks.withType<Javadoc> {
41+
options.encoding = "UTF-8"
42+
options {
43+
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
44+
}
45+
}
46+
47+
tasks.withType<Test> {
48+
useJUnitPlatform()
49+
50+
testLogging {
51+
// log the full stack trace (default is the 1st line of the stack trace)
52+
exceptionFormat = TestExceptionFormat.FULL
53+
// verbose log for failed and skipped tests (by default the name of the tests are not logged)
54+
events(SKIPPED, FAILED)
55+
}
56+
}
57+
58+
jacoco {
59+
toolVersion = "0.8.12"
60+
}
61+
62+
tasks.jacocoTestReport {
63+
dependsOn(tasks.test)
64+
reports {
65+
xml.required.set(true)
66+
csv.required.set(false)
67+
html.required.set(providers.environmentVariable("CI").map { it.toBoolean().not() }.orElse(true))
68+
}
69+
}
70+
71+
plugins.withType<JacocoPlugin> {
72+
tasks["test"].finalizedBy("jacocoTestReport")
73+
}

gradle/wrapper/gradle-wrapper.jar

42.6 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
5+
networkTimeout=10000
6+
validateDistributionUrl=true
7+
zipStoreBase=GRADLE_USER_HOME
8+
zipStorePath=wrapper/dists

gradlew

Lines changed: 252 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)