Skip to content

Commit

Permalink
chore: bump library native Android deps & config (#1891)
Browse files Browse the repository at this point in the history
## Description

~Won't merge it RN as recent versions of these libraries require sdk >=
33 while current RN setup (clean app) requires >= 31.~

While the statement above holds true new context emerged: since August
2023 all Android apps have to target sdk >= 33
([link](https://developer.android.com/google/play/requirements/target-sdk))

Thus this should not be a problem. 

## Changes

* Bumped default Kotlin version to `1.8.22` in example apps
* Bumped default Kotlin version to `1.8.0` in lib (this aligns it with
RN 0.73 template)
* Bumped default target & compile target to 34 (notice that this is the
default value used by the library, this can be overriden by user in
application build.gradle)
* Bumped series of lib depenencies (Android ones) to decently recent
versions.



## Test code and steps to reproduce

Ci works

## Checklist

- [x] Ensured that CI passes
  • Loading branch information
kkafar authored Sep 26, 2023
1 parent f99b857 commit a87885b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "23.1.7779620"
kotlinVersion = "1.6.21"
kotlinVersion = "1.8.22"
}
repositories {
google()
Expand Down
1 change: 1 addition & 0 deletions FabricExample/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
kotlinVersion = "1.8.22"
}
repositories {
google()
Expand Down
1 change: 1 addition & 0 deletions FabricTestExample/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ buildscript {

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
kotlinVersion = "1.8.22"
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion TestsExample/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
kotlinVersion = "1.6.21"
kotlinVersion = "1.8.22"
}
repositories {
google()
Expand Down
24 changes: 13 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import com.android.Version

buildscript {
ext {
rnsDefaultTargetSdkVersion = 31
rnsDefaultCompileSdkVersion = 31
rnsDefaultTargetSdkVersion = 34
rnsDefaultCompileSdkVersion = 34
rnsDefaultMinSdkVersion = 21
rnsDefaultKotlinVersion = '1.6.21'
rnsDefaultKotlinVersion = '1.8.0'
}
ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
Expand All @@ -15,7 +17,7 @@ buildscript {
dependencies {
classpath('com.android.tools.build:gradle:4.2.2')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', rnsDefaultKotlinVersion)}"
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.15.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.11.0"
}
}

Expand Down Expand Up @@ -45,7 +47,7 @@ def reactNativeArchitectures() {

android {
compileSdkVersion safeExtGet('compileSdkVersion', rnsDefaultCompileSdkVersion)
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
def agpVersion = Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.swmansion.rnscreens"
}
Expand Down Expand Up @@ -122,10 +124,10 @@ repositories {

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.fragment:fragment:1.2.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation "androidx.core:core-ktx:1.5.0"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.fragment:fragment-ktx:1.6.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.google.android.material:material:1.9.0'
implementation "androidx.core:core-ktx:1.10.1"
}
2 changes: 1 addition & 1 deletion android/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'com.diffplug.spotless'
spotless {
kotlin {
target 'src/**/*.kt'
ktlint("0.40.0")
ktlint("0.43.0")
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
Expand Down

0 comments on commit a87885b

Please sign in to comment.