Skip to content

Commit

Permalink
Kotlin 2.0.0-Beta5 (#2204)
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz authored Mar 28, 2024
1 parent a29a9d9 commit 4af5e7f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ fun Project.configureErrorableEsbuild() {

val esbuildVersion = korge.esbuildVersion
doFirst {
val npmCmd = arrayOf(
File(env.nodeExecutable),
File(env.nodeDir, "lib/node_modules/npm/bin/npm-cli.js").takeIf { it.exists() }
?: File(env.nodeDir, "node_modules/npm/bin/npm-cli.js").takeIf { it.exists() }
?: error("Can't find npm-cli.js in ${env.nodeDir} standard folders")
//val nodeDir = env.nodeBinDir
val nodeDir = env.dir
val file1: File = File(env.nodeExecutable)
val file2: File? = File(nodeDir, "lib/node_modules/npm/bin/npm-cli.js").takeIf { it.exists() }
val file3: File? = File(nodeDir, "node_modules/npm/bin/npm-cli.js").takeIf { it.exists() }
val npmCmd = arrayOf<File>(
file1,
file2
?: file2
?: error("Can't find npm-cli.js in ${nodeDir} standard folders")
)

environment("PATH", ENV_PATH)
Expand Down Expand Up @@ -108,7 +113,11 @@ fun Project.configureErrorableEsbuild() {
dependsOn(compileExecutableKotlinJs)

//println("compileExecutableKotlinJs:" + compileExecutableKotlinJs::class)
val jsPath = compileExecutableKotlinJs.outputFileProperty.get()
//val jsPath = compileExecutableKotlinJs.outputFileProperty.get()
//val jsPath = compileExecutableKotlinJs.destinationDirectory.asFile.get().absolutePath + "/" + compileExecutableKotlinJs.moduleName.get() + ".js"
// @TODO: Check this
val jsPath = compileExecutableKotlinJs.destinationDirectory.asFile.get().absolutePath

val output = File(wwwFolder, "${project.name}.js")
//println("jsPath=$jsPath")
//println("jsPath.parentFile=${jsPath.parentFile}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun Project.configureWasm(projectType: ProjectType, binaryen: Boolean = false) {
}

open class WasmJsCreateIndexTask : DefaultTask() {
private val npmDir: File = project.kotlin.wasmJs().compilations["main"]!!.npmProject.dir
private val npmDir: File = project.kotlin.wasmJs().compilations["main"]!!.npmProject.dir.get().asFile

@TaskAction
fun run() {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/korlibs/root/RootKorlibsPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ object RootKorlibsPlugin {
wasmBrowserTest.doFirst {
logger.info("!!!!! wasmBrowserTest PATCH :: $wasmBrowserTest : ${wasmBrowserTest::class.java}")

val npmProjectDir = wasmBrowserTest.compilation.npmProject.dir
val npmProjectDir: File = wasmBrowserTest.compilation.npmProject.dir.get().asFile
val projectName = npmProjectDir.name
val uninstantiatedMjs = File(npmProjectDir, "kotlin/$projectName.uninstantiated.mjs")

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ proguard-gradle = "7.2.2"
asm = "9.5"
jgit = "5.13.1.202206130422-r"

kotlin = "1.9.23"
kotlin = "2.0.0-Beta5"
kotlinx-coroutines = "1.8.0"
kotlinx-serialization = "1.6.2"
kotlinx-atomicfu = "0.23.1"
Expand Down

0 comments on commit 4af5e7f

Please sign in to comment.