mirror of
https://github.com/JakeWharton/mosaic.git
synced 2025-11-02 04:36:19 +08:00
Update to Compose alpha08
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
buildscript {
|
||||
ext.versions = [
|
||||
'compose': '1.0.0-alpha07',
|
||||
'compose': '1.0.0-alpha08',
|
||||
'kotlin': '1.4.20',
|
||||
'kotlinxCoroutines': '1.4.1',
|
||||
]
|
||||
ext.deps = [
|
||||
'composeCompiler': "androidx.compose.compiler:compiler:${versions.compose}",
|
||||
'kotlinGradlePlugin': 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10',
|
||||
'kotlinGradlePlugin': "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
|
||||
'kotlinxCoroutinesCore': "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinxCoroutines}",
|
||||
'junit': 'junit:junit:4.13.1',
|
||||
'truth': 'com.google.truth:truth:1.1',
|
||||
]
|
||||
|
||||
@ -17,7 +17,7 @@ sourceSets {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
|
||||
api deps.kotlinxCoroutinesCore
|
||||
api 'org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.3'
|
||||
|
||||
kotlinPlugin deps.composeCompiler
|
||||
@ -43,8 +43,18 @@ if (!file('upstream/.git').exists()) {
|
||||
"Missing 'upstream' git submodule clone. Did you run 'git submodule update --init'?")
|
||||
}
|
||||
|
||||
def upstreamVersions = file('upstream/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt').text
|
||||
if (!upstreamVersions.contains("val COMPOSE = Version(\"${versions.compose}\")")) {
|
||||
def upstreamLibraryVersions = file('upstream/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt').text
|
||||
if (!upstreamLibraryVersions.contains("val COMPOSE = Version(System.getenv(\"COMPOSE_CUSTOM_VERSION\") ?: \"${versions.compose}\")")) {
|
||||
throw new RuntimeException(
|
||||
"Upstream git repository Compose version does not match dependency version ${versions.compose}")
|
||||
"Upstream git repository Compose version does not match project dependency version ${versions.compose}")
|
||||
}
|
||||
|
||||
def upstreamDependencyVersions = file('upstream/buildSrc/build_dependencies.gradle').text
|
||||
if (!upstreamDependencyVersions.contains("build_versions.kotlin = \"${versions.kotlin}\"")) {
|
||||
throw new RuntimeException(
|
||||
"Upstream git repository Kotlin version does not match project dependency version ${versions.kotlin}")
|
||||
}
|
||||
if (!upstreamDependencyVersions.contains("build_versions.kotlin_coroutines = \"${versions.kotlinxCoroutines}\"")) {
|
||||
throw new RuntimeException(
|
||||
"Upstream git repository Kotlin coroutines version does not match project dependency version ${versions.kotlinxCoroutines}")
|
||||
}
|
||||
|
||||
Submodule compose/upstream updated: 358bdaf3c3...10b5e9fd36
@ -1,6 +1,6 @@
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20'
|
||||
classpath "com.jakewharton.mosaic:gradle:${mosaicVersion}"
|
||||
}
|
||||
repositories {
|
||||
|
||||
@ -94,7 +94,7 @@ fun CoroutineScope.createMosaic(): Mosaic {
|
||||
val rootNode = BoxNode()
|
||||
val applier = MosaicNodeApplier(rootNode)
|
||||
|
||||
val recomposer = Recomposer(composeContext, embeddingContext)
|
||||
val recomposer = Recomposer(composeContext)
|
||||
val composition = compositionFor(Any(), applier, recomposer)
|
||||
|
||||
// Start undispatched to ensure we can use suspending things inside the content.
|
||||
|
||||
Reference in New Issue
Block a user