@@ -5,13 +5,18 @@ import com.gradle.publish.PublishTask.GRADLE_PUBLISH_SECRET_ENV
55
66plugins {
77 id(" groovy" )
8- id(" org.jetbrains.kotlin.jvm" ) version " 1.8.20"
8+ id(" org.jetbrains.kotlin.jvm" ) version " 1.8.10"
9+
910 id(" io.gitlab.arturbosch.detekt" ) version " 1.22.0"
10- id(" com.gradle.plugin-publish" ) version " 1.2.0"
1111 id(" java-gradle-plugin" )
12+ id(" com.autonomousapps.dependency-analysis" ) version " 1.20.0"
13+
14+ id(" com.gradle.plugin-publish" ) version " 1.2.0"
1215}
1316
1417val setupPluginUpload by tasks.registering {
18+ if (System .getenv(" GITHUB_ACTION" ) == null ) return @registering
19+
1520 val key = System .getenv(GRADLE_PUBLISH_KEY_ENV ) ? : System .getProperty(GRADLE_PUBLISH_KEY )
1621 val secret = System .getenv(GRADLE_PUBLISH_SECRET_ENV ) ? : System .getProperty(GRADLE_PUBLISH_SECRET )
1722
@@ -23,8 +28,8 @@ val setupPluginUpload by tasks.registering {
2328 System .setProperty(GRADLE_PUBLISH_SECRET , secret)
2429
2530 // This is the git tag for a release
26- val githubRefName = System .getenv(" GITHUB_REF_NAME" )
27- version = githubRefName
31+ val githubRefName = System .getenv(" GITHUB_REF_NAME" )?.trimStart( ' v ' )
32+ version = checkNotNull( githubRefName) { " No GITHUB_REF_NAME env value defined " }
2833}
2934
3035tasks.named(" publishPlugins" ) {
@@ -58,18 +63,23 @@ repositories {
5863
5964dependencies {
6065 api(gradleApi())
61- api(localGroovy())
62-
63- api(" org.assertj:assertj-core:3.24.2" )
66+ api(" com.google.code.findbugs:jsr305:3.0.2" )
6467 api(" org.assertj:assertj-assertions-generator:2.2.1" )
6568
6669 implementation(gradleKotlinDsl())
6770 implementation(" com.google.guava:guava:31.1-jre" )
6871
72+ testApi(" junit:junit:4.13.2" )
73+
6974 testCompileOnly(" org.jetbrains:annotations:24.0.1" )
7075
76+ testImplementation(localGroovy())
7177 testImplementation(gradleTestKit())
72- testImplementation(" junit:junit:4.13.2" )
78+ testImplementation(" org.assertj:assertj-core:3.24.2" )
79+ }
80+
81+ tasks.check {
82+ dependsOn(tasks.named(" projectHealth" ))
7383}
7484
7585tasks.compileGroovy {
0 commit comments