Skip to content

Commit 08530fc

Browse files
Finish migrating build.gradle APIs
Summary: Some of the other APIs used in the build gradle have been deprecated and replaced with newer APIs. We should use those now that we have upgraded so many dependencies. Reviewed By: KylinChang Differential Revision: D69423564 fbshipit-source-id: c623a439f08f4f873a93b5a460d96b83f899464c
1 parent 3c7ebfa commit 08530fc

File tree

13 files changed

+73
-42
lines changed

13 files changed

+73
-42
lines changed

buildSrc/src/main/kotlin/Dependencies.kt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ object Config {
22
const val minSdk = 15
33
const val compileSdk = 34
44
const val targetSdk = 34
5+
const val buildToolsVersion = "35.0.0"
56
}
67

78
object Versions {

facebook-applinks/build.gradle.kts

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333
}
3434

3535
android {
36-
buildToolsVersion = "35.0.0"
36+
buildToolsVersion = Config.buildToolsVersion
3737
namespace = "com.facebook.applinks"
3838
compileSdk = Config.compileSdk
3939

@@ -44,7 +44,10 @@ android {
4444
consumerProguardFiles("proguard-rules.pro")
4545
}
4646

47-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
47+
sourceSets {
48+
getByName("test")
49+
{ java.srcDir("src/test/kotlin") }
50+
}
4851

4952
buildTypes {
5053
getByName("release") {

facebook-bolts/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies {
5050
}
5151

5252
android {
53-
buildToolsVersion = "35.0.0"
53+
buildToolsVersion = Config.buildToolsVersion
5454
namespace = "com.facebook.bolts"
5555
compileSdk = Config.compileSdk
5656

@@ -63,11 +63,11 @@ android {
6363

6464
buildTypes {
6565
getByName("debug") {
66-
isTestCoverageEnabled = true
66+
enableUnitTestCoverage = true
6767
}
6868
}
6969

70-
lintOptions { isAbortOnError = false }
70+
lint { abortOnError = false }
7171

7272
compileOptions {
7373
sourceCompatibility(JavaVersion.VERSION_1_8)
@@ -81,7 +81,10 @@ android {
8181
}
8282
}
8383

84-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
84+
sourceSets {
85+
getByName("test")
86+
{ java.srcDir("src/test/kotlin") }
87+
}
8588

8689
if (System.getenv("SANDCASTLE") == "1") {
8790
testOptions {

facebook-common/build.gradle.kts

+8-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ dependencies {
6060
}
6161

6262
android {
63-
buildToolsVersion = "35.0.0"
63+
buildToolsVersion = Config.buildToolsVersion
6464
namespace = "com.facebook.common"
6565
compileSdk = Config.compileSdk
6666

@@ -73,9 +73,9 @@ android {
7373
multiDexEnabled = true
7474
}
7575

76-
aaptOptions { additionalParameters("--no-version-vectors") }
76+
androidResources { additionalParameters("--no-version-vectors") }
7777

78-
lintOptions { isAbortOnError = false }
78+
lint { abortOnError = false }
7979

8080
compileOptions {
8181
sourceCompatibility(JavaVersion.VERSION_1_8)
@@ -89,10 +89,13 @@ android {
8989
unitTests.isIncludeAndroidResources = true
9090
}
9191

92-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
92+
sourceSets {
93+
getByName("test")
94+
{ java.srcDir("src/test/kotlin") }
95+
}
9396

9497
buildTypes {
95-
getByName("debug") { isTestCoverageEnabled = true }
98+
getByName("debug") { enableUnitTestCoverage = true }
9699
getByName("release") {
97100
isMinifyEnabled = false
98101
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")

facebook-core/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dependencies {
5959
}
6060

6161
android {
62-
buildToolsVersion = "35.0.0"
62+
buildToolsVersion = Config.buildToolsVersion
6363
namespace = "com.facebook.core"
6464
compileSdk = Config.compileSdk
6565

@@ -73,11 +73,11 @@ android {
7373

7474
buildTypes {
7575
getByName("debug") {
76-
isTestCoverageEnabled = true
76+
enableUnitTestCoverage = true
7777
}
7878
}
7979

80-
lintOptions { isAbortOnError = false }
80+
lint { abortOnError = false }
8181

8282
compileOptions {
8383
sourceCompatibility(JavaVersion.VERSION_1_8)
@@ -106,7 +106,10 @@ android {
106106
}
107107
}
108108
}
109-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
109+
sourceSets {
110+
getByName("test")
111+
{ java.srcDir("src/test/kotlin") }
112+
}
110113

111114
if (System.getenv("SANDCASTLE") == "1") {
112115
testOptions {

facebook-gamingservices/build.gradle.kts

+8-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies {
5555
}
5656

5757
android {
58-
buildToolsVersion = "35.0.0"
58+
buildToolsVersion = Config.buildToolsVersion
5959
namespace = "com.facebook.gamingservices"
6060
compileSdk = Config.compileSdk
6161

@@ -67,17 +67,17 @@ android {
6767
vectorDrawables.useSupportLibrary = true
6868
}
6969

70-
aaptOptions { additionalParameters("--no-version-vectors") }
70+
androidResources { additionalParameters("--no-version-vectors") }
7171

72-
lintOptions { isAbortOnError = false }
72+
lint { abortOnError = false }
7373

7474
compileOptions {
7575
sourceCompatibility(JavaVersion.VERSION_1_8)
7676
targetCompatibility(JavaVersion.VERSION_1_8)
7777
}
7878

7979
buildTypes {
80-
getByName("debug") { isTestCoverageEnabled = true }
80+
getByName("debug") { enableUnitTestCoverage = true }
8181
getByName("release") {
8282
isMinifyEnabled = false
8383
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
@@ -98,7 +98,10 @@ android {
9898
}
9999
}
100100

101-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
101+
sourceSets {
102+
getByName("test")
103+
{ java.srcDir("src/test/kotlin") }
104+
}
102105

103106
if (System.getenv("SANDCASTLE") == "1") {
104107
testOptions {

facebook-login/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies {
3535
}
3636

3737
android {
38-
buildToolsVersion = "35.0.0"
38+
buildToolsVersion = Config.buildToolsVersion
3939
namespace = "com.facebook.login"
4040
compileSdk = Config.compileSdk
4141

@@ -47,16 +47,19 @@ android {
4747
vectorDrawables.useSupportLibrary = true
4848
}
4949

50-
aaptOptions { additionalParameters("--no-version-vectors") }
50+
androidResources { additionalParameters("--no-version-vectors") }
5151

52-
lintOptions { isAbortOnError = false }
52+
lint { abortOnError = false }
5353

5454
compileOptions {
5555
sourceCompatibility(JavaVersion.VERSION_1_8)
5656
targetCompatibility(JavaVersion.VERSION_1_8)
5757
}
5858

59-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
59+
sourceSets {
60+
getByName("test")
61+
{ java.srcDir("src/test/kotlin") }
62+
}
6063

6164
buildTypes {
6265
getByName("release") {

facebook-messenger/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
}
3131

3232
android {
33-
buildToolsVersion = "35.0.0"
33+
buildToolsVersion = Config.buildToolsVersion
3434
namespace = "com.facebook.messenger"
3535
compileSdk = Config.compileSdk
3636

@@ -42,16 +42,19 @@ android {
4242
vectorDrawables.useSupportLibrary = true
4343
}
4444

45-
aaptOptions { additionalParameters("--no-version-vectors") }
45+
androidResources { additionalParameters("--no-version-vectors") }
4646

47-
lintOptions { isAbortOnError = false }
47+
lint { abortOnError = false }
4848

4949
compileOptions {
5050
sourceCompatibility(JavaVersion.VERSION_1_8)
5151
targetCompatibility(JavaVersion.VERSION_1_8)
5252
}
5353

54-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
54+
sourceSets {
55+
getByName("test")
56+
{ java.srcDir("src/test/kotlin") }
57+
}
5558

5659
buildTypes {
5760
getByName("release") {

facebook-share/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies {
3232
}
3333

3434
android {
35-
buildToolsVersion = "35.0.0"
35+
buildToolsVersion = Config.buildToolsVersion
3636
namespace = "com.facebook.share"
3737
compileSdk = Config.compileSdk
3838

@@ -44,16 +44,19 @@ android {
4444
vectorDrawables.useSupportLibrary = true
4545
}
4646

47-
aaptOptions { additionalParameters("--no-version-vectors") }
47+
androidResources { additionalParameters("--no-version-vectors") }
4848

49-
lintOptions { isAbortOnError = false }
49+
lint { abortOnError = false }
5050

5151
compileOptions {
5252
sourceCompatibility(JavaVersion.VERSION_1_8)
5353
targetCompatibility(JavaVersion.VERSION_1_8)
5454
}
5555

56-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
56+
sourceSets {
57+
getByName("test")
58+
{ java.srcDir("src/test/kotlin") }
59+
}
5760

5861
buildTypes {
5962
getByName("release") {

facebook-testutil/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies {
5050
}
5151

5252
android {
53-
buildToolsVersion = "35.0.0"
53+
buildToolsVersion = Config.buildToolsVersion
5454
namespace = "com.facebook"
5555
compileSdk = Config.compileSdk
5656

@@ -61,11 +61,14 @@ android {
6161
vectorDrawables.useSupportLibrary = true
6262
}
6363

64-
aaptOptions { additionalParameters("--no-version-vectors") }
64+
androidResources { additionalParameters("--no-version-vectors") }
6565

66-
lintOptions { isAbortOnError = false }
66+
lint { abortOnError = false }
6767

68-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
68+
sourceSets {
69+
getByName("test")
70+
{ java.srcDir("src/test/kotlin") }
71+
}
6972

7073
compileOptions {
7174
sourceCompatibility(JavaVersion.VERSION_1_8)

facebook/build.gradle.kts

+7-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dependencies {
6262
}
6363

6464
android {
65-
buildToolsVersion = "35.0.0"
65+
buildToolsVersion = Config.buildToolsVersion
6666
namespace = "com.facebook"
6767
compileSdk = Config.compileSdk
6868

@@ -74,9 +74,9 @@ android {
7474
vectorDrawables.useSupportLibrary = true
7575
}
7676

77-
aaptOptions { additionalParameters("--no-version-vectors") }
77+
androidResources { additionalParameters("--no-version-vectors") }
7878

79-
lintOptions { isAbortOnError = false }
79+
lint { abortOnError = false }
8080

8181
compileOptions {
8282
sourceCompatibility(JavaVersion.VERSION_1_8)
@@ -90,7 +90,10 @@ android {
9090
}
9191
}
9292

93-
sourceSets { named("test") { java.srcDir("src/test/kotlin") } }
93+
sourceSets {
94+
getByName("test")
95+
{ java.srcDir("src/test/kotlin") }
96+
}
9497

9598
if (System.getenv("SANDCASTLE") == "1") {
9699
testOptions {

samples/FBLoginSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ apply plugin: 'com.android.application'
1010
apply plugin: 'kotlin-android'
1111

1212
android {
13-
buildToolsVersion = "35.0.0"
13+
buildToolsVersion = Config.buildToolsVersion
1414
namespace = "com.facebook.fbloginsample"
1515
compileSdkVersion(31)
1616
defaultConfig {

samples/HelloFacebookSample/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies {
1515
}
1616

1717
android {
18-
buildToolsVersion = "35.0.0"
18+
buildToolsVersion = Config.buildToolsVersion
1919
namespace = "com.example.hellofacebook"
2020
compileSdkVersion(31)
2121

0 commit comments

Comments
 (0)