-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
59 lines (49 loc) · 1.54 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
59 lines (49 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("jvm")
`java-gradle-plugin`
alias(libs.plugins.pluginPublish)
}
kotlin {
compilerOptions { jvmTarget = JvmTarget.JVM_17 }
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
gradlePlugin {
website = property("WEBSITE").toString()
vcsUrl = property("VCS_URL").toString()
plugins {
create(property("ID").toString()) {
id = property("ID").toString()
implementationClass = property("IMPLEMENTATION_CLASS").toString()
version = projectVersioning.versions.name.get()
displayName = property("DISPLAY_NAME").toString()
description = property("DESCRIPTION").toString()
tags = listOf(
"CalVer",
"Versioning",
"Git",
"Automation"
)
}
}
}
dependencies {
implementation(kotlin("stdlib"))
implementation(gradleApi())
implementation(libs.toml)
testImplementation(libs.junit)
}
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)
}
}