-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle.kts
130 lines (118 loc) · 4.02 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
plugins {
id("groovy")
id("java-gradle-plugin")
id("java-test-fixtures")
id("jvm-test-suite")
id("org.asciidoctor.jvm.convert") version "4.0.4"
id("org.gradlex.internal.plugin-publish-conventions") version "0.6"
}
group = "org.gradlex"
version = "1.1"
java {
toolchain.languageVersion = JavaLanguageVersion.of(8)
}
dependencies {
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")
}
}
testFixturesImplementation(libs.junit4)
testFixturesImplementation(libs.commonsLang)
}
pluginPublishConventions {
id("${project.group}.${project.name}")
implementationClass("org.gradlex.maven.plugin.development.MavenPluginDevelopmentPlugin")
displayName("Maven Plugin Development Gradle Plugin")
description("Gradle plugin for developing Apache Maven plugins.")
tags("gradlex", "maven", "mojo", "maven plugin")
gitHub("https://github.com/gradlex-org/maven-plugin-development")
website("https://gradlex.org/maven-plugin-development")
developer {
id = "britter"
name = "Benedikt Ritter"
email = "benedikt@gradlex.org"
}
}
// Required to write localRepository property to src/test/resources/test.properties for takari-plugin-testing used in MavenEndToEndFuncTest
tasks.processTestResources {
expand("localRepository" to project.layout.buildDirectory.dir("mavenLocal").get().asFile)
}
testing.suites.named<JvmTestSuite>("test") {
useSpock()
dependencies {
implementation(libs.spock.core)
implementation(libs.spock.junit4)
implementation(libs.takariPluginTesting)
implementation(project.dependencies.testFixtures(project))
runtimeOnly(libs.junitVintageEngine)
}
targets.all {
testTask.configure {
maxParallelForks = 4
}
}
}
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()
javaLauncher.set(project.javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(17) })
}
jar {
from(rootProject.file("LICENSE.txt")) {
into("META-INF")
}
}
asciidoctor {
notCompatibleWithConfigurationCache("See https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/564")
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 "-",
"snippets-path" to "$projectDir/src/docs/snippets"
))
}
}