From 61c5890f7fc62abbf59ec3a26793c5f539b9cd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Schr=C3=B6der?= Date: Tue, 24 Jun 2014 12:36:18 +0200 Subject: [PATCH] load git repo from projectDir instead of current working directory If the gradle project using the gitrelease plugin is not accessed from the command line inside the gradle project it fails with an exception as it cannot figure out what the git repository is. This fix uses the projects projectDir as a starting point in finding the git repository. This might cause issues if someone relied on this feature and used the gitrelease plugin without having the working directory being the projects checked out git repository. This fix allows gradle projects using the gitrelease to be imported into IntelliJ directly with the built-in gradle support. --- src/main/groovy/no/entitas/gradle/git/GitReleasePlugin.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/no/entitas/gradle/git/GitReleasePlugin.groovy b/src/main/groovy/no/entitas/gradle/git/GitReleasePlugin.groovy index 4e55726..b5858a9 100644 --- a/src/main/groovy/no/entitas/gradle/git/GitReleasePlugin.groovy +++ b/src/main/groovy/no/entitas/gradle/git/GitReleasePlugin.groovy @@ -23,7 +23,7 @@ import org.gradle.api.Project class GitReleasePlugin extends ReleasePlugin { def Version createVersion(Project project) { def repository = new RepositoryBuilder().setMustExist(true). - findGitDir(new File('.').absoluteFile).build(); + findGitDir(project.projectDir.absoluteFile).build(); return new GitVersion(project, repository); }