[#30] Explicitly set the Compose compiler version
Also bump the Compose dependency to 1.0.4, in order to support Kotlin 1.5.31
This commit is contained in:
parent
cfe0c47652
commit
33588e4e66
|
@ -5,16 +5,11 @@ plugins {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
|
||||
implementation("com.android.tools.build:gradle:${getAndroidGradlePluginVersion()}")
|
||||
val rootProperties = getRootProperties()
|
||||
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProperties.getProperty("KOTLIN_VERSION")}")
|
||||
implementation("com.android.tools.build:gradle:${rootProperties.getProperty("ANDROID_GRADLE_PLUGIN_VERSION")}")
|
||||
}
|
||||
|
||||
fun getAndroidGradlePluginVersion(): String {
|
||||
// A slightly gross way to use the root gradle.properties as the single source of truth for version numbers
|
||||
val properties = run {
|
||||
val rootPropertiesFile = File(project.projectDir.parentFile, "gradle.properties")
|
||||
loadProperties(rootPropertiesFile.path)
|
||||
}
|
||||
|
||||
return properties.getProperty("ANDROID_GRADLE_PLUGIN_VERSION")
|
||||
}
|
||||
// A slightly gross way to use the root gradle.properties as the single source of truth for version numbers
|
||||
fun getRootProperties() = loadProperties(File(project.projectDir.parentFile, "gradle.properties").path)
|
|
@ -51,7 +51,8 @@ KTLINT_VERSION=0.42.1
|
|||
ANDROIDX_ACTIVITY_VERSION=1.3.1
|
||||
ANDROIDX_ANNOTATION_VERSION=1.2.0
|
||||
ANDROIDX_APPCOMPAT_VERSION=1.3.1
|
||||
ANDROIDX_COMPOSE_VERSION=1.0.2
|
||||
ANDROIDX_COMPOSE_VERSION=1.0.4
|
||||
ANDROIDX_COMPOSE_COMPILER_VERSION=1.1.0-alpha06
|
||||
ANDROIDX_CORE_VERSION=1.6.0
|
||||
ANDROIDX_ESPRESSO_VERSION=3.4.0
|
||||
ANDROIDX_LIFECYCLE_VERSION=2.4.0-rc01
|
||||
|
@ -62,8 +63,8 @@ ANDROIDX_TEST_ORCHESTRATOR_VERSION=1.4.1-alpha03
|
|||
ANDROIDX_UI_AUTOMATOR_VERSION=2.2.0-alpha1
|
||||
GOOGLE_MATERIAL_VERSION=1.4.0
|
||||
JACOCO_VERSION=0.8.7
|
||||
KOTLINX_COROUTINES_VERSION=1.5.1
|
||||
KOTLIN_VERSION=1.5.21
|
||||
KOTLINX_COROUTINES_VERSION=1.5.2
|
||||
KOTLIN_VERSION=1.5.31
|
||||
ZCASH_SDK_VERSION=1.3.0-beta18
|
||||
|
||||
# This shouldn't be changed, as Android doesn't support targets beyond Java 8
|
||||
|
|
|
@ -33,6 +33,7 @@ dependencyResolutionManagement {
|
|||
val androidxAnnotationVersion = extra["ANDROIDX_ANNOTATION_VERSION"].toString()
|
||||
val androidxAppcompatVersion = extra["ANDROIDX_APPCOMPAT_VERSION"].toString()
|
||||
val androidxComposeVersion = extra["ANDROIDX_COMPOSE_VERSION"].toString()
|
||||
val androidxComposeCompilerVersion = extra["ANDROIDX_COMPOSE_COMPILER_VERSION"].toString()
|
||||
val androidxCoreVersion = extra["ANDROIDX_CORE_VERSION"].toString()
|
||||
val androidxEspressoVersion = extra["ANDROIDX_ESPRESSO_VERSION"].toString()
|
||||
val androidxLifecycleVersion = extra["ANDROIDX_LIFECYCLE_VERSION"].toString()
|
||||
|
@ -48,7 +49,6 @@ dependencyResolutionManagement {
|
|||
val zcashSdkVersion = extra["ZCASH_SDK_VERSION"].toString()
|
||||
|
||||
// Standalone versions
|
||||
version("compose", androidxComposeVersion)
|
||||
version("jacoco", jacocoVersion)
|
||||
version("java", javaVersion)
|
||||
|
||||
|
@ -62,6 +62,7 @@ dependencyResolutionManagement {
|
|||
alias("androidx-compose-material-icons-core").to("androidx.compose.material:material-icons-core:$androidxComposeVersion")
|
||||
alias("androidx-compose-tooling").to("androidx.compose.ui:ui-tooling:$androidxComposeVersion")
|
||||
alias("androidx-compose-ui").to("androidx.compose.ui:ui:$androidxComposeVersion")
|
||||
alias("androidx-compose-compiler").to("androidx.compose.compiler:compiler:$androidxComposeCompilerVersion")
|
||||
alias("androidx-core").to("androidx.core:core-ktx:$androidxCoreVersion")
|
||||
alias("androidx-lifecycle-livedata").to("androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion")
|
||||
alias("androidx-viewmodel-compose").to("androidx.lifecycle:lifecycle-viewmodel-compose:$androidxLifecycleVersion")
|
||||
|
@ -89,6 +90,7 @@ dependencyResolutionManagement {
|
|||
"androidx-compose",
|
||||
listOf(
|
||||
"androidx-activity-compose",
|
||||
"androidx-compose-compiler",
|
||||
"androidx-compose-foundation",
|
||||
"androidx-compose-material",
|
||||
"androidx-compose-material-icons-core",
|
||||
|
|
|
@ -13,7 +13,7 @@ android {
|
|||
}
|
||||
|
||||
composeOptions {
|
||||
kotlinCompilerExtensionVersion = libs.versions.compose.get()
|
||||
kotlinCompilerExtensionVersion = libs.androidx.compose.compiler.get().versionConstraint.displayName
|
||||
}
|
||||
|
||||
// TODO [#6]: Figure out how to move this into the build-conventions
|
||||
|
|
Loading…
Reference in New Issue