Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Apr 9, 2022
1 parent 2f75873 commit 38e7174
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
20 changes: 7 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
alias(libs.plugins.githubRelease)
}

val isKotlinDev = project.hasProperty("isKotlinDev")
val isKotlinDev: Boolean = project.hasProperty("isKotlinDev")

allprojects {
if (isKotlinDev) {
Expand Down Expand Up @@ -50,8 +50,8 @@ val githubToken: String = if (project.hasProperty("servers.github.privKey")) {
""
}

val shadowJarExecutable: TaskProvider<Task> by lazy {
projects.ktlint.dependencyProject.tasks.named("shadowJarExecutable")
val shadowJarExecutable: Task by lazy {
projects.ktlint.dependencyProject.tasks["shadowJarExecutable"]
}

// Explicitly adding dependency on "shadowJarExecutable" as Gradle does not it set via "releaseAssets" property
Expand All @@ -71,13 +71,7 @@ githubRelease {
// "shadowJarExecutableChecksum" task does not declare checksum files
// as output, only the whole output directory. As it uses the same directory
// as "shadowJarExecutable" - just pass all the files from that directory
projects.ktlint.dependencyProject.tasks.named("shadowJarExecutable").get()
.outputs
.files
.files
.first()
.parentFile
.listFiles()
shadowJarExecutable.outputs.files.files.first().parentFile.listFiles()
}))
overwrite(true)
dryRun(false)
Expand All @@ -94,7 +88,7 @@ val announceRelease by tasks.registering(Exec::class) {
group = "Help"
description = "Runs .announce script"
subprojects.filter { !it.name.contains("ktlint-ruleset-template") }.forEach { subproject ->
dependsOn(subproject.tasks.named("publishMavenPublicationToMavenCentralRepository"))
dependsOn(subproject.tasks["publishMavenPublicationToMavenCentralRepository"])
}

commandLine("./.announce", "-y")
Expand All @@ -107,13 +101,13 @@ val homebrewBumpFormula by tasks.registering(Exec::class) {
description = "Runs brew bump-forumula-pr"
commandLine("./.homebrew")
environment("VERSION" to "${project.property("VERSION_NAME")}")
dependsOn(tasks.named("githubRelease"))
dependsOn(tasks.githubRelease)
}

tasks.register<DefaultTask>("publishNewRelease") {
group = "Help"
description = "Triggers uploading new archives and publish announcements"
dependsOn(announceRelease, homebrewBumpFormula, tasks.named("githubRelease"))
dependsOn(announceRelease, homebrewBumpFormula, tasks.githubRelease)
}

tasks.wrapper {
Expand Down
5 changes: 2 additions & 3 deletions buildSrc/src/main/kotlin/ktlint-kotlin-common.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.jetbrains.kotlin.jvm")
kotlin("jvm")
}

repositories {
Expand All @@ -19,8 +19,7 @@ kotlin {
}
}

tasks
.withType<KotlinCompile>()
tasks.withType<KotlinCompile>()
.configureEach {
kotlinOptions {
apiVersion = "1.4"
Expand Down
26 changes: 13 additions & 13 deletions buildSrc/src/main/kotlin/ktlint-publication.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ project.group = project.property("GROUP")
publishing {
publications {
create<MavenPublication>("maven") {
groupId = project.property("GROUP") as String?
artifactId = project.property("POM_ARTIFACT_ID") as String?
version = project.property("VERSION_NAME") as String?
groupId = project.property("GROUP").toString()
artifactId = project.property("POM_ARTIFACT_ID").toString()
version = project.property("VERSION_NAME").toString()

pom {
name.set(project.property("POM_NAME") as String?)
description.set(project.property("POM_DESCRIPTION") as String?)
url.set(project.property("POM_URL") as String?)
name.set(project.property("POM_NAME").toString())
description.set(project.property("POM_DESCRIPTION").toString())
url.set(project.property("POM_URL").toString())
licenses {
license {
name.set(project.property("POM_LICENSE_NAME") as String?)
url.set(project.property("POM_LICENSE_URL") as String?)
name.set(project.property("POM_LICENSE_NAME").toString())
url.set(project.property("POM_LICENSE_URL").toString())
distribution.set("repo")
}
}
developers {
developer {
id.set(project.property("POM_DEVELOPER_ID") as String?)
name.set(project.property("POM_DEVELOPER_NAME") as String?)
id.set(project.property("POM_DEVELOPER_ID").toString())
name.set(project.property("POM_DEVELOPER_NAME").toString())
}
}
scm {
url.set(project.property("POM_SCM_URL") as String?)
connection.set(project.property("POM_SCM_CONNECTION") as String?)
developerConnection.set(project.property("POM_SCM_DEV_CONNECTION") as String?)
url.set(project.property("POM_SCM_URL").toString())
connection.set(project.property("POM_SCM_CONNECTION").toString())
developerConnection.set(project.property("POM_SCM_DEV_CONNECTION").toString())
}
}

Expand Down

0 comments on commit 38e7174

Please sign in to comment.