Skip to content

Commit

Permalink
Update Kotlin, Compose, and Zipline (#1654)
Browse files Browse the repository at this point in the history
* Update Kotlin, Compose, and Zipline

* Use development version of AndroidX Compose compiler

We only use this for test apps.

* Track FIR changes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Wharton <[email protected]>
  • Loading branch information
renovate[bot] and JakeWharton authored Nov 2, 2023
1 parent 58f652b commit d300d58
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
kotlin = "1.9.10"
kotlin = "1.9.20"
kotlinx-coroutines = "1.7.3"
kotlinx-serialization = "1.6.0"
androidx-activity = "1.8.0"
jbCompose = "1.5.10"
lint = "31.1.1"
zipline = "1.4.0"
zipline = "1.5.0"
coil = "2.5.0"
okio = "3.6.0"

Expand Down Expand Up @@ -36,7 +36,7 @@ buildConfigPlugin = "com.github.gmazzo:gradle-buildconfig-plugin:3.1.0"
androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx.activity" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx.activity" }
androidx-appCompat = { module = "androidx.appcompat:appcompat", version = "1.6.1" }
androidx-compose-compiler = "androidx.compose.compiler:compiler:1.5.3"
androidx-compose-compiler = "androidx.compose.compiler:compiler:1.5.4-dev-k1.9.20-50f08dfa4b4"
androidx-core = { module = "androidx.core:core-ktx", version = "1.12.0" }
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version = "1.3.2" }
androidx-swipeRefreshLayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
Expand All @@ -46,7 +46,7 @@ androidx-test-uiautomator = "androidx.test.uiautomator:uiautomator:2.2.0"

google-material = { module = "com.google.android.material:material", version = "1.10.0" }

jetbrains-compose-compiler = "org.jetbrains.compose.compiler:compiler:1.5.2"
jetbrains-compose-compiler = "org.jetbrains.compose.compiler:compiler:1.5.3"
jetbrains-compose-gradlePlugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "jbCompose" }
jetbrains-compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "jbCompose" }
jetbrains-compose-material = { module = "org.jetbrains.compose.material:material", version.ref = "jbCompose" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import java.net.URLClassLoader
import org.jetbrains.kotlin.KtSourceElement
import org.jetbrains.kotlin.KtVirtualFileSourceFile
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY
import org.jetbrains.kotlin.cli.common.GroupedKtSources
import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoots
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.ERROR
Expand All @@ -34,7 +35,6 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.VfsBasedProjectEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.GroupedKtSources
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.ModuleCompilerEnvironment
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.ModuleCompilerInput
import org.jetbrains.kotlin.cli.jvm.compiler.pipeline.compileModuleToAnalyzedFir
Expand All @@ -56,15 +56,15 @@ import org.jetbrains.kotlin.fir.declarations.primaryConstructorIfAny
import org.jetbrains.kotlin.fir.declarations.utils.classId
import org.jetbrains.kotlin.fir.declarations.utils.isData
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
import org.jetbrains.kotlin.fir.expressions.FirArrayOfCall
import org.jetbrains.kotlin.fir.expressions.FirArrayLiteral
import org.jetbrains.kotlin.fir.expressions.FirConstExpression
import org.jetbrains.kotlin.fir.expressions.FirFunctionCall
import org.jetbrains.kotlin.fir.expressions.FirGetClassCall
import org.jetbrains.kotlin.fir.expressions.FirPropertyAccessExpression
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
import org.jetbrains.kotlin.fir.expressions.FirVarargArgumentsExpression
import org.jetbrains.kotlin.fir.expressions.arguments
import org.jetbrains.kotlin.fir.expressions.builder.toAnnotationArgumentMapping
import org.jetbrains.kotlin.fir.expressions.impl.FirResolvedArgumentList
import org.jetbrains.kotlin.fir.references.FirNamedReference
import org.jetbrains.kotlin.fir.resolve.fqName
import org.jetbrains.kotlin.fir.types.ConeTypeParameterType
Expand Down Expand Up @@ -556,7 +556,7 @@ private fun FirContext.findSchemaAnnotation(
?: return null

val membersArray = annotation.argumentMapping
.mapping[Name.identifier("members")] as? FirArrayOfCall
.mapping[Name.identifier("members")] as? FirArrayLiteral
?: throw AssertionError(annotation.source?.text)
val members = membersArray.argumentList
.arguments
Expand All @@ -571,12 +571,17 @@ private fun FirContext.findSchemaAnnotation(
}

val dependenciesArray = annotation.argumentMapping
.mapping[Name.identifier("dependencies")] as? FirArrayOfCall
.mapping[Name.identifier("dependencies")] as? FirArrayLiteral
val dependencies = dependenciesArray?.arguments.orEmpty()
.map {
val functionCall = it as? FirFunctionCall
?: throw AssertionError(annotation.source?.text)
val mapping = functionCall.argumentList.toAnnotationArgumentMapping().mapping
val mapping = (functionCall.argumentList as? FirResolvedArgumentList)
?.let { list ->
list.mapping.entries.associate { (argument, parameter) ->
parameter.name to argument
}
} ?: emptyMap()

@Suppress("UNCHECKED_CAST")
val tagExpression = mapping[Name.identifier("tag")] as? FirConstExpression<Int>
Expand Down
7 changes: 7 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ dependencyResolutionManagement {
repositories {
mavenCentral()
google()
// TODO Remove this once Google releases a 1.9.20-compatible Compose compiler.
maven {
url 'https://androidx.dev/storage/compose-compiler/repository'
content {
includeGroup('androidx.compose.compiler')
}
}
}
}

Expand Down

0 comments on commit d300d58

Please sign in to comment.