Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
# 3. Commit changes in PR and merge.
# 4. Run this workflow to publish the plugin.
# 5. Update the version number in root build.gradle to the next -SNAPSHOT version.
## e.g. replace `version '1.2.3' with '1.2.4-SNAPSHOT'
# e.g. replace `version '1.2.3' with '1.2.4-SNAPSHOT'
# 6. Add the new release to the Compatibility Matrix in the README.md file.
# 7. Commit changes in PR and merge.

name: Publish to the Gradle Plugin Portal

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ develocity {
}

group 'org.javamodularity'
version '2.0.2-SNAPSHOT'
version '2.1.0'

java {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,30 +279,7 @@ void smokeTestRunStartScripts(

@Test
void shouldNotCheckInWithCommentedOutVersions() {
assertEquals(5, GradleVersion.values().length);
}

@Test
void pluginClasspathShouldNotContainTheGradleApi() {
assertTrue(
pluginClasspath.stream().noneMatch(file -> file.getName().startsWith("gradle-api-")),
() -> "The Gradle API must stay off the plugin classpath: each Gradle under test supplies "
+ "its own, and shipping ours puts that version's bytecode in front of every other "
+ "version. gradle-api-9.7.1.jar holds class files at major version 69, which "
+ "Gradle below 9.2 cannot instrument, failing every smoke test on the older "
+ "versions with 'Unsupported class file major version 69'. Classpath was: "
+ pluginClasspath);
}

@Test
void pluginClasspathShouldContainJavaParser() {
assertTrue(
pluginClasspath.stream().anyMatch(file -> file.getName().startsWith("javaparser-core")),
() -> "javaparser is a runtime dependency of the plugin and reached TestKit only as a "
+ "passenger of the Gradle API, so it has to be put on the classpath explicitly. "
+ "Without it every build under test fails with "
+ "NoClassDefFoundError: com/github/javaparser/JavaParser. Classpath was: "
+ pluginClasspath);
assertEquals(4, GradleVersion.values().length);
}

private static void assertTasksSuccessful(BuildResult result, String subprojectName, String... taskNames) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@ void mainClassNameIsQualifiedWithTheMainModule() {
void alreadyQualifiedMainClassIsNotQualifiedTwice() {
JavaExec execTask = execTask(MODULE + "/" + MAIN_CLASS);

assertEquals(MODULE + "/" + MAIN_CLASS, mutatorFor(execTask).getMainClassName(),
"mainClass can arrive already module-qualified: ModularJavaExec.setMain() strips the "
+ "prefix, but it is not always the setter that runs. Compiled against Gradle 9, "
+ "where JavaExecSpec.setMain(String) no longer exists, javac emits no covariant "
+ "bridge for the override, so on Gradle 8.x a Groovy DSL `main = \"module/Class\"` "
+ "assignment reaches Gradle's own setMain instead. Qualifying twice yields "
+ "`--module module/module/Class`, and the JVM then fails with "
+ "\"Could not find or load main class module/Class in module module\".");
assertEquals(MODULE + "/" + MAIN_CLASS, mutatorFor(execTask).getMainClassName());
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion test-project-groovy/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.javamodularity.moduleplugin' version '2.0.1' apply false
id 'org.javamodularity.moduleplugin' version '2.1.0' apply false
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion test-project-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "2.4.10" apply false
id("org.javamodularity.moduleplugin") version "2.0.1" apply false
id("org.javamodularity.moduleplugin") version "2.1.0" apply false
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion test-project-mixed/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.javamodularity.moduleplugin' version '2.0.1' apply false
id 'org.javamodularity.moduleplugin' version '2.1.0' apply false
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion test-project/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.javamodularity.moduleplugin' version '2.0.1' apply false
id 'org.javamodularity.moduleplugin' version '2.1.0' apply false
}

subprojects {
Expand Down
Loading