[JS] Migrate tests onto IR compiler with outputDir API instead of outputFile

^KT-61117 fixed
This commit is contained in:
Ilya Goncharov
2023-11-29 11:21:56 +00:00
committed by Space Team
parent e50f6e6bca
commit 08e3cb300a
38 changed files with 208 additions and 201 deletions
@@ -21,7 +21,8 @@ dependencies {
}
tasks.named("compileKotlinJs", Kotlin2JsCompile) {
it.kotlinOptions.outputFile = "${buildDir}/kotlin2js/main/module.js"
it.destinationDirectory = new File(buildDir, "kotlin2js/main")
it.kotlinOptions.moduleName = "module"
it.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-only"]
}
@@ -29,7 +29,8 @@ artifacts {
def outDir = "${buildDir}/kotlin2js/main/"
compileKotlin2Js.kotlinOptions.outputFile = outDir + "test-library.js"
compileKotlin2Js.destinationDirectory = new File(outDir)
compileKotlin2Js.kotlinOptions.moduleName = "test-library"
compileKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir"]
@@ -21,7 +21,8 @@ dependencies {
}
compileKotlin2Js.kotlinOptions.sourceMap = true
compileKotlin2Js.kotlinOptions.outputFile = "${projectDir}/web/js/app.js"
compileKotlin2Js.destinationDirectory = new File(projectDir, "web/js")
compileKotlin2Js.kotlinOptions.moduleName = "app"
compileKotlin2Js.kotlinOptions.suppressWarnings = true
compileKotlin2Js.kotlinOptions.verbose = true
@@ -100,9 +100,7 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
@Override
protected void configureSpecificCompilerArguments(@NotNull K2JSCompilerArguments arguments, @NotNull List<File> sourceRoots) throws MojoExecutionException {
arguments.setOutputFile(outputFile);
arguments.setNoStdlib(true);
arguments.setMetaInfo(metaInfo);
arguments.setOutputDir(new File(outputFile).getParent());
arguments.setModuleKind(moduleKind);
arguments.setMain(main);
arguments.setIrOnly(useIrBackend);
@@ -86,8 +86,7 @@ public class KotlinTestJSCompilerMojo extends K2JSCompilerMojo {
super.configureSpecificCompilerArguments(arguments, sourceRoots);
arguments.setOutputFile(outputFile);
arguments.setMetaInfo(metaInfo);
arguments.setOutputDir(new File(outputFile).getParent());
}
@Override