Skip to content

Commit

Permalink
Migrate to org.jetbrains.kotlin.multiplatform plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
5peak2me authored and nathan3d committed Jan 8, 2025
1 parent 0ea6085 commit 8d2a943
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion ruler-frontend-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tasks.withType<Test> {
useJUnitPlatform()

// Make development report available
dependsOn(":ruler-frontend:browserDevelopmentWebpack")
dependsOn(":ruler-frontend:jsBrowserDevelopmentWebpack")
}

kotlin {
Expand Down
40 changes: 20 additions & 20 deletions ruler-frontend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

plugins {
id("org.jetbrains.kotlin.js")
id("org.jetbrains.kotlin.multiplatform")
id("io.gitlab.arturbosch.detekt")
}

Expand All @@ -33,39 +33,39 @@ kotlin {
}

dependencies {
implementation(project(":ruler-models"))
"jsMainImplementation"(project(":ruler-models"))

implementation(Dependencies.KOTLIN_REACT)
implementation(Dependencies.KOTLIN_REACT_DOM)
implementation(Dependencies.KOTLIN_REACT_ROUTER)
implementation(Dependencies.KOTLIN_JS_EXTENSIONS)
implementation(Dependencies.KOTLINX_SERIALIZATION_JSON)
"jsMainImplementation"(Dependencies.KOTLIN_REACT)
"jsMainImplementation"(Dependencies.KOTLIN_REACT_DOM)
"jsMainImplementation"(Dependencies.KOTLIN_REACT_ROUTER)
"jsMainImplementation"(Dependencies.KOTLIN_JS_EXTENSIONS)
"jsMainImplementation"(Dependencies.KOTLINX_SERIALIZATION_JSON)

implementation(npm(Dependencies.REACT, Dependencies.Versions.REACT))
implementation(npm(Dependencies.REACT_DOM, Dependencies.Versions.REACT))
implementation(npm(Dependencies.BOOTSTRAP, Dependencies.Versions.BOOTSTRAP))
implementation(npm(Dependencies.APEX_CHARTS, Dependencies.Versions.APEX_CHARTS))
"jsMainImplementation"(npm(Dependencies.REACT, Dependencies.Versions.REACT))
"jsMainImplementation"(npm(Dependencies.REACT_DOM, Dependencies.Versions.REACT))
"jsMainImplementation"(npm(Dependencies.BOOTSTRAP, Dependencies.Versions.BOOTSTRAP))
"jsMainImplementation"(npm(Dependencies.APEX_CHARTS, Dependencies.Versions.APEX_CHARTS))

testImplementation(kotlin("test-js"))
"jsTestImplementation"(kotlin("test-js"))
}

val browserDist by configurations.creating {
val browserDist: Configuration by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
}

artifacts {
add(browserDist.name, tasks.named("browserDistribution").map { it.outputs.files.files.single() })
add(browserDist.name, tasks.named("jsBrowserDistribution").map { it.outputs.files.files.single() })
}

tasks.named("browserDevelopmentRun") {
dependsOn("developmentExecutableCompileSync")
tasks.named("jsBrowserDevelopmentRun") {
dependsOn("jsDevelopmentExecutableCompileSync")
}

tasks.named("browserDevelopmentWebpack") {
dependsOn("productionExecutableCompileSync")
tasks.named("jsBrowserDevelopmentWebpack") {
dependsOn("jsProductionExecutableCompileSync")
}

tasks.named("browserProductionWebpack") {
dependsOn("developmentExecutableCompileSync")
tasks.named("jsBrowserProductionWebpack") {
dependsOn("jsDevelopmentExecutableCompileSync")
}
File renamed without changes.
2 changes: 1 addition & 1 deletion ruler-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dependencies {

// Include the output of the frontend JS compilation in the plugin resources
sourceSets.main {
resources.srcDir(project(":ruler-frontend").tasks.named("browserDistribution"))
resources.srcDir(project(":ruler-frontend").tasks.named("jsBrowserDistribution"))
}

tasks.withType<Test> {
Expand Down

0 comments on commit 8d2a943

Please sign in to comment.