From 4d1429cf72247db3201953d07eb89007d41863b0 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Thu, 13 Dec 2018 19:39:36 -0700 Subject: [PATCH] Make Pantheon behave as a submodule (#419) * version sniffing should be submodule aware --- build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index cb0c3397d6..41b2917a6f 100644 --- a/build.gradle +++ b/build.gradle @@ -411,6 +411,11 @@ def calculateVersion() { def getCheckedOutGitCommitHash() { def gitFolder = "$projectDir/.git/" + if (!file(gitFolder).isDirectory()) { + // We are in a submodule. The file's contents are `gitdir: \n`. + // Read the file, cut off the front, and trim the whitespace. + gitFolder = file(gitFolder).text.substring(8).trim() + "/" + } def takeFromHash = 8 /* * '.git/HEAD' contains either