Skip to content

Commit

Permalink
Supported release to plugins.gradle.org (#1789)
Browse files Browse the repository at this point in the history
- supported release to gradle
  • Loading branch information
nulls authored Nov 10, 2023
1 parent 63018da commit 55cd6f5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 19 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/diktat_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ jobs:
mv gradle/libs.versions.toml gradle/libs.versions.toml_current
mv build/diktat-snapshot/libs.versions.toml gradle/libs.versions.toml
mv gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.kts gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.kts_current
mv build/diktat-snapshot/diktat-convention-configuration.gradle.kts gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.kts
# copied from .github/workflows/diktat.yml
- uses: gradle/gradle-build-action@v2
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ jobs:
publishToSonatype
closeAndReleaseSonatypeStagingRepository
- name: 'Publish a release to Gradle Plugins'
id: publish-sonatype
uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: |
:diktat-gradle-plugin:publishPlugins
-Pgradle.publish.key=${{ secrets.GRADLE_KEY }}
-Pgradle.publish.secret=${{ secrets.GRADLE_SECRET }}
github_release:
needs: release
name: 'Github Release'
Expand Down
14 changes: 0 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ tasks.create("generateLibsForDiktatSnapshot") {
dependsOn(dependencies.map { "${it.path}:publishToMavenLocal" })

val libsFile = rootProject.file("gradle/libs.versions.toml")
val diktatGradleFile = rootProject.file("gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.kts")

inputs.file(libsFile)
inputs.file(diktatGradleFile)
inputs.files(dependencies.map { it.pomFile() })
inputs.files(dependencies.map { it.artifactFile() })
inputs.property("project-version", version.toString())
Expand All @@ -68,18 +66,6 @@ tasks.create("generateLibsForDiktatSnapshot") {
Files.write(libsFileForDiktatSnapshot.toPath(), it)
}

Files.readAllLines(diktatGradleFile.toPath())
.map { line ->
when {
line.contains("com.saveourtool.diktat.diktat-gradle-plugin") -> line.replace("com.saveourtool.diktat.diktat-gradle-plugin", "com.saveourtool.diktat")
else -> line
}
}
.let {
val diktatGradleFileForDiktatSnapshot = dir.resolve("diktat-convention-configuration.gradle.kts")
Files.write(diktatGradleFileForDiktatSnapshot.toPath(), it)
}

dependencies.forEach { dependency ->
val artifactDir = dir.pathToMavenArtifact(dependency)
.also { it.createDirectory() }
Expand Down
3 changes: 3 additions & 0 deletions diktat-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ gradlePlugin {
plugins {
create("diktatPlugin") {
id = "com.saveourtool.diktat"
displayName = "Static code analysis for Kotlin"
description = "Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs"
tags = listOf("kotlin", "code-analysis")
implementationClass = "com.saveourtool.diktat.plugin.gradle.DiktatGradlePlugin"
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gradle-shadow = "8.1.1"
jetbrains-annotations = "24.0.1"
kotlinx-coroutines = "1.7.3"
assertj = "3.24.2"
diktat = "1.3.0-SNAPSHOT"
diktat = "2.0.0-rc.6"
reckon = "0.18.1"
spotless = "6.22.0"
download = "5.5.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.saveourtool.diktat.buildutils

plugins {
id("com.saveourtool.diktat.diktat-gradle-plugin")
id("com.saveourtool.diktat")
}

diktat {
Expand Down

0 comments on commit 55cd6f5

Please sign in to comment.