Skip to content

Commit

Permalink
Update compileSdk, minSdk, and targetSdk Apis
Browse files Browse the repository at this point in the history
Summary:
As we are using a newer version of Gradle, we should use the latest available APIs in the build.gradle files.

Note: we have supressed the "UnstableApiUsage" lint warnings because these APIs are [safe to use](https://www.google.com/search?q=unstable+api+usage+lint+warning).

Reviewed By: KylinChang

Differential Revision: D69422721

fbshipit-source-id: cc90a2195b6a65de4ea29b5ea8482d21c274ef5b
  • Loading branch information
maxalbrightmeta authored and facebook-github-bot committed Feb 10, 2025
1 parent 129a7e4 commit 3c7ebfa
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 34 deletions.
6 changes: 4 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
* LICENSE file in the root directory of this source tree.
*/

import org.gradle.kotlin.dsl.`kotlin-dsl`

plugins { `kotlin-dsl` }
@file:Suppress("UnstableApiUsage")
plugins {
`kotlin-dsl`
}

repositories { mavenCentral() }
10 changes: 7 additions & 3 deletions facebook-applinks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand All @@ -32,11 +35,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.applinks"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
}

Expand Down
9 changes: 6 additions & 3 deletions facebook-bolts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -49,12 +52,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.bolts"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
}

Expand Down
9 changes: 6 additions & 3 deletions facebook-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -59,12 +62,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.common"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
Expand Down
9 changes: 6 additions & 3 deletions facebook-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -58,12 +61,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.core"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
multiDexEnabled = true
}
Expand Down
9 changes: 6 additions & 3 deletions facebook-gamingservices/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -54,12 +57,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.gamingservices"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
vectorDrawables.useSupportLibrary = true
}
Expand Down
10 changes: 7 additions & 3 deletions facebook-login/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -34,11 +37,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.login"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
vectorDrawables.useSupportLibrary = true
}
Expand Down
10 changes: 7 additions & 3 deletions facebook-messenger/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand All @@ -29,11 +32,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.messenger"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
vectorDrawables.useSupportLibrary = true
}
Expand Down
10 changes: 7 additions & 3 deletions facebook-share/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand All @@ -31,11 +34,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook.share"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-rules.pro")
vectorDrawables.useSupportLibrary = true
}
Expand Down
10 changes: 7 additions & 3 deletions facebook-testutil/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -49,11 +52,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
vectorDrawables.useSupportLibrary = true
}

Expand Down
10 changes: 7 additions & 3 deletions facebook/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


@file:Suppress("UnstableApiUsage")

plugins {
id("com.android.library")
id("kotlin-android")
Expand Down Expand Up @@ -61,11 +64,12 @@ dependencies {
android {
buildToolsVersion = "35.0.0"
namespace = "com.facebook"
compileSdkVersion(Config.compileSdk)
compileSdk = Config.compileSdk


defaultConfig {
minSdkVersion(Config.minSdk)
targetSdkVersion(Config.targetSdk)
minSdk = Config.minSdk
targetSdk = Config.targetSdk
consumerProguardFiles("proguard-project.txt")
vectorDrawables.useSupportLibrary = true
}
Expand Down
2 changes: 1 addition & 1 deletion samples/FBLoginSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
compileSdkVersion(31)
defaultConfig {
applicationId "com.facebook.fbloginsample"
minSdkVersion(Config.minSdk)
minSdk = Config.minSdk
targetSdkVersion(31)
versionCode 1
versionName "0.1"
Expand Down
2 changes: 1 addition & 1 deletion samples/HelloFacebookSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ android {

defaultConfig {
applicationId 'com.example.hellofacebook'
minSdkVersion(Config.minSdk)
minSdk = Config.minSdk
targetSdkVersion(31)
}

Expand Down

0 comments on commit 3c7ebfa

Please sign in to comment.