Skip to content

Commit

Permalink
Do not use a mixture of plugins{} and buildscript{}
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cortinico authored and facebook-github-bot committed Feb 10, 2023
1 parent 6439baa commit b67a4ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
7 changes: 1 addition & 6 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down
3 changes: 0 additions & 3 deletions ReactAndroid/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 8 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand All @@ -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()
}
}

Expand Down

0 comments on commit b67a4ae

Please sign in to comment.