Skip to content

Commit

Permalink
jacoco sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
tangbo committed Mar 28, 2024
1 parent e846f70 commit c2cbb99
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
14 changes: 13 additions & 1 deletion gradle/basic.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
buildscript {
repositories {
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://repo.spring.io/plugins-snapshot' }
mavenCentral()
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
classpath "io.freefair.gradle:lombok-plugin:8.6"
classpath "me.qoomon:gradle-git-versioning-plugin:6.4.2"
classpath "name.remal.gradle-plugins.sonarlint:sonarlint:3.4.9"
}
}

apply plugin: "jacoco"
apply plugin: "com.diffplug.spotless"
apply plugin: "io.freefair.lombok"
apply plugin: "me.qoomon.git-versioning"
apply plugin: "name.remal.sonarlint"

group "io.ghrc"

Expand Down Expand Up @@ -92,4 +94,14 @@ repositories {
}
}
mavenCentral()
}


tasks.named("test") {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

tasks.register("name") {
logger.quiet(project.name)
}
12 changes: 5 additions & 7 deletions gradle/cloud.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
repositories {
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.spring.io/plugins-snapshot" }
mavenCentral()
}
Expand All @@ -11,6 +11,7 @@ buildscript {
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
classpath "me.qoomon:gradle-git-versioning-plugin:6.4.2"
classpath "io.freefair.gradle:lombok-plugin:8.6"
classpath "name.remal.gradle-plugins.sonarlint:sonarlint:3.4.9"
}
}

Expand All @@ -37,8 +38,6 @@ sourceCompatibility = 17
targetCompatibility = 17

gitVersioning.apply {
logging.captureStandardOutput LogLevel.
version = rootProject.findProperty("version")
refs {
branch("master") {
version = '${version}-${commit.short}'
Expand Down Expand Up @@ -79,8 +78,7 @@ allprojects {
apply plugin: "com.diffplug.spotless"
apply plugin: "io.freefair.lombok"
apply plugin: "me.qoomon.git-versioning"

group "io.ghrc"
apply plugin: "name.remal.sonarlint"

jacoco {
toolVersion = "0.8.11"
Expand All @@ -92,7 +90,7 @@ allprojects {
html.required = true
html.outputLocation = layout.buildDirectory.dir('reports/jacoco/html')
xml.required = true
xml.outputLocation = layout.buildDirectory.file("reports/reports.xml")
xml.outputLocation = layout.buildDirectory.file("reports/jacocoReports.xml")
}
}

Expand Down Expand Up @@ -132,7 +130,7 @@ allprojects {
}

tasks.register("name") {
println project.name
logger.quiet(project.name)
}

dependencyManagement {
Expand Down
10 changes: 8 additions & 2 deletions gradle/multi-library.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
buildscript {
repositories {
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://repo.spring.io/plugins-snapshot' }
mavenCentral()
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
classpath "io.freefair.gradle:lombok-plugin:8.6"
classpath "me.qoomon:gradle-git-versioning-plugin:6.4.2"
classpath "name.remal.gradle-plugins.sonarlint:sonarlint:3.4.9"
}
}

Expand Down Expand Up @@ -42,6 +43,7 @@ allprojects {
apply plugin: "com.diffplug.spotless"
apply plugin: "io.freefair.lombok"
apply plugin: "me.qoomon.git-versioning"
apply plugin: "name.remal.sonarlint"

group "io.ghrc"

Expand Down Expand Up @@ -103,7 +105,7 @@ subprojects {
html.required = true
html.outputLocation = layout.buildDirectory.dir('reports/jacoco/html')
xml.required = true
xml.outputLocation = layout.buildDirectory.file("reports/reports.xml")
xml.outputLocation = layout.buildDirectory.file("reports/jacocorReports.xml")
}
}

Expand All @@ -121,6 +123,10 @@ subprojects {
finalizedBy jacocoTestReport
}

tasks.register("name") {
logger.quiet(project.name)
}

dependencies {
// utils
implementation "com.google.guava:guava:${guavaVersion}"
Expand Down
10 changes: 7 additions & 3 deletions gradle/single-library.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
buildscript {
repositories {
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.spring.io/plugins-snapshot" }
mavenCentral()
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
classpath "io.freefair.gradle:lombok-plugin:8.6"
classpath "me.qoomon:gradle-git-versioning-plugin:6.4.2"
classpath "name.remal.gradle-plugins.sonarlint:sonarlint:3.4.9"
}
}

Expand All @@ -18,6 +19,7 @@ apply plugin: "maven-publish"
apply plugin: "com.diffplug.spotless"
apply plugin: "io.freefair.lombok"
apply plugin: "me.qoomon.git-versioning"
apply plugin: "name.remal.sonarlint"

group "io.ghrc"

Expand Down Expand Up @@ -104,7 +106,7 @@ jacocoTestReport {
html.required = true
html.outputLocation = layout.buildDirectory.dir('reports/jacoco/html')
xml.required = true
xml.outputLocation = layout.buildDirectory.file("reports/reports.xml")
xml.outputLocation = layout.buildDirectory.file("reports/jacocorReports.xml")
}
}

Expand All @@ -122,7 +124,9 @@ tasks.named("test") {
finalizedBy jacocoTestReport
}


tasks.register("name") {
logger.quiet(project.name)
}
publishing {
repositories {
maven {
Expand Down
2 changes: 1 addition & 1 deletion tests/gradle-cloud/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id "name.remal.sonarlint" version "3.4.9"
}

apply from: "./cloud.gradle"
apply from: "../../gradle/cloud.gradle"

repositories {
maven {
Expand Down

0 comments on commit c2cbb99

Please sign in to comment.