-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
114 lines (103 loc) · 3.42 KB
/
build.gradle.kts
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
`java-gradle-plugin`
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.qa)
alias(libs.plugins.publishOnCentral)
alias(libs.plugins.gitSemanticVersioning)
alias(libs.plugins.gradlePluginPublish)
alias(libs.plugins.multiJvmTesting)
}
group = "io.github.tassiluca"
inner class ProjectInfo {
val repoOwner = "tassiluca"
val longName = "Gradle Scala Extras Plugin"
val description = "A plugin to enhance the Scala gradle core plugin with quality assurance tools"
val website = "https://github.com/$repoOwner/$name"
val vcsUrl = "$website.git"
val scm = "scm:git:$website.git"
val pluginImplementationClass = "$group.scalaextras.ScalaExtrasPlugin"
val tags = listOf("scala", "qa", "quality assurance", "static analysis")
}
val projectInfo = ProjectInfo()
repositories {
gradlePluginPortal()
mavenCentral()
}
multiJvm {
/* By default, compile with Java 8 and test with the supported LTS versions and the latest. */
maximumSupportedJvmVersion.set(latestJavaSupportedByGradle)
}
dependencies {
api(gradleApi())
api(gradleKotlinDsl())
implementation(kotlin("stdlib-jdk8"))
implementation(libs.gradle.scalafmt)
implementation(libs.gradle.scalafix)
testImplementation(gradleTestKit())
testImplementation(libs.bundles.kotlin.testing)
testImplementation(libs.gradle.plugins.testkit)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
testLogging {
showCauses = true
showStackTraces = true
showStandardStreams = true
events(*TestLogEvent.values())
exceptionFormat = TestExceptionFormat.FULL
}
}
gitSemVer {
/* The Gradle plugin portal does not support versions with a "+" symbol. */
buildMetadataSeparator = "-"
}
/* Publication on Maven Central and the Plugin portal */
signing {
if (System.getenv()["CI"].equals("true", ignoreCase = true)) {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
}
}
gradlePlugin {
plugins {
website = projectInfo.website
vcsUrl = projectInfo.vcsUrl
create("") {
id = "${project.group}.${project.name}"
displayName = projectInfo.longName
description = projectInfo.description
implementationClass = projectInfo.pluginImplementationClass
tags = projectInfo.tags
}
}
}
publishOnCentral {
projectLongName = projectInfo.longName
projectDescription = projectInfo.description
projectUrl = projectInfo.website
scmConnection = projectInfo.scm
licenseName = "Apache License, Version 2.0"
licenseUrl = "https://www.apache.org/licenses/LICENSE-2.0"
repoOwner = projectInfo.repoOwner
repository("https://maven.pkg.github.com/${projectInfo.repoOwner}/$name", "GitHub") {
user = repoOwner
password = System.getenv("GITHUB_TOKEN")
}
publishing {
publications {
withType<MavenPublication> {
pom {
developers {
developer {
name = "Luca Tassinari"
email = "[email protected]"
}
}
}
}
}
}
}