Skip to content

Commit

Permalink
Add dependency analysis plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
baron1405 committed Mar 2, 2024
1 parent 0efeeee commit 1eb9e2f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

### Added

- [Dependency analysis Gradle plugin](https://github.com/autonomousapps/dependency-analysis-gradle-plugin)
- The `check` task now depends on the `buildHealth` task and will fail the build on health violations

### Changed

- Changed JSR-305 dependency from `implementation` to `api`

## [2.0.1] - 2023-12-23

### Added
Expand Down
18 changes: 17 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
jacoco
`maven-publish`
signing
alias(libs.plugins.dependencyAnalysis)
alias(libs.plugins.spotbugs)
alias(libs.plugins.versions)
}
Expand All @@ -33,8 +34,9 @@ java {
}

dependencies {
api(libs.jsr305)

implementation(libs.cthingAnnots)
implementation(libs.jsr305)

testImplementation(libs.junitApi)
testImplementation(libs.junitParams)
Expand Down Expand Up @@ -68,6 +70,16 @@ jacoco {
toolVersion = libs.versions.jacoco.get()
}

dependencyAnalysis {
issues {
all {
onAny {
severity("fail")
}
}
}
}

fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
Expand Down Expand Up @@ -99,6 +111,10 @@ tasks {
}
}

check {
dependsOn(buildHealth)
}

spotbugsMain {
reports.create("html").required = true
}
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ junit = "5.10.2"
spotbugs = "4.8.3"

[plugins]
dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "1.30.0" }
spotbugs = { id = "com.github.spotbugs", version = "6.0.7" }
versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }

Expand Down

0 comments on commit 1eb9e2f

Please sign in to comment.