Skip to content

Commit

Permalink
build.gradle -> build.gradle.kts (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredsburrows authored Jul 30, 2024
1 parent 4095b97 commit dcf7394
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ subprojects {
tasks.withType<Jar>().configureEach {
manifest {
attributes(
"Implementation-Title" to properties["POM_NAME"],
"Implementation-Version" to properties["VERSION_NAME"],
"Implementation-Title" to properties["POM_NAME"].toString(),
"Implementation-Version" to properties["VERSION_NAME"].toString(),
"Built-By" to System.getProperty("user.name"),
"Built-JDK" to System.getProperty("java.version"),
"Built-Gradle" to gradle.gradleVersion,
Expand Down
57 changes: 0 additions & 57 deletions gradle-versions-plugin/build.gradle

This file was deleted.

57 changes: 57 additions & 0 deletions gradle-versions-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.dokka)
alias(libs.plugins.ktlint)
alias(libs.plugins.plugin.publish)
alias(libs.plugins.versions)
id("maven-publish") // For publishing the plugin to mavenLocal()
`java-gradle-plugin`
`java-library`
groovy
}

group = properties["GROUP"].toString()
version = properties["VERSION_NAME"].toString()

// Write the plugin's classpath to a file to share with the tests
tasks.register("createClasspathManifest") {
val outputDir = layout.buildDirectory.dir(name).get().asFile

inputs.files(sourceSets.main.get().runtimeClasspath)
outputs.dir(outputDir)

doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").writeText(sourceSets.main.get().runtimeClasspath.joinToString("\n"))
}
}

dependencies {
compileOnly(gradleApi())

implementation(localGroovy())
implementation(platform(libs.kotlin.bom))
implementation(libs.kotlin.stdlib)
implementation(libs.okhttp)
implementation(libs.moshi)

testRuntimeOnly(files(tasks.named("createClasspathManifest")))

testImplementation(localGroovy())
testImplementation(gradleTestKit())
testImplementation(libs.spock) { exclude(module = "groovy-all") }
}

gradlePlugin {
website.set(properties["POM_URL"].toString())
vcsUrl.set(properties["POM_SCM_URL"].toString())
plugins {
create("versionsPlugin") {
id = properties["PLUGIN_NAME"].toString()
implementationClass = properties["PLUGIN_NAME_CLASS"].toString()
displayName = properties["POM_NAME"].toString()
description = properties["POM_DESCRIPTION"].toString()
tags.set(listOf("dependencies", "versions", "updates"))
}
}
}

0 comments on commit dcf7394

Please sign in to comment.