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