1- plugins {
2- id(" groovy" )
3- id(" java-gradle-plugin" )
4- id(" java-test-fixtures" )
5- id(" jvm-test-suite" )
6- id(" org.asciidoctor.jvm.convert" ) version " 4.0.5"
7- id(" org.gradlex.internal.plugin-publish-conventions" ) version " 0.6"
8- }
1+ plugins { id(" java-test-fixtures" ) }
92
10- group = " org.gradlex"
113version = " 1.0.3"
124
13- java {
14- toolchain.languageVersion = JavaLanguageVersion .of(17 )
15- }
16-
17- tasks.compileJava {
18- options.release = 8
19- options.compilerArgs.add(" -Werror" )
20- }
21-
22- tasks.javadoc {
23- // Enable all JavaDoc checks, but the one requiring JavaDoc everywhere
24- (options as StandardJavadocDocletOptions ).addStringOption(" Xdoclint:all,-missing" , " -Xwerror" )
25- }
26-
275dependencies {
286 api(platform(libs.mavenPluginTools.bom)) {
297 because(" the version for other dependencies in api would be missing otherwise" )
@@ -33,33 +11,26 @@ dependencies {
3311 implementation(libs.mavenPluginTools.java)
3412 implementation(libs.mavenPluginTools.generators)
3513
36- api(libs.mavenPlugin.annotations) {
37- because(" MavenMojo references types from this artifact" )
38- }
14+ api(libs.mavenPlugin.annotations) { because(" MavenMojo references types from this artifact" ) }
3915 implementation(libs.mavenPlugin.api)
4016
41- implementation(libs.sisu.injectPlexus) {
42- because(" it is needed to implement the plexus logging adapter" )
43- }
44- implementation(libs.plexus.velocity) {
45- because(" it is needed to generate the help mojo" )
46- }
17+ implementation(libs.sisu.injectPlexus) { because(" it is needed to implement the plexus logging adapter" ) }
18+ implementation(libs.plexus.velocity) { because(" it is needed to generate the help mojo" ) }
4719 constraints {
48- implementation(libs.qdox) {
49- because(" we need the fix for https://github.com/paul-hammant/qdox/issues/43" )
50- }
20+ implementation(libs.qdox) { because(" we need the fix for https://github.com/paul-hammant/qdox/issues/43" ) }
5121 }
5222
5323 testFixturesImplementation(libs.junit4)
5424 testFixturesImplementation(libs.commonsLang)
5525}
5626
57- pluginPublishConventions {
58- id(" ${project.group} .${project.name} " )
59- implementationClass(" org.gradlex.maven.plugin.development.MavenPluginDevelopmentPlugin" )
60- displayName(" Maven Plugin Development Gradle Plugin" )
61- description(" Gradle plugin for developing Apache Maven plugins." )
62- tags(" gradlex" , " maven" , " mojo" , " maven plugin" )
27+ publishingConventions {
28+ pluginPortal(" ${project.group} .${project.name} " ) {
29+ implementationClass(" org.gradlex.maven.plugin.development.MavenPluginDevelopmentPlugin" )
30+ displayName(" Maven Plugin Development Gradle Plugin" )
31+ description(" Gradle plugin for developing Apache Maven plugins." )
32+ tags(" gradlex" , " maven" , " mojo" , " maven plugin" )
33+ }
6334 gitHub(" https://github.com/gradlex-org/maven-plugin-development" )
6435 website(" https://gradlex.org/maven-plugin-development" )
6536 developer {
@@ -69,71 +40,18 @@ pluginPublishConventions {
6940 }
7041}
7142
72- // Required to write localRepository property to src/test/resources/test.properties for takari-plugin-testing used in MavenEndToEndFuncTest
73- tasks.processTestResources {
74- expand(" localRepository" to project.layout.buildDirectory.dir(" mavenLocal" ).get().asFile)
75- }
43+ // Required to write localRepository property to src/test/resources/test.properties for takari-plugin-testing used in
44+ // MavenEndToEndFuncTest
45+ tasks.processTestResources { expand(" localRepository" to project.layout.buildDirectory.dir(" mavenLocal" ).get().asFile) }
7646
77- testing.suites.named<JvmTestSuite >(" test" ) {
78- useSpock()
79- dependencies {
80- implementation(libs.spock.core)
81- implementation(libs.spock.junit4)
82- implementation(libs.takariPluginTesting)
83- implementation(project.dependencies.testFixtures(project))
84- runtimeOnly(libs.junitVintageEngine)
85- }
86- targets.all {
87- testTask.configure {
88- maxParallelForks = 4
89- }
90- }
91- }
92-
93- testing.suites.register<JvmTestSuite >(" testSamples" ) {
94- useJUnit()
95- dependencies {
96- implementation(gradleTestKit())
97- implementation(libs.exemplar.sampleCheck)
98- }
99- targets.all {
100- testTask.configure {
101- inputs.dir(" src/docs/snippets" )
102- .withPathSensitivity(PathSensitivity .RELATIVE )
103- .withPropertyName(" snippets" )
104- }
105- }
106- }
47+ // === the following custom configuration should be removed once tests are migrated to Java
48+ apply (plugin = " groovy" )
10749
108- tasks {
109- test {
110- useJUnitPlatform()
111- }
112- jar {
113- from(rootProject.file(" LICENSE.txt" )) {
114- into(" META-INF" )
115- }
116- }
117- asciidoctor {
118- notCompatibleWithConfigurationCache(" See https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/564" )
119- inputs.dir(" src/docs/snippets" )
120- .withPathSensitivity(PathSensitivity .RELATIVE )
121- .withPropertyName(" snippets" )
122- outputOptions {
123- separateOutputDirs = false
124- }
125-
126- attributes(mapOf (
127- " docinfodir" to " src/docs/asciidoc" ,
128- " docinfo" to " shared" ,
129- " source-highlighter" to " prettify" ,
130- " tabsize" to " 4" ,
131- " toc" to " left" ,
132- " icons" to " font" ,
133- " sectanchors" to true ,
134- " idprefix" to " " ,
135- " idseparator" to " -" ,
136- " snippets-path" to " $projectDir /src/docs/snippets"
137- ))
138- }
139- }
50+ dependencies {
51+ testImplementation(libs.spock.core)
52+ testImplementation(libs.spock.junit4)
53+ testImplementation(libs.takariPluginTesting)
54+ testImplementation(project.dependencies.testFixtures(project))
55+ testRuntimeOnly(libs.junitVintageEngine)
56+ } //
57+ // ====================================================================================
0 commit comments