gradle-semantic-release-plugin icon indicating copy to clipboard operation
gradle-semantic-release-plugin copied to clipboard

Plugin fails when directory is not managed by git

Open grv87 opened this issue 7 years ago • 1 comments

When directory is not managed by git then application of plugin just fails:

An exception occurred applying plugin request [id: 'de.gliderpilot.semantic-release', version: '1.2.0']
> Failed to apply plugin [class 'org.ajoberstar.gradle.git.base.GrgitPlugin']
   > One of setGitDir or setWorkTree must be called.

(The error message has been improved in modern versions, see https://github.com/ajoberstar/grgit/issues/128.)

This situation occurs when someone downloads source code as archive and wants to build it.

I can't test new version 1.3.0 now, it's still not available for download from Gradle Plugins portal. But I don't see any code that would change that behavior.

Could you add a check: if directory is not managed by git then just skip all initialization part?

grv87 avatar Oct 21 '17 22:10 grv87

Yes, Version 1.3.0 has not been uploaded to plugins.gradle.org. See pull request #26. But it is available using jcenter(). But that version will not make any difference for you.

I will increase the version of grgit. And then I will think about a sollution. The problem is, that because there are -- by design -- no version information anywhere in any file, when downloading the source code as archive, the build can not have any information about the version.

But in that case the default of gradle of using "undeclared" as version seems OK.

tschulte avatar Oct 23 '17 13:10 tschulte