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
This commit is contained in:
Nicola Corti authored and Facebook GitHub Bot committed 2023-02-10 10:04:55 -08:00
1 parent 6439baaca1
commit b67a4ae90f
3 files changed
+9 -30

No files matched your search

+1 -6
View File
@@ -5,17 +5,12 @@
* LICENSE file in the root directory of this source tree.
*/
buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.hasProperty("kotlinVersion") ? rootProject.ext.kotlinVersion : KOTLIN_VERSION}"
}
}
plugins {
id("com.android.library")
id("com.facebook.react")
id("de.undercouch.download")
id("maven-publish")
id("org.jetbrains.kotlin.android")
}
import com.facebook.react.tasks.internal.*
-3
View File
@@ -30,8 +30,5 @@ FOLLY_VERSION=2021.07.22.00
GLOG_VERSION=0.3.5
LIBEVENT_VERSION=2.1.12
# Plugins Versions
KOTLIN_VERSION=1.6.10
android.useAndroidX=true
android.enableJetifier=true
+8 -21
View File
@@ -5,7 +5,13 @@
* LICENSE file in the root directory of this source tree.
*/
plugins { id("io.github.gradle-nexus.publish-plugin") version "1.1.0" }
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("com.android.library") version "7.4.1" apply false
id("com.android.application") version "7.4.1" apply false
id("de.undercouch.download") version "5.0.1" apply false
kotlin("android") version "1.6.10" apply false
}
val reactAndroidProperties = java.util.Properties()
@@ -25,19 +31,6 @@ group = "com.facebook.react"
val ndkPath by extra(System.getenv("ANDROID_NDK"))
val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION"))
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:7.4.1")
classpath("de.undercouch:gradle-download-task:5.0.1")
}
}
val sonatypeUsername = findProperty("SONATYPE_USERNAME")?.toString()
val sonatypePassword = findProperty("SONATYPE_PASSWORD")?.toString()
@@ -52,14 +45,8 @@ nexusPublishing {
allprojects {
repositories {
maven { url = uri("$rootDir/node_modules/jsc-android/dist") }
maven { url = uri("$rootDir/android") }
google()
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content { excludeGroup("com.facebook.react") }
}
mavenCentral()
}
}