Skip to content

Commit 4a3ec08

Browse files
committed
Add sonar.
1 parent 3016890 commit 4a3ec08

File tree

3 files changed

+71
-25
lines changed

3 files changed

+71
-25
lines changed

.github/workflows/build.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: SonarCloud
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build and analyze
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: 21
20+
distribution: 'temurin'
21+
- name: Cache SonarCloud packages
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.sonar/cache
25+
key: ${{ runner.os }}-sonar
26+
restore-keys: ${{ runner.os }}-sonar
27+
- name: Cache Gradle packages
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.gradle/caches
31+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
32+
restore-keys: ${{ runner.os }}-gradle
33+
- name: Build and analyze
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
36+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37+
run: ./gradlew build sonar --info

Underilla-Core/build.gradle

-25
This file was deleted.

Underilla-Core/build.gradle.kts

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
plugins {
2+
`java-library`
3+
id("org.sonarqube") version "4.4.1.3373"
4+
}
5+
6+
group = "com.Jkantrell.mc"
7+
version = "1.5.1"
8+
java.sourceCompatibility = JavaVersion.VERSION_21
9+
10+
repositories {
11+
mavenCentral()
12+
mavenLocal()
13+
maven ("https://jitpack.io")
14+
}
15+
16+
17+
dependencies {
18+
// testImplementation platform("org.junit:junit-bom:5.9.1")
19+
// testImplementation("org.junit.jupiter:junit-jupiter")
20+
implementation("org.apache.commons:commons-lang3:3.12.0")
21+
api("com.jkantrell:KntNBT:2.2.2")
22+
}
23+
24+
tasks.test {
25+
useJUnitPlatform()
26+
}
27+
28+
sonar {
29+
properties {
30+
property("sonar.projectKey", "mvndicraft_underilla")
31+
property("sonar.organization", "mvndicraft")
32+
property("sonar.host.url", "https://sonarcloud.io")
33+
}
34+
}

0 commit comments

Comments
 (0)