-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
125 lines (107 loc) · 3.44 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
115
116
117
118
119
120
121
122
123
124
125
import io.hndrs.gradle.plugin.Developer
import io.hndrs.gradle.plugin.License
import io.hndrs.gradle.plugin.Organization
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.sonarqube").version("4.0.0.2929")
`kotlin-dsl`
`maven-publish`
jacoco
signing
id("java-gradle-plugin")
id("com.gradle.plugin-publish").version("1.2.0")
kotlin("jvm")
idea
id("io.hndrs.publishing-info").version("3.1.0")
}
group = "io.hndrs.gradle"
version = "1.0.0"
repositories {
mavenCentral()
}
val tagList = listOf("git", "properties", "spring", "kotlin", "configuration-cache", "spring-boot")
gradlePlugin {
website.set("https://github.com/hndrs/gradle-git-properties-plugin")
vcsUrl.set("https://github.com/hndrs/gradle-git-properties-plugin.git")
plugins {
create("gitPropertiesPlugin") {
id = "io.hndrs.git-properties"
displayName = "Gradle git properties plugin"
implementationClass = "io.hndrs.gradle.plugin.git.properties.GitPropertiesPlugin"
description = "Generates Git properties and is compatible with gradles `configuration-cache`"
tags.set(tagList)
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
val signingKey: String? by project
val signingPassword: String? by project
if (signingKey != null && signingPassword != null) {
signing {
useInMemoryPgpKeys(groovy.json.StringEscapeUtils.unescapeJava(signingKey), signingPassword)
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
publishingInfo {
name = "Gradle git properties plugin"
description = "Simple Gradle Git Properties Plugin with gradle configuration-cache support"
inceptionYear = "2023"
url = "https://github.com/hndrs/gradle-git-properties-plugin"
license = License(
"https://github.com/hndrs/gradle-git-properties-plugin/blob/main/LICENSE",
"MIT License"
)
developers = listOf(
Developer("marvinschramm", "Marvin Schramm", "[email protected]")
)
organization = Organization("hndrs", "https://oss.hndrs.io")
scm = io.hndrs.gradle.plugin.Scm(
"scm:git:git://github.com/hndrs/gradle-git-properties-plugin",
"https://github.com/hndrs/gradle-git-properties-plugin"
)
}
dependencies {
implementation("org.eclipse.jgit:org.eclipse.jgit:6.5.0.202303070854-r")
testImplementation(gradleTestKit())
testImplementation(platform("org.junit:junit-bom:5.9.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation(platform("io.kotest:kotest-bom:5.6.2"))
testImplementation("io.kotest:kotest-runner-junit5")
testImplementation("io.kotest:kotest-assertions-core-jvm")
testImplementation("io.mockk:mockk:1.13.5")
}
sonarqube {
properties {
property("sonar.projectKey", "hndrs_gradle-git-properties-plugin")
property("sonar.organization", "hndrs")
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.exclusions", "**/example/**")
}
}
configure<JacocoPluginExtension> {
toolVersion = "0.8.9"
}
tasks.withType<JacocoReport> {
reports {
xml.apply {
this.required.set(true)
}
}
dependsOn(tasks.withType(Assemble::class.java))
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}