Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
distribution: 'temurin'
java-version: 17
- uses: gradle/actions/setup-gradle@v5
- run: "./gradlew :test"
- run: "./gradlew :qualityCheck :test"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
build
.kotlin/

# Ignore IntelliJ IDEA config directory
.idea/

# Used by takari-plugin-testing library used in MavenEndToEndFuncTest
# unfortunately this path is hard coded here https://github.com/takari/takari-plugin-testing-project/blob/04312cdd308b284ed8dfa9655174abc2efcbfe20/takari-plugin-testing/src/main/java/io/takari/maven/testing/executor/junit/MavenVersionResolver.java#L97
# and can therefore not be changed to be inside the build directory.
Expand Down
132 changes: 25 additions & 107 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
plugins {
id("groovy")
id("java-gradle-plugin")
id("java-test-fixtures")
id("jvm-test-suite")
id("org.asciidoctor.jvm.convert") version "4.0.5"
id("org.gradlex.internal.plugin-publish-conventions") version "0.6"
}
plugins { id("java-test-fixtures") }

group = "org.gradlex"
version = "1.0.3"

java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
}

tasks.compileJava {
options.release = 8
options.compilerArgs.add("-Werror")
}

tasks.javadoc {
// Enable all JavaDoc checks, but the one requiring JavaDoc everywhere
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:all,-missing", "-Xwerror")
}

dependencies {
api(platform(libs.mavenPluginTools.bom)) {
because("the version for other dependencies in api would be missing otherwise")
Expand All @@ -33,33 +11,26 @@ dependencies {
implementation(libs.mavenPluginTools.java)
implementation(libs.mavenPluginTools.generators)

api(libs.mavenPlugin.annotations) {
because("MavenMojo references types from this artifact")
}
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")
}
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")
}
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")
publishingConventions {
pluginPortal("${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 {
Expand All @@ -69,71 +40,18 @@ pluginPublishConventions {
}
}

// 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)
}
// 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")
}
}
}
// === the following custom configuration should be removed once tests are migrated to Java
apply(plugin = "groovy")

tasks {
test {
useJUnitPlatform()
}
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"
))
}
}
dependencies {
testImplementation(libs.spock.core)
testImplementation(libs.spock.junit4)
testImplementation(libs.takariPluginTesting)
testImplementation(project.dependencies.testFixtures(project))
testRuntimeOnly(libs.junitVintageEngine)
} //
// ====================================================================================
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.parallel=true
23 changes: 0 additions & 23 deletions gradle/checkstyle/checkstyle.xml

This file was deleted.

15 changes: 0 additions & 15 deletions gradle/checkstyle/header.txt

This file was deleted.

1 change: 1 addition & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toolchainVersion=17
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ junit4 = { module = "junit:junit", version = "4.13.2" }
junitVintageEngine = { module = "org.junit.vintage:junit-vintage-engine", version = "6.0.0" }
takariPluginTesting = { module = "io.takari.maven.plugins:takari-plugin-integration-testing", version = "3.1.1" }
commonsLang = { module = "org.apache.commons:commons-lang3", version = "3.19.0" }
exemplar-sampleCheck = { module = "org.gradle.exemplar:samples-check", version = "1.0.3" }
34 changes: 1 addition & 33 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@
/*
* Copyright the GradleX team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("com.gradle.develocity") version "4.2.2"
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.4.0"
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}
}
plugins { id("org.gradlex.internal-build-conventions") version "0.8" }

rootProject.name = "maven-plugin-development"

includeBuild("sample/gradle-producer-build")

develocity {
buildScan {
termsOfUseUrl = "https://gradle.com/terms-of-service"
termsOfUseAgree = "yes"
publishing.onlyIf { !System.getenv("CI").isNullOrEmpty() }
}
}
11 changes: 2 additions & 9 deletions src/docs/snippets/dependencies/dependencies.sample.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
commands: [{
execution-subdirectory: groovy
executable: gradle
args: tasks
},{
execution-subdirectory: kotlin
executable: gradle
args: tasks
}]
executable: gradlew
args: tasks
11 changes: 2 additions & 9 deletions src/docs/snippets/help-mojo/help-mojo.sample.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
commands: [{
execution-subdirectory: groovy
executable: gradle
args: tasks
},{
execution-subdirectory: kotlin
executable: gradle
args: tasks
}]
executable: gradlew
args: tasks
20 changes: 2 additions & 18 deletions src/main/java/org/gradlex/maven/plugin/development/FileUtils.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright the GradleX team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// SPDX-License-Identifier: Apache-2.0
package org.gradlex.maven.plugin.development;

import java.io.File;
Expand All @@ -32,6 +17,5 @@ static Optional<String> getExtension(File file) {
return Optional.of(fileNameSegments[fileNameSegments.length - 1]);
}

private FileUtils() {
}
private FileUtils() {}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
/*
* Copyright the GradleX team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// SPDX-License-Identifier: Apache-2.0
package org.gradlex.maven.plugin.development;

import org.gradle.api.artifacts.Configuration;
Expand All @@ -23,19 +8,19 @@ public interface MavenPluginDevelopmentExtension {

String NAME = "mavenPlugin";

Property<String> getGroupId();
Property<String> getGroupId();

Property<String> getArtifactId();
Property<String> getArtifactId();

Property<String> getVersion();
Property<String> getVersion();

Property<String> getName();
Property<String> getName();

Property<String> getDescription();
Property<String> getDescription();

Property<String> getGoalPrefix();
Property<String> getGoalPrefix();

Property<String> getHelpMojoPackage();
Property<String> getHelpMojoPackage();

/**
* The set of dependencies to add to the plugin descriptor.
Expand Down
Loading
Loading