mirror of
https://github.com/fankes/unmeta-gradle-plugin.git
synced 2025-09-04 10:05:15 +08:00
Rename plugin directory to unmeta
Signed-off-by: You Qi <youqi@axzae.com>
This commit is contained in:
68
plugin-build/unmeta/build.gradle.kts
Normal file
68
plugin-build/unmeta/build.gradle.kts
Normal file
@@ -0,0 +1,68 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
signing
|
||||
kotlin("jvm")
|
||||
`java-gradle-plugin`
|
||||
alias(libs.plugins.pluginPublish)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
implementation(gradleApi())
|
||||
implementation(libs.asm)
|
||||
implementation(libs.androidGradlePlugin)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.truth)
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
signing {
|
||||
val signingKey = System.getenv("GPG_SIGNING_KEY")
|
||||
val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")
|
||||
useInMemoryPgpKeys(signingKey.chunked(64).joinToString("\n"), signingPassword)
|
||||
sign(tasks["jar"])
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
}
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
create(property("ID").toString()) {
|
||||
id = property("ID").toString()
|
||||
implementationClass = property("IMPLEMENTATION_CLASS").toString()
|
||||
version = property("VERSION").toString()
|
||||
description = property("DESCRIPTION").toString()
|
||||
displayName = property("DISPLAY_NAME").toString()
|
||||
tags.set(listOf("kotlin", "metadata"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
website.set(property("WEBSITE").toString())
|
||||
vcsUrl.set(property("VCS_URL").toString())
|
||||
}
|
||||
|
||||
tasks.create("setupPluginUploadFromEnvironment") {
|
||||
doLast {
|
||||
val key = System.getenv("GRADLE_PUBLISH_KEY")
|
||||
val secret = System.getenv("GRADLE_PUBLISH_SECRET")
|
||||
|
||||
if (key == null || secret == null) {
|
||||
throw GradleException("gradlePublishKey and/or gradlePublishSecret are not defined environment variables")
|
||||
}
|
||||
|
||||
System.setProperty("gradle.publish.key", key)
|
||||
System.setProperty("gradle.publish.secret", secret)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user