Skip to content

Commit

Permalink
Merge branch 'a1dutch-eclipse-import'
Browse files Browse the repository at this point in the history
  • Loading branch information
dilipkrish committed Aug 3, 2019
2 parents f303819 + 28a97c1 commit b10030b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ out/
*.hprof
node_modules/
package-lock.json
.eclipse/
bin/
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class BuildInfoFactory {
def isReleaseBuild = project.gradle.startParameter.taskNames.contains("release")

SemanticVersion buildVersion = versioningStrategy.buildVersion(releaseType, isReleaseBuild)
project.logger.lifecycle("[RELEASE] current verison: ${versioningStrategy.current()}, " +
project.logger.lifecycle("[RELEASE] current verison: ${versioningStrategy.current(project)}, " +
"build version: $buildVersion, dryRun: $dryRun, releaseBuild: $isReleaseBuild")
new BuildInfo(
versioningStrategy.current(),
versioningStrategy.current(project),
buildVersion,
releaseType,
isReleaseBuild,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class FileVersionStrategy implements VersioningStrategy, GitTaggingSupport, GitV
}

@Override
SemanticVersion current() {
parseTransform(lastAnnotatedTag(), "")
SemanticVersion current(Project project) {
parseTransform(lastAnnotatedTag(project), "")
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class GitDescribeVersioningStrategy implements VersioningStrategy, GitVersionPar
}

@Override
SemanticVersion current() {
parseTransform(lastAnnotatedTag(), buildNumberFormat)
SemanticVersion current(Project project) {
parseTransform(lastAnnotatedTag(project), buildNumberFormat)
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import springfox.gradlebuild.BuildInfo

trait GitTaggingSupport {

String lastAnnotatedTag() {
def proc = "git describe --exact-match".execute();
String lastAnnotatedTag(Project project) {
def proc = "git -C ${project.getRootDir().toString()} describe --exact-match".execute();
proc.waitFor();
if (proc.exitValue() == 0) {
return proc.text.trim()
}
proc = "git describe".execute()
proc = "git -C ${project.getRootDir().toString()} describe".execute()
proc.waitFor()
if (proc.exitValue() == 0) {
return proc.text.trim()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import springfox.gradlebuild.BuildInfo
interface VersioningStrategy {
SemanticVersion buildVersion(ReleaseType releaseType, boolean isReleaseBuild)
SemanticVersion nextVersion(SemanticVersion buildVersion, ReleaseType releaseType, boolean isReleaseBuild)
SemanticVersion current()
SemanticVersion current(Project project)
void persist(Project project, BuildInfo buildInfo)

}

0 comments on commit b10030b

Please sign in to comment.