Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update kotlin version in examples #4844

Merged
merged 3 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/imageviewer/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ org.gradle.caching=true
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.wasm.enabled=true
kotlin.version=2.0.0-RC2
kotlin.version=2.0.0
agp.version=8.0.2
compose.version=1.6.10
544 changes: 375 additions & 169 deletions examples/imageviewer/kotlin-js-store/yarn.lock

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions examples/imageviewer/webApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,6 @@ plugins {
id("org.jetbrains.compose")
}

val copyJsResources = tasks.create("copyJsResourcesWorkaround", Copy::class.java) {
from(project(":shared").file("src/commonMain/composeResources"))
into("build/processedResources/js/main")
}

tasks.withType<DefaultIncrementalSyncTask> {
dependsOn(copyJsResources)
}

val copyWasmResources = tasks.create("copyWasmResourcesWorkaround", Copy::class.java) {
from(project(":shared").file("src/commonMain/composeResources"))
into("build/processedResources/wasmJs/main")
}

afterEvaluate {
project.tasks.getByName("jsProcessResources").finalizedBy(copyJsResources)
project.tasks.getByName("wasmJsProcessResources").finalizedBy(copyWasmResources)
project.tasks.getByName("wasmJsDevelopmentExecutableCompileSync").dependsOn(copyWasmResources)
project.tasks.getByName("wasmJsProductionExecutableCompileSync").dependsOn(copyWasmResources)
}

val rootDirPath = project.rootDir.path

kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import com.example.jetsnack.ui.home.HomeSections
import kotlinx.coroutines.CoroutineScope

@Stable
@OptIn(kotlin.experimental.ExperimentalObjCRefinement::class)
@HiddenFromObjC // Remove after the bug is fixed: https://github.com/JetBrains/compose-multiplatform/issues/4848
actual class MppJetsnackAppState(
actual val scaffoldState: ScaffoldState,
actual val snackbarManager: SnackbarManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import androidx.compose.runtime.collectAsState
import com.example.jetsnack.model.OrderLine
import kotlinx.coroutines.flow.StateFlow

@OptIn(kotlin.experimental.ExperimentalObjCRefinement::class)
@HiddenFromObjC // Remove after the bug is fixed: https://github.com/JetBrains/compose-multiplatform/issues/4848
actual abstract class JetSnackCartViewModel actual constructor() {

@Composable
Expand Down
3 changes: 0 additions & 3 deletions examples/jetsnack/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ compose.version=1.6.10
# TODO: enable configuration cache once we update on kotlin 2.0
# see https://youtrack.jetbrains.com/issue/KT-64851 (k/wasm issue)
org.gradle.configuration-cache=false
MatkovIvan marked this conversation as resolved.
Show resolved Hide resolved

#Compose for Web is Experimental
org.jetbrains.compose.experimental.wasm.enabled=true
2 changes: 1 addition & 1 deletion examples/jetsnack/web/webpack.config.d/cleanupSourcemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

const outDir = __dirname + "/kotlin/"
const projecName = path.basename(__dirname);
const mapFile = outDir + projecName + ".map"
const mapFile = outDir + projecName + ".wasm.map"

const sourcemap = JSON.parse(fs.readFileSync(mapFile))
const sources = sourcemap["sources"]
Expand Down