From 186f4d318d8c653f7235735e0e82ad959abfd563 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 31 May 2023 14:48:05 -0700 Subject: [PATCH] Update project to use Gradle's plugins{} block Summary: This project was still using the legacy Gradle's "apply:" syntax to apply Gradle Plugins. I'm changing it here to use instead the `plugins{}` block as it make easier to apply other plugins for publishing later. Reviewed By: mdvacca Differential Revision: D46330014 fbshipit-source-id: 5483a717a62d5ab76749026c5203dc96a35d73e7 --- android/build.gradle | 4 +++- build.gradle | 15 +++------------ java/build.gradle | 5 +++-- sample/build.gradle | 4 +++- settings.gradle.kts | 8 ++++++++ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 69c25093..3f2f5014 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,7 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -apply plugin: 'com.android.library' +plugins { + id("com.android.library") +} android { namespace 'com.facebook.yoga.android' diff --git a/build.gradle b/build.gradle index 9679360e..32d03247 100644 --- a/build.gradle +++ b/build.gradle @@ -5,18 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.0.1' - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } +plugins { + id("com.android.library") version "8.0.1" apply false + id("com.android.application") version "8.0.1" apply false } allprojects { diff --git a/java/build.gradle b/java/build.gradle index 83e14674..e7d59c5c 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -5,8 +5,9 @@ * LICENSE file in the root directory of this source tree. */ - -apply plugin: 'com.android.library' +plugins { + id("com.android.library") +} android { namespace 'com.facebook.yoga' diff --git a/sample/build.gradle b/sample/build.gradle index 63fc1c1f..c5399fe0 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -5,7 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -apply plugin: 'com.android.application' +plugins { + id("com.android.application") +} android { namespace 'com.facebook.yoga.sample' diff --git a/settings.gradle.kts b/settings.gradle.kts index ab788d30..bc041b3f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,6 +5,14 @@ * LICENSE file in the root directory of this source tree. */ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + google() + } +} + plugins { id("com.gradle.enterprise").version("3.7.1") } include(":sample", ":yoga", ":yoga-layout")