From 420f0016c646bf283c6c5346630a0f10f7234a43 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 9 May 2023 09:48:55 -0700 Subject: [PATCH] Hook Yoga's Gradle build into Gradle Enterprise Summary: This adds the setup necessary to hook Yoga into a Gradle Enterprise instance Reviewed By: mdvacca Differential Revision: D45694413 fbshipit-source-id: 766ea7e05f99ae347853dbe3817521379b4e44ba --- gradle/gradle-enterprise.gradle.kts.sample | 17 +++++++++++++++++ settings.gradle | 10 ---------- settings.gradle.kts | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 gradle/gradle-enterprise.gradle.kts.sample delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/gradle/gradle-enterprise.gradle.kts.sample b/gradle/gradle-enterprise.gradle.kts.sample new file mode 100644 index 00000000..91940e25 --- /dev/null +++ b/gradle/gradle-enterprise.gradle.kts.sample @@ -0,0 +1,17 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// You can use this script to configure the gradleEnterprise{} block in your build. +// You need to rename this file to ./gradle/gradle-enterprise.gradle.kts in order for +// this to be processed. +extensions.getByName("gradleEnterprise").withGroovyBuilder { + setProperty("server", "https://your-gradle-enterprise-instance.example.com") + getProperty("buildScan").withGroovyBuilder { + "publishAlways"() + "tag"(if(System.getenv("CI") != null) "CI" else "Local") + } +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 7fedecea..00000000 --- a/settings.gradle +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -include ':yoga', ':yoga-layout' -project(':yoga').projectDir = file('java') -project(':yoga-layout').projectDir = file('android') diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..6ecad0ff --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,20 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +plugins { id("com.gradle.enterprise").version("3.7.1") } + +include(":yoga", ":yoga-layout") +project(":yoga").projectDir = file("java") +project(":yoga-layout").projectDir = file("android") + +rootProject.name = "yoga-github" + +// If you specify a file inside gradle/gradle-enterprise.gradle.kts +// you can configure your custom Gradle Enterprise instance +if (file("./gradle/gradle-enterprise.gradle.kts").exists()) { + apply(from = "./gradle/gradle-enterprise.gradle.kts") +} \ No newline at end of file