Skip to content

Commit

Permalink
Consoliate Android SDK version inside the Version Catalog (#38949)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #38949

I've done another pass and moved all the compileSdk/minSdk/targetSdk and buildToolVersion in a single place so that we can easily bump one for all the projects.

Changelog:
[Internal] [Changed] - Consoliate Android SDK version inside the Version Catalog

Reviewed By: cipolleschi

Differential Revision: D48263891

fbshipit-source-id: 84a5623869042b12bda0d3ee9e132d20fbc0e9d4
  • Loading branch information
cortinico authored and facebook-github-bot committed Aug 11, 2023
1 parent 6696147 commit a878fcc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
8 changes: 4 additions & 4 deletions packages/react-native/ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ repositories {
}

android {
compileSdk 33
buildToolsVersion = "33.0.1"
compileSdk libs.versions.compileSdk.get().toInteger()
buildToolsVersion = libs.versions.buildTools.get()
namespace "com.facebook.react"

// Used to override the NDK path/version on internal CI or by allowing
Expand All @@ -494,8 +494,8 @@ android {
}

defaultConfig {
minSdk = 21
targetSdk = 33
minSdk = libs.versions.minSdk.get().toInteger()
targetSdk = libs.versions.targetSdk.get().toInteger()
versionCode(1)
versionName("1.0")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ repositories {
}

android {
compileSdk = 33
buildToolsVersion = "33.0.1"
compileSdk = libs.versions.compileSdk.get().toInt()
buildToolsVersion = libs.versions.buildTools.get()
namespace = "com.facebook.react.flipper"

defaultConfig { minSdk = 21 }
defaultConfig { minSdk = libs.versions.minSdk.get().toInt() }

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native/ReactAndroid/hermes-engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ repositories {
}

android {
compileSdk 33
buildToolsVersion = "33.0.1"
compileSdk libs.versions.compileSdk.get().toInteger()
buildToolsVersion = libs.versions.buildTools.get()
namespace "com.facebook.hermes"

// Used to override the NDK path/version on internal CI or by allowing
Expand All @@ -175,7 +175,7 @@ android {
}

defaultConfig {
minSdk = 21
minSdk = libs.versions.minSdk.get().toInteger()

externalNativeBuild {
cmake {
Expand Down
6 changes: 6 additions & 0 deletions packages/react-native/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[versions]
# Android versions
minSdk = "21"
targetSdk = "33"
compileSdk = "33"
buildTools = "33.0.1"
# Dependencies versions
agp = "8.1.0"
androidx-annotation = "1.6.0"
androidx-appcompat = "1.6.1"
Expand Down
8 changes: 4 additions & 4 deletions packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ repositories {
}

android {
compileSdk 33
buildToolsVersion = "33.0.1"
compileSdk libs.versions.compileSdk.get().toInteger()
buildToolsVersion = libs.versions.buildTools.get()
namespace "com.facebook.react.uiapp"

// Used to override the NDK path/version on internal CI or by allowing
Expand All @@ -117,8 +117,8 @@ android {

defaultConfig {
applicationId "com.facebook.react.uiapp"
minSdk = 21
targetSdk = 33
minSdk = libs.versions.minSdk.get().toInteger()
targetSdk = libs.versions.targetSdk.get().toInteger()
versionCode 1
versionName "1.0"
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
Expand Down

0 comments on commit a878fcc

Please sign in to comment.