Skip to content

Commit

Permalink
Test Kotlin K2
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrishchenko committed Jun 24, 2024
1 parent 78527ce commit 634d4b7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle-plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
group = io.github.sgrishchenko
version = 1.0.0-alpha.42

kotlinVersion = 1.9.23
kotlinVersion = 2.0.0-RC2
publishVersion = 1.2.1

jacksonVersion = 2.17.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class KarakumPlugin : Plugin<Project> {

extensionSource.convention(karakum.extensionSource)

val npmProjectDirectory = provider { kotlinJsCompilation.npmProject.dir }
val npmProjectDirectory = kotlinJsCompilation.npmProject.dir.map { it.asFile }
destinationDirectory.convention(layout.dir(npmProjectDirectory).map { it.dir("karakum") })
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import org.gradle.api.Project
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation

internal val Project.kotlinJsCompilation: KotlinJsCompilation
internal val Project.kotlinJsCompilation: KotlinJsIrCompilation
get() {
val extension = extensions.getByType<KotlinMultiplatformExtension>()
val target = extension.js()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ abstract class KarakumConfig : DefaultTask() {

private fun replaceCwd(configNode: JsonNode) {
configNode as ObjectNode
configNode.put("cwd", project.kotlinJsCompilation.npmProject.dir.absolutePath)
configNode.put("cwd", project.kotlinJsCompilation.npmProject.dir.get().asFile.absolutePath)
}

private fun replaceOutput(configNode: JsonNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.gradle.api.DefaultTask
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.*
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation
import org.jetbrains.kotlin.gradle.targets.js.npm.RequiresNpmDependencies
import org.jetbrains.kotlin.gradle.targets.js.npm.npmProject

Expand All @@ -20,7 +20,7 @@ abstract class KarakumGenerate : DefaultTask(), RequiresNpmDependencies {
abstract val extensionDirectory: DirectoryProperty

@get:Internal
override val compilation: KotlinJsCompilation = project.kotlinJsCompilation
override val compilation: KotlinJsIrCompilation = project.kotlinJsCompilation

@get:Internal
override val requiredNpmDependencies = setOf(
Expand Down

0 comments on commit 634d4b7

Please sign in to comment.