-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Where's the module-info.java file? #314
Comments
JUnit Pioneer currently uses Java 8 (from the build.gradle.kts):
Sadly, no |
What we can do:
Optionally the source code can be updated to Java 11 (but only language elements, keeping same Java RT) and compiled back to Java 8 byte code with something like Jabel |
Still not convinced module declarations make too much sense for test code, but since it doesn't appear to hurt anyone (I infer from JUnit 5 having them for quite some time now), we can look into this. Regarding the build, it appears easiest to me to make Java 11 the default/release build (with |
When switching to modules I suggest to offer the PioneerTestKit and Assertions as an own module, so user can write their own extensions and use our Testkit / Assertions for it. |
I did the simplest thing by adding a diff --git a/build.gradle.kts b/build.gradle.kts
index f6cc08a..77fa80e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,7 +13,7 @@ group = "org.junit-pioneer"
description = "JUnit 5 Extension Pack"
java {
- sourceCompatibility = JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_11
}
repositories {
diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java
index 6b1b170..f0c6bce 100644
--- a/src/main/java/module-info.java
+++ b/src/main/java/module-info.java
@@ -1,2 +1,9 @@
-module $MODULE_NAME$ {
-}
\ No newline at end of file
+module org.junitpioneer {
+ // could be `transitive`, but that's its own discussion
+ requires org.junit.jupiter.api;
+ requires org.junit.jupiter.params;
+
+ exports org.junitpioneer.vintage;
+ exports org.junitpioneer.jupiter;
+ exports org.junitpioneer.jupiter.params;
+} Result: nipa 🤡 JUnit-Pioneer :: ./gradlew build
> Configure project :
Building version '0.9.1' (value loaded from 'version.properties' file).
> Task :compileJava FAILED
/home/nipa/code/JUnit-Pioneer/src/main/java/module-info.java:3: error: module not found: org.junit.jupiter.api
requires org.junit.jupiter.api;
^
/home/nipa/code/JUnit-Pioneer/src/main/java/module-info.java:4: error: module not found: org.junit.jupiter.params
requires org.junit.jupiter.params;
^
2 errors
FAILURE: Build failed with an exception. It seems to take more time and Hirnschmalz than I'm willing to spend on this task (because I'm still not convinced test modules are worth it). We welcome PRs on this, but we may not merge one without bumping the major version (talking post 1.0) and that may have to be a discussion on its own. |
Gimme time, but I think I'm motivate to get in touch with the module-system myself for the first time. |
@Bukama This documentation could help: https://guides.gradle.org/building-java-9-modules/
|
Add a module descriptor to the root of the JUnit Pioneer JAR file. Something like:
The text was updated successfully, but these errors were encountered: