Skip to content

Commit b67a4ae

Browse files
cortinicofacebook-github-bot
authored andcommitted
Do not use a mixture of plugins{} and buildscript{}
Summary: In our build logic we're mixing `plugins{}` and `buildscript{}` which have unpredictable side-effect on the build classpath. I'm moving over everything to use `plugins{}`. This is possible now that we don't use build from source for New Architecture anymore. Changelog: [Internal] [Changed] - Do not use a mixture of plugins{} and buildscript{} allow-large-files Reviewed By: cipolleschi Differential Revision: D43186768 fbshipit-source-id: dcd115bd9d7aadf5cb837b3a28598e274a092873
1 parent 6439baa commit b67a4ae

File tree

3 files changed

+9
-30
lines changed

3 files changed

+9
-30
lines changed

ReactAndroid/build.gradle

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
buildscript {
9-
dependencies {
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.hasProperty("kotlinVersion") ? rootProject.ext.kotlinVersion : KOTLIN_VERSION}"
11-
}
12-
}
13-
148
plugins {
159
id("com.android.library")
1610
id("com.facebook.react")
1711
id("de.undercouch.download")
1812
id("maven-publish")
13+
id("org.jetbrains.kotlin.android")
1914
}
2015

2116
import com.facebook.react.tasks.internal.*

ReactAndroid/gradle.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@ FOLLY_VERSION=2021.07.22.00
3030
GLOG_VERSION=0.3.5
3131
LIBEVENT_VERSION=2.1.12
3232

33-
# Plugins Versions
34-
KOTLIN_VERSION=1.6.10
35-
3633
android.useAndroidX=true
3734
android.enableJetifier=true

build.gradle.kts

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
plugins { id("io.github.gradle-nexus.publish-plugin") version "1.1.0" }
8+
plugins {
9+
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
10+
id("com.android.library") version "7.4.1" apply false
11+
id("com.android.application") version "7.4.1" apply false
12+
id("de.undercouch.download") version "5.0.1" apply false
13+
kotlin("android") version "1.6.10" apply false
14+
}
915

1016
val reactAndroidProperties = java.util.Properties()
1117

@@ -25,19 +31,6 @@ group = "com.facebook.react"
2531

2632
val ndkPath by extra(System.getenv("ANDROID_NDK"))
2733
val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION"))
28-
29-
buildscript {
30-
repositories {
31-
google()
32-
mavenCentral()
33-
gradlePluginPortal()
34-
}
35-
dependencies {
36-
classpath("com.android.tools.build:gradle:7.4.1")
37-
classpath("de.undercouch:gradle-download-task:5.0.1")
38-
}
39-
}
40-
4134
val sonatypeUsername = findProperty("SONATYPE_USERNAME")?.toString()
4235
val sonatypePassword = findProperty("SONATYPE_PASSWORD")?.toString()
4336

@@ -52,14 +45,8 @@ nexusPublishing {
5245

5346
allprojects {
5447
repositories {
55-
maven { url = uri("$rootDir/node_modules/jsc-android/dist") }
56-
maven { url = uri("$rootDir/android") }
5748
google()
58-
mavenCentral {
59-
// We don't want to fetch react-native from Maven Central as there are
60-
// older versions over there.
61-
content { excludeGroup("com.facebook.react") }
62-
}
49+
mavenCentral()
6350
}
6451
}
6552

0 commit comments

Comments
 (0)