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 b1123d8 commit 484544c
Show file tree
Hide file tree
Showing 3 changed files with 26 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`

## [1.0.0] - 2023-12-22

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

dependencies {
implementation(libs.jsr305)
api(libs.jsr305)

spotbugsPlugins(libs.spotbugsContrib)
}
Expand All @@ -54,6 +55,16 @@ spotbugs {
excludeFilter = file("dev/spotbugs/suppressions.xml")
}

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 @@ -84,6 +95,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 @@ -5,6 +5,7 @@ checkstyle = "10.12.5"
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 484544c

Please sign in to comment.