ajoberstar / reckon

Infer a project's version from your Git repository.
Apache License 2.0
187 stars 28 forks source link

The 'reckon.snapshot' property should default to false if the repository is clean #70

Closed cmuchinsky closed 6 years ago

cmuchinsky commented 6 years ago

In the meantime, the workaround is to initialize reckon.snapshot as follows:

ext['reckon.snapshot'] = !grgit.status().isClean()
ajoberstar commented 6 years ago

Can you provide more on why you think this should be the default behavior?

This seems like a fairly aggressive default to me. It would mean that you can never build a snapshot (without explicitly asking for one) in a CI environment since those should always be on clean repos. The release of a final version should be opt-in since it's a more undoable action.

cmuchinsky commented 6 years ago

I'm basing this off the behavior I configured with the deprecated release-base plugin, but if you don't think that's the appropriate default I'm fine keeping my work around. For your reference, here is how I configured the release-base plugin:

  release {
    defaultVersionStrategy = Strategies.SNAPSHOT
    versionStrategy RebuildVersionStrategy.INSTANCE
    versionStrategy Strategies.FINAL
  }
ajoberstar commented 6 years ago

In the future (related to #67), I plan to open up the ability for you to configure the way the snapshot property is determined. It won't be much different from your workaround, but I imagine it looking something like:

reckon {
  // ...
  preRelease = snapshotFrom { vcsInventory, targetNormal -> !vcsInventory.isClean() }
}
ajoberstar commented 6 years ago

I'll call this a won't fix, but you'll have options to configure like noted above soon.