Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tynn committed Sep 3, 2024
1 parent 1ad8afc commit 94cea1a
Show file tree
Hide file tree
Showing 31 changed files with 146 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: gradle/wrapper-validation-action@v3
- uses: actions/setup-java@v4
with:
distribution: adopt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle/
.kotlin/
.idea/
.cxx/
build/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ A simple extension to inflate a `ViewBinding` with a parent `ViewGroup`.

## License

Copyright (C) 2020-2021 Christian Schmitz
Copyright (C) 2020-2023 Christian Schmitz

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 4 additions & 0 deletions binding/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ plugins {
}

android {
defaultConfig {
minSdk 21
}

buildFeatures {
androidResources true
viewBinding true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class BindingViewHolder<B : ViewBinding>(
* @param binding used as [BindingViewHolder.itemView]
* @param init function for the new [BindingViewHolder]
*/
@Suppress("FunctionName")
public inline fun <B : ViewBinding> BindingViewHolder(
binding: B,
crossinline init: BindingViewHolder<B>.() -> Unit,
Expand All @@ -46,7 +45,6 @@ public inline fun <B : ViewBinding> BindingViewHolder(
* @param bind to create the [ViewBinding]
* @param init function for the new [BindingViewHolder]
*/
@Suppress("FunctionName")
public inline fun <B : ViewBinding> BindingViewHolder(
itemView: View,
crossinline bind: (View) -> B,
Expand All @@ -62,7 +60,6 @@ public inline fun <B : ViewBinding> BindingViewHolder(
* @param inflate to create the [ViewBinding]
* @param init function for the new [BindingViewHolder]
*/
@Suppress("FunctionName")
public inline fun <B : ViewBinding> BindingViewHolder(
parent: ViewGroup,
crossinline inflate: (LayoutInflater, ViewGroup, Boolean) -> B,
Expand Down
5 changes: 5 additions & 0 deletions bitmap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ plugins {
alias libs.plugins.android
}


android {
defaultConfig {
minSdk 21
}

externalNativeBuild {
cmake.path "src/main/cpp/CMakeLists.txt"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
import static android.graphics.Bitmap.Config.ALPHA_8;
import static android.graphics.Bitmap.Config.ARGB_4444;
import static android.graphics.Bitmap.Config.ARGB_8888;
import static android.graphics.Bitmap.Config.RGBA_1010102;
import static android.graphics.Bitmap.Config.RGBA_F16;
import static android.graphics.Bitmap.Config.RGB_565;
import static android.graphics.Bitmap.createBitmap;
import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.O;
import static android.os.Build.VERSION_CODES.TIRAMISU;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
Expand All @@ -29,9 +34,9 @@ public void init_should_throw_on_unknown_format() {
new AndroidBitmapInfo(0, 0, 0, 5));
assertThrows(IllegalArgumentException.class, () ->
new AndroidBitmapInfo(0, 0, 0, 6));
assertThrows(IllegalArgumentException.class, () ->
if (SDK_INT < O) assertThrows(IllegalArgumentException.class, () ->
new AndroidBitmapInfo(0, 0, 0, 9));
assertThrows(IllegalArgumentException.class, () ->
if (SDK_INT < TIRAMISU) assertThrows(IllegalArgumentException.class, () ->
new AndroidBitmapInfo(0, 0, 0, 10));
assertThrows(IllegalArgumentException.class, () ->
new AndroidBitmapInfo(0, 0, 0, 11));
Expand All @@ -44,6 +49,10 @@ public void format_should_map_to_config() {
assertEquals(RGB_565, new AndroidBitmapInfo(0, 0, 0, 4).getFormat());
assertEquals(ARGB_4444, new AndroidBitmapInfo(0, 0, 0, 7).getFormat());
assertEquals(ALPHA_8, new AndroidBitmapInfo(0, 0, 0, 8).getFormat());
if (SDK_INT < O) return;
assertEquals(RGBA_F16, new AndroidBitmapInfo(0, 0, 0, 9).getFormat());
if (SDK_INT < TIRAMISU) return;
assertEquals(RGBA_1010102, new AndroidBitmapInfo(0, 0, 0, 10).getFormat());
}

@Test
Expand Down
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ subprojects {
project.apply plugin: 'maven-publish'

java.toolchain {
languageVersion.set JavaLanguageVersion.of(11)
}

android.compileOptions {
sourceCompatibility 11
targetCompatibility 11
languageVersion.set JavaLanguageVersion.of(17)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import kotlin.test.assertNull

internal class SavedStateHandleTest {

val state = SavedStateHandle()
private val state = SavedStateHandle()

@Test
fun `getValue should delegate to state`() {
val value: String? by state

state.set("value", "value")
state["value"] = "value"

assertEquals("value", value)
}
Expand All @@ -30,6 +30,6 @@ internal class SavedStateHandleTest {
value = "value"
assertNotNull(value)

assertEquals("value", state.get("value"))
assertEquals("value", state["value"])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import kotlin.test.assertNull

internal class SharedPreferencesTest {

val key = "key"

val prefs = InMemorySharedPreferences(false)
private val key = "key"
private val prefs = InMemorySharedPreferences(false)

@Test
@Suppress("KotlinConstantConditions")
fun `boolean should read and write boolean values`() {
var prop by prefs.boolean(key, false)
assertEquals(false, prop)
Expand All @@ -45,6 +45,7 @@ internal class SharedPreferencesTest {
}

@Test
@Suppress("KotlinConstantConditions")
fun `nullableEnum should read and write enum values`() {
var prop by prefs.nullableEnum<TestEnum>(key)
assertNull(prop)
Expand Down Expand Up @@ -88,6 +89,7 @@ internal class SharedPreferencesTest {
}

@Test
@Suppress("KotlinConstantConditions")
fun `nullableString should read and write long values`() {
var prop by prefs.nullableString(key)
assertNull(prop)
Expand All @@ -111,6 +113,7 @@ internal class SharedPreferencesTest {
}

@Test
@Suppress("KotlinConstantConditions")
fun `nullableStringSet should read and write long values`() {
var prop by prefs.nullableStringSet(key)
assertNull(prop)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import kotlin.test.assertFailsWith

internal class SharedPreferencesFlowTest {

val key = "key"
val prefs = InMemorySharedPreferences(false)
private val key = "key"
private val prefs = InMemorySharedPreferences(false)

@Test
fun `asBooleanFlow should emit all changes`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlin.test.assertFailsWith

internal class SharedPreferencesTest {

val prefs = InMemorySharedPreferences(false)
private val prefs = InMemorySharedPreferences(false)

@Test
fun `getBooleanFlow should emit all changes`() {
Expand Down
38 changes: 18 additions & 20 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
[versions]
kotlin = "1.9.22"
kotlin = "2.0.20"

[plugins]
android = "com.android.library:8.2.2"
android = "com.android.library:8.6.0"
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
conventions = "xyz.tynn.convention.project:0.0.5"

[libraries]
androidx-annotation = "androidx.annotation:annotation:1.7.1"
androidx-core = "androidx.core:core:1.12.0"
androidx-core-ktx = "androidx.core:core-ktx:1.12.0"
androidx-datastore = "androidx.datastore:datastore:1.0.0"
androidx-fragment = "androidx.fragment:fragment:1.6.2"
androidx-lifecycle-savedstate = "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.7.0"
androidx-annotation = "androidx.annotation:annotation:1.8.2"
androidx-core = "androidx.core:core:1.13.1"
androidx-core-ktx = "androidx.core:core-ktx:1.13.1"
androidx-datastore = "androidx.datastore:datastore:1.1.1"
androidx-fragment = "androidx.fragment:fragment:1.8.2"
androidx-lifecycle-savedstate = "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.8.4"
androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.2"
androidx-room-runtime = "androidx.room:room-runtime:2.6.1"
androidx-test-core = "androidx.test:core:1.5.0"
androidx-test-runner = "androidx.test:runner:1.5.2"
gson = "com.google.code.gson:gson:2.10.1"
androidx-test-core = "androidx.test:core:1.6.1"
androidx-test-runner = "androidx.test:runner:1.6.2"
gson = "com.google.code.gson:gson:2.11.0"
kotlin-reflect.module = "org.jetbrains.kotlin:kotlin-reflect"
kotlin-stdlib.module = "org.jetbrains.kotlin:kotlin-stdlib"
kotlin-test.module = "org.jetbrains.kotlin:kotlin-test"
kotlinx-coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"
kotlinx-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
kotlinx-serialization-protobuf = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.6.3"
kotlinx-coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0-RC.2"
kotlinx-serialization-json = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2"
kotlinx-serialization-protobuf = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.7.2"
junit = 'junit:junit:4.13.2'
mockk = 'io.mockk:mockk:1.13.9'
mockk = 'io.mockk:mockk:1.13.12'
moshi = "com.squareup.moshi:moshi:1.15.1"
moshi-kotlin = "com.squareup.moshi:moshi-kotlin:1.15.1"
robolectric = "org.robolectric:robolectric:4.11.1"
threeten-abp = "com.jakewharton.threetenabp:threetenabp:1.4.6"
threeten-bp = "org.threeten:threetenbp:1.6.8"
robolectric = "org.robolectric:robolectric:4.13"
threeten-abp = "com.jakewharton.threetenabp:threetenabp:1.4.7"
threeten-bp = "org.threeten:threetenbp:1.6.9"

[bundles]
android-test = ["androidx-test-runner", "junit"]
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@ import androidx.core.content.getSystemService
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsCompat.Type.ime
import androidx.core.view.WindowInsetsCompat.toWindowInsetsCompat
import io.mockk.*
import io.mockk.clearMocks
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import io.mockk.mockkStatic
import io.mockk.runs
import io.mockk.slot
import io.mockk.spyk
import io.mockk.unmockkStatic
import io.mockk.verify
import io.mockk.verifyAll
import kotlin.test.AfterTest
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertFailsWith

internal class KeyboardVisibilityTest {

val activity = mockk<Activity> {
private val activity = mockk<Activity> {
every {
window.attributes
} returns mockk(relaxed = true)
Expand All @@ -35,16 +45,16 @@ internal class KeyboardVisibilityTest {
} just runs
}

val imm = mockk<InputMethodManager>(relaxed = true)
private val imm = mockk<InputMethodManager>(relaxed = true)

val listener = mockk<(Boolean) -> Unit>(relaxed = true)
val focusListener = slot<ViewTreeObserver.OnGlobalFocusChangeListener>()
private val focusListener = slot<ViewTreeObserver.OnGlobalFocusChangeListener>()

val view = mockk<View>(relaxed = true)
val insets = mockk<WindowInsets>(relaxed = true)
val insetsCompat = mockk<WindowInsetsCompat>(relaxed = true)
private val view = mockk<View>(relaxed = true)
private val insets = mockk<WindowInsets>(relaxed = true)
private val insetsCompat = mockk<WindowInsetsCompat>(relaxed = true)

val insetsListener = slot<OnApplyWindowInsetsListener>()
private val insetsListener = slot<OnApplyWindowInsetsListener>()

@BeforeTest
fun setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ internal typealias T = Pair<String, String>

internal class DiffUtilItemCallbackTest {

val value1 = "value" to "1"
val value2 = "value" to "2"
val value3 = "value" to "1"
private val value1 = "value" to "1"
private val value2 = "value" to "2"
private val value3 = "value" to "1"

@Test
fun `DiffUtilItemCallback should compare items and contents with equals`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import kotlin.test.Test

internal class ViewHolderTest {

val view = mockk<View>(relaxed = true)
val viewHolder = object : ViewHolder(view) {}
private val view = mockk<View>(relaxed = true)
private val viewHolder = object : ViewHolder(view) {}

@Test
fun `context should delegate to itemView context`() {
Expand Down
1 change: 0 additions & 1 deletion storage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
alias libs.plugins.android
alias libs.plugins.kotlin.android
alias libs.plugins.kotlin.serialization
id 'org.jetbrains.kotlin.kapt'
}

android {
Expand Down
Loading

0 comments on commit 94cea1a

Please sign in to comment.