-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
152 lines (136 loc) · 4.53 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
plugins {
id("groovy")
id("java-gradle-plugin")
id("java-test-fixtures")
id("jvm-test-suite")
`kotlin-dsl`
alias(libs.plugins.kotlin)
alias(libs.plugins.pluginPublish)
alias(libs.plugins.asciidoctor)
alias(libs.plugins.gitPublish)
}
group = "de.benediktritter"
description = "Gradle plugin for developing Apache Maven plugins"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
dependencies {
implementation(platform(libs.kotlin.bom))
implementation(libs.kotlin.stdlibJdk8)
api(platform(libs.mavenPluginTools.bom)) {
because("the version for other dependencies in api would be missing otherwise")
}
implementation(libs.mavenPluginTools.api)
implementation(libs.mavenPluginTools.annotations)
implementation(libs.mavenPluginTools.java)
implementation(libs.mavenPluginTools.generators)
api(libs.mavenPlugin.annotations) {
because("MavenMojo references types from this artifact")
}
implementation(libs.mavenPlugin.api)
implementation(libs.sisu.injectPlexus) {
because("it is needed to implement the plexus logging adapter")
}
implementation(libs.plexus.velocity) {
because("it is needed to generate the help mojo")
}
constraints {
implementation(libs.qdox) {
because("we need the fix for https://github.com/paul-hammant/qdox/issues/43")
}
}
testImplementation(libs.bundles.spock)
testImplementation(testFixtures(project))
testFixturesImplementation(libs.junit4)
testFixturesImplementation(libs.commonsLang)
}
testing.suites.register<JvmTestSuite>("testSamples") {
useJUnit()
dependencies {
implementation(gradleTestKit())
implementation(libs.exemplar.sampleCheck)
}
targets.all {
testTask.configure {
inputs.dir("src/docs/snippets")
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPropertyName("snippets")
}
}
}
tasks {
test {
useJUnitPlatform()
}
jar {
from(rootProject.file("LICENSE.txt")) {
into("META-INF")
}
}
asciidoctor {
inputs.dir("src/docs/snippets")
.withPathSensitivity(PathSensitivity.RELATIVE)
.withPropertyName("snippets")
outputOptions {
separateOutputDirs = false
}
attributes(mapOf(
"docinfodir" to "src/docs/asciidoc",
"docinfo" to "shared",
"source-highlighter" to "prettify",
"tabsize" to "4",
"toc" to "left",
"icons" to "font",
"sectanchors" to true,
"idprefix" to "",
"idseparator" to "-",
"gh-issue" to "https://github.com/britter/maven-plugin-development/issues/",
"gh-pr" to "https://github.com/britter/maven-plugin-development/pull/",
"snippets-path" to "$projectDir/src/docs/snippets"
))
}
register("release") {
dependsOn("publishPlugins", ":gitPublishPush")
}
}
gradlePlugin {
website.set("https://britter.github.io/maven-plugin-development")
vcsUrl.set("https://github.com/britter/maven-plugin-development")
plugins.create("mavenPluginDevelopment") {
id = "de.benediktritter.maven-plugin-development"
displayName = "Maven plugin development plugin"
description = project.description
implementationClass = "de.benediktritter.maven.plugin.development.MavenPluginDevelopmentPlugin"
tags.set(listOf("maven", "mojo", "maven plugin"))
}
}
publishing {
publications.withType<MavenPublication>() {
pom {
description.set(project.description)
url.set("https://github.com/britter/maven-development-plugin")
licenses {
license {
name.set("Apache-2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
scm {
connection.set("scm:git:git://github.com/britter/maven-development-plugin.git")
developerConnection.set("scm:git:ssh://github.com/britter/maven-development-plugin.git")
url.set("https://github.com/britter/maven-development-plugin")
}
}
}
}
val asciidoctor by tasks.existing
gitPublish {
repoUri.set("https://github.com/britter/maven-plugin-development")
branch.set("gh-pages")
sign.set(false)
contents {
from(asciidoctor)
}
}