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
9 changes: 3 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ plugins {
group = "org.gradlex"
version = "1.7"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<JavaCompile>().configureEach { options.release = 8 }

dependencies {
testImplementation("org.spockframework:spock-core:2.1-groovy-3.0")
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
testImplementation("org.gradle.exemplar:samples-check:1.0.3")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
}
Expand All @@ -33,7 +30,7 @@ pluginPublishConventions {

testing.suites.named<JvmTestSuite>("test") {
useJUnitJupiter()
listOf("7.4", "7.6.5", "8.0.2").forEach { gradleVersionUnderTest ->
listOf("7.4", "7.6.5", "8.0.2", "8.14.2").forEach { gradleVersionUnderTest ->
targets.register("test${gradleVersionUnderTest}") {
testTask {
group = LifecycleBasePlugin.VERIFICATION_GROUP
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=7197a12f450794931532469d4ff21a59ea2c1cd59a3ec3f89c035c3c420a6999
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
distributionSha256Sum=5086034b0656a79fee07a04cfadc103984b075ac85d3a20748649671283be1bb
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-rc-1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ dependencies {

runtimeOnly("org.slf4j:slf4j-simple")
}

javaModuleTesting.whitebox(testing.suites["test"]) {
requires.add("org.junit.jupiter.api")
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ plugins {
id("org.gradlex.java-module-testing")
}

javaModuleTesting.whitebox(
testing.suites.getByName<JvmTestSuite>("test") {
useJUnitJupiter("")
targets.all {
testTask { jvmArgs("-Dorg.slf4j.simpleLogger.defaultLogLevel=error") }
}
testing.suites.getByName<JvmTestSuite>("test") {
useJUnitJupiter("")
targets.all {
testTask { jvmArgs("-Dorg.slf4j.simpleLogger.defaultLogLevel=error") }
}
) {
requires.add("org.junit.jupiter.api")
}

testing.suites.create<JvmTestSuite>("integtest") {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.my.lib.integtest;

import org.junit.jupiter.api.Test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import static org.junit.jupiter.api.Assertions.assertTrue;

public class LibIntegTest {

@Test
public void libWorks() throws IOException {
// assertTrue(...);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

package org.gradlex.javamodule.testing;

import org.gradle.api.NonNullApi;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JvmTestSuitePlugin;
import org.gradle.util.GradleVersion;
import org.jspecify.annotations.NullMarked;

@SuppressWarnings("unused")
@NonNullApi
@NullMarked
public abstract class JavaModuleTestingPlugin implements Plugin<Project> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@

import org.gradle.api.Action;
import org.gradle.api.Describable;
import org.gradle.api.NonNullApi;
import org.gradle.api.Task;
import org.gradle.api.file.FileCollection;
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.internal.jvm.JavaModuleDetector;
import org.jspecify.annotations.NullMarked;

import javax.inject.Inject;
import java.util.ArrayList;
import java.util.List;

@NonNullApi
@NullMarked
public abstract class JavaCompileSetModulePathAction implements Action<Task>, Describable {

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class GradleBuild {
tasks.test {
testLogging.showStandardStreams = true
}
tasks.withType<JavaCompile>().configureEach { options.release.set(11) }
"""
file("app/src/main/java/org/example/app/Main.java") << '''
package org.example.app;
Expand Down Expand Up @@ -91,6 +92,7 @@ class GradleBuild {
id("java-library")
}
group = "org.example"
tasks.withType<JavaCompile>().configureEach { options.release.set(11) }
'''
}

Expand Down