File tree Expand file tree Collapse file tree
src/main/groovy/com/cinnober/gradle/semver_git Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,13 +29,13 @@ import org.gradle.api.Plugin
2929
3030class SemverGitPlugin implements Plugin<Project > {
3131
32- def static String getGitVersion (String nextVersion , String snapshotSuffix ) {
33- def proc = " git describe --exact-match" . execute();
32+ def static String getGitVersion (String nextVersion , String snapshotSuffix , File projectDir = null ) {
33+ def proc = " git describe --exact-match" . execute(null , projectDir );
3434 proc. waitFor();
3535 if (proc. exitValue() == 0 ) {
3636 return checkVersion(proc. text. trim());
3737 }
38- proc = " git describe" . execute();
38+ proc = " git describe" . execute(null , projectDir );
3939 proc. waitFor();
4040 if (proc. exitValue() == 0 ) {
4141 def describe = proc. text. trim()
@@ -111,7 +111,7 @@ class SemverGitPlugin implements Plugin<Project> {
111111 if (project. ext. properties. containsKey(" snapshotSuffix" )) {
112112 snapshotSuffix = project. ext. snapshotSuffix
113113 }
114- project. version = getGitVersion(nextVersion, snapshotSuffix)
114+ project. version = getGitVersion(nextVersion, snapshotSuffix, project . projectDir )
115115 project. task(' showVersion' ) {
116116 group = ' Help'
117117 description = ' Show the project version'
You can’t perform that action at this time.
0 commit comments