Update to Compose alpha08

This commit is contained in:
Jake Wharton
2020-12-04 23:27:02 -05:00
parent 38edc191ae
commit 0bd92a88c9
5 changed files with 22 additions and 9 deletions

View File

@ -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',
]

View File

@ -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}")
}

View File

@ -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 {

View File

@ -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.