Read @argfile manually

This commit is contained in:
Erik C. Thauvin 2025-03-23 18:35:56 -07:00
parent b5b6b40564
commit b0ad8ad056
Signed by: erik
GPG key ID: 776702A6A2DA330E
6 changed files with 38 additions and 9 deletions

View file

@ -180,7 +180,7 @@ class CompileKotlinOperationTest {
.compileTestClasspath(mainDir.getAbsolutePath());
op.compileOptions().verbose(true);
op.compileOptions().jdkRelease("17");
op.compileOptions().argFile("src/test/resources/argfile.txt", "src/test/resources/argfile2.txt");
if (!CompileKotlinOperation.isWindows()) {
op.jvmOptions().enableNativeAccess(JvmOptions.ALL_UNNAMED);
@ -188,7 +188,8 @@ class CompileKotlinOperationTest {
}
var args = op.compileOptions().args();
var matches = List.of("-Xjdk-release=17", "-no-stdlib", "-verbose");
var matches = List.of("-Xjdk-release=17", "-no-reflect", "-progressive", "-include-runtime", "-no-stdlib",
"-verbose");
assertThat(args).as(args + " == " + matches).isEqualTo(matches);
op.execute();

View file

@ -52,7 +52,6 @@ class CompileOptionsTest {
void testArgs() {
var options = new CompileOptions()
.apiVersion("11")
.argFile(new File("file.txt"), new File("file2.txt"))
.javaParameters(true)
.jvmTarget("11")
.includeRuntime(true)
@ -76,7 +75,6 @@ class CompileOptionsTest {
var matches = List.of(
"-api-version", "11",
"@" + localPath("file.txt"), "@" + localPath("file2.txt"),
"-java-parameters",
"-jvm-target", "11",
"-include-runtime",
@ -210,7 +208,6 @@ class CompileOptionsTest {
var params = new CompileOptions()
.advancedOptions("Xoption")
.apiVersion("11")
.argFile("file")
.expression("expression")
.includeRuntime(true)
.javaParameters(true)
@ -233,7 +230,7 @@ class CompileOptionsTest {
.wError(true)
.wExtra(true);
var skipArgs = List.of("-J", "-classpath");
var skipArgs = List.of("-J", "-classpath", "@");
assertThat(args).as(skipArgs + " not found.").containsAll(skipArgs);
args.removeAll(skipArgs);