vivin / gradle-semantic-build-versioning

Gradle plugin to generate version-numbers and tags using semantic versioning
MIT License
85 stars 32 forks source link

Unable to find Git repository #99

Closed efeg closed 4 years ago

efeg commented 6 years ago

gradle-semantic-build-versioning requires the existence of a git directory. As a result, unless the user explicitly generates a git directory (e.g. via git init), gradle build fails. Is it possible to sidestep the requirement regarding the existence of git folder?

Please see the relevant issue here, and the relevant code here.

Thanks!

vivin commented 6 years ago

The plugin depends on git to identify the state of the current source-tree and so I don't think there a way around that. While we could just print out some starting version even if there is no git directory, this can lead to unexpected behavior if someone attempts to tag. Having to run git init doesn't seem too much of a burden imo, since the plugin advertises itself as using git.

vivin commented 6 years ago

@efeg One option might be to automatically create a .git directory if one doesn't exist (after prompting the user)? What do you think?

efeg commented 6 years ago

Thanks for the response @vivin!

I think it would be great to create a .git directory automatically if one doesn't exist (after prompting the user). Alternatively, I believe we might make the error message include a guidance on how to resolve the issue -- i.e. Unable to find Git repository. Please run "git init" to generate one.

vivin commented 4 years ago

Only took me a year and a half...

efeg commented 4 years ago

@vivin Thanks for the fix! -- I look forward to pick it up once a release is generated.