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
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public static void addLibrary(Logger logger, Path libraryPath, IntelliJEnvironme
if (!Files.exists(libraryPath)) {
throw new UncheckedIOException(new NoSuchFileException(libraryPath.toString()));
}
ijEnv.addJarToClassPath(libraryPath);
if (Files.isDirectory(libraryPath)) ijEnv.addFolderToClasspath(libraryPath);
else ijEnv.addJarToClassPath(libraryPath);
logger.debug("Added %s", libraryPath);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public C1 get()La/b/c/Reference;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package a.b.c;

public record Reference(int a) {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import a.b.c.Reference;

public class C1 {
public Reference get() {
return new Reference(1);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import a.b.c.Reference;

public class C1 {
private Reference get() {
return new Reference(1);
}
}
15 changes: 13 additions & 2 deletions tests/src/test/java/net/neoforged/jst/tests/EmbeddedTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.neoforged.jst.tests;

import com.intellij.util.ArrayUtil;
import net.neoforged.jst.cli.Main;
import org.assertj.core.util.CanIgnoreReturnValue;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -286,6 +287,11 @@ void testImplicitConstructors() throws Exception {
void testIllegal() throws Exception {
runATTest("illegal");
}

@Test
void testFolderClasspathEntries() throws Exception {
runATTest("folder_classpath_entry", "--classpath=" + testDataRoot.resolve("accesstransformer/folder_classpath_entry/deps"));
}
}

@Nested
Expand Down Expand Up @@ -350,10 +356,15 @@ protected final void runInterfaceInjectionTest(String testDirName, Path tempDir,
}
}

protected final void runATTest(String testDirName) throws Exception {
protected final void runATTest(String testDirName, final String... extraArgs) throws Exception {
testDirName = "accesstransformer/" + testDirName;
var atPath = testDataRoot.resolve(testDirName).resolve("accesstransformer.cfg");
runTest(testDirName, txt -> txt.replace(atPath.toAbsolutePath().toString(), "{atpath}"), "--enable-accesstransformers", "--access-transformer", atPath.toString());
runTest(testDirName, txt -> txt.replace(atPath.toAbsolutePath().toString(), "{atpath}"), ArrayUtil.mergeArrays(
new String[]{
"--enable-accesstransformers", "--access-transformer", atPath.toString()
},
extraArgs
));
}

protected final void runParchmentTest(String testDirName, String mappingsFilename) throws Exception {
Expand Down
Loading