fix: update libraries

This commit is contained in:
danilkinkin 2022-10-03 23:09:04 +04:00
parent c32fc3b36b
commit c7aa451fec
7 changed files with 58 additions and 276 deletions

View file

@ -9,12 +9,12 @@ plugins {
}
android {
compileSdk = libs.versions.compileSdk.get().toInt()
compileSdk = 33
defaultConfig {
applicationId = "com.danilkinkin.buckwheat"
minSdk = 26
targetSdk = libs.versions.targetSdk.get().toInt()
targetSdk = 33
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "com.danilkinkin.buckwheat.CustomTestRunner"
@ -60,72 +60,72 @@ android {
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
kotlinCompilerExtensionVersion = "1.3.0"
}
packagingOptions {
// Multiple dependency bring these files in. Exclude them to enable
// our test APK to build (has no effect on our AARs)
excludes += "/META-INF/AL2.0"
excludes += "/META-INF/LGPL2.1"
resources.excludes += "/META-INF/AL2.0"
resources.excludes += "/META-INF/LGPL2.1"
}
}
dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.android)
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.20")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.foundation.layout)
implementation(libs.androidx.compose.ui.util)
implementation(libs.androidx.compose.materialWindow)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.runtime.livedata)
debugImplementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material)
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.activity:activity-compose:1.6.0")
implementation("androidx.compose.runtime:runtime:1.2.1")
implementation("androidx.compose.foundation:foundation:1.2.1")
implementation("androidx.compose.foundation:foundation-layout:1.2.1")
implementation("androidx.compose.ui:ui-util:1.2.1")
implementation("androidx.compose.material3:material3-window-size-class:1.0.0-beta03")
implementation("androidx.compose.animation:animation:1.2.1")
implementation("androidx.compose.material:material-icons-extended:1.2.1")
implementation("androidx.compose.ui:ui-tooling-preview:1.2.1")
implementation("androidx.compose.runtime:runtime-livedata:1.2.1")
debugImplementation("androidx.compose.ui:ui-tooling:1.2.1")
implementation("androidx.navigation:navigation-compose:2.5.2")
implementation("androidx.compose.material3:material3:1.0.0-beta03")
implementation("androidx.compose.material:material:1.2.1")
implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("com.google.accompanist:accompanist-systemuicontroller:0.23.1")
implementation("com.google.accompanist:accompanist-systemuicontroller:0.25.1")
implementation(libs.androidx.room.runtime)
kapt(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
implementation("androidx.room:room-runtime:2.5.0-alpha03")
kapt("androidx.room:room-compiler:2.5.0-alpha03")
implementation("androidx.room:room-ktx:2.5.0-alpha03")
implementation("androidx.room:room-paging:2.4.3")
implementation("androidx.paging:paging-compose:1.0.0-alpha16")
implementation("com.google.dagger:dagger:2.43.2")
kapt("com.google.dagger:dagger-compiler:2.43.2")
implementation("com.google.dagger:dagger:2.44")
kapt("com.google.dagger:dagger-compiler:2.44")
implementation(libs.androidx.lifecycle.viewModelCompose)
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1")
implementation(libs.androidx.hilt.navigation.compose)
implementation(libs.hilt.android)
kapt(libs.hilt.compiler)
kapt(libs.hilt.ext.compiler)
implementation("androidx.hilt:hilt-navigation-compose:1.0.0")
implementation("com.google.dagger:hilt-android:2.44")
kapt("com.google.dagger:hilt-android-compiler:2.44")
kapt("androidx.hilt:hilt-compiler:1.0.0")
implementation(libs.coil.kt.compose)
implementation("io.coil-kt:coil-compose:2.2.2")
debugImplementation(libs.androidx.compose.ui.test.manifest)
debugImplementation("androidx.compose.ui:ui-test-manifest:1.2.1")
androidTestImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(libs.androidx.compose.ui.test)
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
androidTestImplementation(libs.hilt.android.testing)
coreLibraryDesugaring(libs.core.jdk.desugaring)
kaptAndroidTest(libs.hilt.compiler)
androidTestImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test:core:1.4.0")
androidTestImplementation("androidx.test:runner:1.4.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
androidTestImplementation("androidx.test:rules:1.4.0")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
androidTestImplementation("androidx.compose.ui:ui-test:1.2.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.2.1")
androidTestImplementation("com.google.dagger:hilt-android-testing:2.44")
kaptAndroidTest("com.google.dagger:hilt-android-compiler:2.44")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
}

View file

@ -12,7 +12,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.semantics.Role
@ -27,17 +26,16 @@ fun BigIconButton(
modifier: Modifier = Modifier,
enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
colors: IconButtonColors = IconButtonDefaults.iconButtonColors(
containerColor = Color.Transparent,
contentColor = contentColorFor(MaterialTheme.colorScheme.primaryContainer)
),
icon: Painter,
contentDescription: String?,
) {
val contentColor = contentColorFor(MaterialTheme.colorScheme.primaryContainer)
val disabledContentColor = contentColorFor(MaterialTheme.colorScheme.primaryContainer).copy(0.38f)
Box(
modifier = modifier
.padding(8.dp)
.background(color = colors.containerColor(enabled).value)
.background(color = if (enabled) contentColor else disabledContentColor)
.clickable(
onClick = onClick,
enabled = enabled,
@ -53,7 +51,7 @@ fun BigIconButton(
Icon(
modifier = Modifier.size(36.dp),
painter = icon,
tint = colors.contentColor(enabled).value,
tint = if (enabled) contentColor else disabledContentColor,
contentDescription = contentDescription,
)
}
@ -66,10 +64,6 @@ fun PreviewBigIconButton() {
BigIconButton(
icon = painterResource(R.drawable.ic_balance_wallet),
contentDescription = null,
colors = IconButtonDefaults.iconButtonColors(
containerColor = MaterialTheme.colorScheme.primaryContainer,
contentColor = contentColorFor(MaterialTheme.colorScheme.primaryContainer)
),
onClick = {},
)
}

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2019 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<resources>
<color name="ic_launcher_background">#5D1049</color>
</resources>

View file

@ -1,17 +0,0 @@
package com.danilkinkin.buckwheat
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

View file

@ -3,16 +3,14 @@ buildscript {
google()
mavenCentral()
if (!libs.versions.compose.snapshot.get().endsWith("SNAPSHOT")) {
maven { url = uri("https://androidx.dev/snapshots/builds/${libs.versions.compose.snapshot.get()}/artifacts/repository/") }
}
maven { url=uri("https://androidx.dev/snapshots/builds/-/artifacts/repository") }
}
dependencies {
classpath(libs.android.gradlePlugin)
classpath(libs.hilt.gradlePlugin)
classpath(libs.kotlin.gradlePlugin)
classpath(libs.spotless.gradlePlugin)
classpath(libs.secrets.gradlePlugin)
classpath("com.android.tools.build:gradle:7.2.2")
classpath("com.google.dagger:hilt-android-gradle-plugin:2.44")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
classpath("com.diffplug.spotless:spotless-plugin-gradle:6.11.0")
classpath("com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1")
}
}
@ -37,5 +35,3 @@ plugins {
id("com.github.ben-manes.versions") version "0.41.0"
id("nl.littlerobots.version-catalog-update") version "0.6.0"
}
apply("${project.rootDir}/buildscripts/toml-updater-config.gradle")

View file

@ -1,45 +0,0 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
versionCatalogUpdate {
sortByKey.set(true)
keep {
// keep versions without any library or plugin reference
keepUnusedVersions.set(true)
// keep all libraries that aren't used in the project
keepUnusedLibraries.set(true)
// keep all plugins that aren't used in the project
keepUnusedPlugins.set(true)
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
resolutionStrategy {
componentSelection {
all {
if (isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)) {
reject('Release candidate')
}
}
}
}
}

View file

@ -1,126 +0,0 @@
[versions]
accompanist = "0.25.1"
androidGradlePlugin = "7.2.2"
androidx-activity-compose = "1.5.1"
androidx-appcompat = "1.5.0"
androidx-benchmark = "1.1.0"
androidx-benchmark-junit4 = "1.1.0-beta04"
androidx-constraintlayout = "1.0.1"
androidx-corektx = "1.8.0"
androidx-lifecycle-compose = "2.5.1"
androidx-navigation = "2.5.1"
androidx-palette = "1.0.0"
androidx-test = "1.4.0"
androidx-test-espresso = "3.4.0"
androidx-test-ext-junit = "1.1.3"
androidx-test-ext-truth = "1.4.0"
androidx-window = "1.1.0-alpha03"
androidxHiltNavigationCompose = "1.0.0"
androix-test-uiautomator = "2.2.0"
coil = "2.2.0"
# @keep
compileSdk = "33"
compose = "1.2.1"
compose-compiler = "1.3.0"
# @pin to be updated manually - check JetChat tests
compose-material3 = "1.0.0-alpha15"
# @pin to be updated manually - check JetChat tests
compose-materialWindow = "1.0.0-alpha15"
compose-snapshot = "-"
coroutines = "1.6.4"
google-maps = "18.1.0"
hilt = "2.43.2"
hiltExt = "1.0.0"
# @pin When updating to AGP 7.3.0-beta03 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
jdkDesugar = "1.1.5"
junit = "4.13.2"
kotlin = "1.7.10"
maps-compose = "2.5.3"
material = "1.7.0-beta01"
# @keep
minSdk = "21"
okhttp = "4.10.0"
# @pin Bump to latest after Espresso 3.5.0 goes stable (due to https://github.com/robolectric/robolectric/issues/6593)
roboelectric = "4.5.1"
rome = "1.18.0"
room = "2.5.0-alpha02"
secrets = "2.0.1"
spotless = "6.9.1"
# @keep
targetSdk = "33"
[libraries]
accompanist-flowlayout = { module = "com.google.accompanist:accompanist-flowlayout", version.ref = "accompanist" }
accompanist-pager = { module = "com.google.accompanist:accompanist-pager", version.ref = "accompanist" }
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist" }
accompanist-swiperefresh = { module = "com.google.accompanist:accompanist-swiperefresh", version.ref = "accompanist" }
accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
android-gradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity-compose" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-benchmark-macrobenchmark = { module = "androidx.benchmark:benchmark-macro", version.ref = "androidx-benchmark" }
androidx-benchmark-macrobenchmark-junit4 = { module = "androidx.benchmark:benchmark-macro-junit4", version.ref = "androidx-benchmark-junit4" }
androidx-compose-animation = { module = "androidx.compose.animation:animation", version.ref = "compose" }
androidx-compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "compose" }
androidx-compose-material = { module = "androidx.compose.material:material", version.ref = "compose" }
androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
androidx-compose-materialWindow = { module = "androidx.compose.material3:material3-window-size-class", version.ref = "compose-materialWindow" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "compose" }
androidx-compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata", version.ref = "compose" }
androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
androidx-compose-ui-googlefonts = { module = "androidx.compose.ui:ui-text-google-fonts", version.ref = "compose" }
androidx-compose-ui-test = { module = "androidx.compose.ui:ui-test", version.ref = "compose" }
androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "compose" }
androidx-compose-ui-viewbinding = { module = "androidx.compose.ui:ui-viewbinding", version.ref = "compose" }
androidx-constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "androidx-constraintlayout" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-corektx" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "androidxHiltNavigationCompose" }
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle-compose" }
androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle-compose" }
androidx-lifecycle-viewModelCompose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle-compose" }
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle-compose" }
androidx-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "androidx-lifecycle-compose" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "androidx-navigation" }
androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "androidx-navigation" }
androidx-palette = { module = "androidx.palette:palette", version.ref = "androidx-palette" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
androidx-test-core = { module = "androidx.test:core", version.ref = "androidx-test" }
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" }
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-ext-junit" }
androidx-test-ext-truth = { module = "androidx.test.ext:truth", version.ref = "androidx-test-ext-truth" }
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" }
androidx-test-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androix-test-uiautomator" }
androidx-window = { module = "androidx.window:window", version.ref = "androidx-window" }
coil-kt-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
core-jdk-desugaring = { module = "com.android.tools:desugar_jdk_libs", version.ref = "jdkDesugar" }
google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
googlemaps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "maps-compose" }
googlemaps-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "google-maps" }
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" }
hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
hilt-ext-compiler = { module = "androidx.hilt:hilt-compiler", version.ref = "hiltExt" }
hilt-gradlePlugin = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "hilt" }
junit = { module = "junit:junit", version.ref = "junit" }
kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
okhttp3 = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "roboelectric" }
rometools-modules = { module = "com.rometools:rome-modules", version.ref = "rome" }
rometools-rome = { module = "com.rometools:rome", version.ref = "rome" }
secrets-gradlePlugin = { module = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin", version.ref = "secrets" }
spotless-gradlePlugin = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" }