Skip to content

Commit

Permalink
Merge pull request #848 from jwstegemann/jamowei/gradle
Browse files Browse the repository at this point in the history
Use Kotlin default hierarchy template
  • Loading branch information
jamowei authored Jan 16, 2024
2 parents 107771a + 73249d1 commit 3e92c28
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 78 deletions.
23 changes: 4 additions & 19 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,6 @@ kotlin {
dependsOn(":test-server:start")
// see "karma.config.d" folder for customizing karma
}
// just to have a place to copy it from...
/*
runTask {
devServer?.apply {
port = 9000
proxy?.apply {
put("/members", "http://localhost:8080")
put("/chat", mapOf(
"target" to "ws://localhost:8080",
"ws" to true
))
}
}
}
*/
}
sourceSets {
all {
Expand All @@ -36,25 +21,25 @@ kotlin {
optIn("kotlinx.coroutines.FlowPreview")
}
}
val commonMain by getting {
commonMain {
dependencies {
api(KotlinX.coroutines.core)
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(Kotlin.test)
implementation(Kotlin.test.common)
implementation(Kotlin.test.junit)
implementation(Kotlin.test.annotationsCommon)
}
}
val jsMain by getting {
jsMain {
dependencies {
api(KotlinX.coroutines.core)
}
}
val jsTest by getting {
jsTest {
dependencies {
implementation(Kotlin.test.js)
implementation(KotlinX.serialization.json)
Expand Down
4 changes: 2 additions & 2 deletions examples/gettingstarted/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/masterdetail/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
implementation(KotlinX.serialization.json)
}
}
val jvmMain by getting {
jvmMain {
dependencies {
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/nestedmodel/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jvmMain by getting {
jvmMain {
dependencies {
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
5 changes: 2 additions & 3 deletions examples/performance/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
}

repositories {
mavenLocal()
mavenCentral()
}

Expand All @@ -14,12 +13,12 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/remote/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/routing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
8 changes: 4 additions & 4 deletions examples/tictactoe/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ kotlin {
jvm() // needed for kspCommonMainMetadata
js(IR) {
browser {
webpackTask(Action {
webpackTask {
cssSupport {
enabled.set(true)
}
})
}
}
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/todomvc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/validation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
implementation(KotlinX.datetime)
}
}
val jvmMain by getting {
jvmMain {
dependencies {
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/webcomponent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
implementation(npm("@mat3e-ux/stars", "0.2.5"))
}
Expand Down
4 changes: 2 additions & 2 deletions headless-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ kotlin {
optIn("kotlin.ExperimentalStdlibApi")
}
}
val commonMain by getting {
commonMain {
dependencies {
implementation(project(":headless"))
}
}
val jsMain by getting {
jsMain {
dependencies {
// tailwind
implementation(npm("tailwindcss", "_"))
Expand Down
21 changes: 3 additions & 18 deletions headless/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ kotlin {
// usePhantomJS()
}
}
// just to have a place to copy it from...
/*
runTask {
devServer?.apply {
port = 9000
proxy?.apply {
put("/members", "http://localhost:8080")
put("/chat", mapOf(
"target" to "ws://localhost:8080",
"ws" to true
))
}
}
}
*/
}
sourceSets {
all {
Expand All @@ -38,18 +23,18 @@ kotlin {
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}
val commonMain by getting {
commonMain {
dependencies {
api(project(":core"))
}
}
val jsMain by getting {
jsMain {
dependencies {
api(npm("@floating-ui/dom","_"))
api(npm("scroll-into-view-if-needed", "_"))
}
}
val jsTest by getting {
jsTest {
dependencies {
implementation(Kotlin.test.js)
}
Expand Down
10 changes: 5 additions & 5 deletions lenses-annotation-processor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ ksp {
}

kotlin {
js(IR) {
browser()
}.binaries.executable()
jvm {
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
js(IR) {
browser()
}.binaries.executable()
sourceSets {
val jvmMain by getting {
jvmMain {
dependencies {
api(kotlin("stdlib"))
api(project(":core"))
Expand All @@ -32,7 +32,7 @@ kotlin {
}
}

val jvmTest by getting {
jvmTest {
dependencies {
implementation(Kotlin.test.junit5)
implementation(Testing.junit.jupiter.params)
Expand Down
2 changes: 1 addition & 1 deletion serialization/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kotlin {
jvm()
js(IR).browser { }
sourceSets {
val jsMain by getting {
jsMain {
dependencies {
api(project(":core"))
api(KotlinX.serialization.json)
Expand Down
2 changes: 1 addition & 1 deletion snippets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kotlin {
optIn("kotlin.ExperimentalStdlibApi")
}
}
val jsMain by getting {
jsMain {
dependencies {
implementation(project(":core"))
// tailwind
Expand Down
10 changes: 5 additions & 5 deletions www/src/pages/docs/10_Getting Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ To use fritz2, set up a Kotlin multiplatform-project using one of these options:

```kotlin
plugins {
kotlin("multiplatform") version "1.9.20"
kotlin("multiplatform") version "1.9.22"
// KSP support needed for Lens generation
id("com.google.devtools.ksp") version "1.9.20-1.0.14"
id("com.google.devtools.ksp") version "1.9.22-1.0.16"
}

repositories {
Expand All @@ -44,17 +44,17 @@ kotlin {
}.binaries.executable()

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
implementation("dev.fritz2:core:$fritz2Version")
// implementation("dev.fritz2:headless:$fritz2Version") // optional headless comp
}
}
val jvmMain by getting {
jvmMain {
dependencies {
}
}
val jsMain by getting {
jsMain {
dependencies {
}
}
Expand Down
2 changes: 1 addition & 1 deletion www/src/pages/headless/headlessComponents.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In order to use headless components in your project, replace the dependency to t
kotlin {
// ...
sourceSets {
val commonMain by getting {
commonMain {
dependencies {
// always add the dependency to headless in the commonMain section
implementation("dev.fritz2:headless:$fritz2Version")
Expand Down

0 comments on commit 3e92c28

Please sign in to comment.