Skip to content

Commit

Permalink
Exclude test mixin packages due to error in JUnit test discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
NotStirred committed Mar 13, 2024
1 parent 8b5c5bd commit d6f7814
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ tasks.register("genAll") {
dependsOn(generatePackageInfo, generateMixinConfigs)
}

// TODO mixin auto-gen for mixins in the test sourceset
mixinGen {
filePattern = "cubicchunks.mixins.%s.json"
defaultRefmap = "CubicChunks-refmap.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ private static Map<Path, Path> getPackages(SourceDirectorySet allJava) throws IO
Map<Path, Path> packages = new HashMap<>();
for (File it : allJava) {
Path javaClass = it.getCanonicalFile().toPath();
if (javaClass.toString().contains("mixin/test")) {
// junit will try to load package-info files (when scanning for tests) causing mixin to throw as classes in mixin packages must not be loaded.
continue;
}
for (Path srcPath : srcPaths) {
if (javaClass.startsWith(srcPath) && javaClass.toString().endsWith(".java")) {
Path relative = srcPath.relativize(javaClass);
Expand Down

This file was deleted.

0 comments on commit d6f7814

Please sign in to comment.