From 1f5c15d351024d11568acc05a505c9fff4643f9f Mon Sep 17 00:00:00 2001 From: Rick Busarow Date: Thu, 2 Nov 2023 00:30:06 -0500 Subject: [PATCH] replace the symlinked `gradle.properties` with manually-loaded Properties The symnlinked properties file caused issues with syncing in Windows. https://github.com/square/anvil/pull/763#discussion_r1379563691 --- gradle-plugin-build-logic/build.gradle | 12 ++++++++++++ gradle-plugin-build-logic/gradle.properties | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) delete mode 120000 gradle-plugin-build-logic/gradle.properties diff --git a/gradle-plugin-build-logic/build.gradle b/gradle-plugin-build-logic/build.gradle index 55c1f3816..e7ed9f730 100644 --- a/gradle-plugin-build-logic/build.gradle +++ b/gradle-plugin-build-logic/build.gradle @@ -7,3 +7,15 @@ java { languageVersion.set(JavaLanguageVersion.of(11)) } } + +// The :gradle-plugin project needs the `GROUP` and `VERSION_NAME` values +// from the main build's `gradle.properties`. We can't just use a symlink because Windows exists. +// https://github.com/square/anvil/pull/763#discussion_r1379563691 +Properties mainBuildProperties = new Properties().tap { props -> + file("../gradle.properties").withInputStream { stream -> + props.load(stream) + } +} +mainBuildProperties.each { key, value -> + ext[key.toString()] = value +} diff --git a/gradle-plugin-build-logic/gradle.properties b/gradle-plugin-build-logic/gradle.properties deleted file mode 120000 index 7677fb73b..000000000 --- a/gradle-plugin-build-logic/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -../gradle.properties \ No newline at end of file