Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gradle task rule for marking the next version #750

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

solonovamax
Copy link

@solonovamax solonovamax commented May 3, 2024

Adds a gradle task rule for incrementing the next version, using the format markNextVersion[Patch/Minor/Major/MinorIfNotRelease/Prerelease/Branch]

Fixes #602

Downsides of this approach:

  • Tasks are not present in the ide, so it's hard for users to know about them

Upsides of this approach:

  • Does not pollute the task list with a bunch of tasks
  • Tasks for incrementing the version are only created immediately before the task is executed
  • No need to add new tasks if any new version incrementers are added

Adds a gradle task rule for incrementing the next version, using the format
markNextVersion[Patch/Minor/Major/MinorIfNotRelease/Prerelease/Branch]

Downsides of this approach:
- Tasks are not present in the ide, so it's hard for users to know about them

Upsides of this approach:
- Does not pollute the task list with a bunch of tasks
- Tasks for incrementing the version are only created immediately before the task is executed
- No need to add new tasks if any new version incrementers are added
@solonovamax
Copy link
Author

solonovamax commented May 3, 2024

Marked as a draft, as I'm unsure if this is the best approach, instead of just creating several tasks.

in #602, I said:

Hi, I've implemented this using task rules, however there is currently somewhat of a drawback:

it will not show the task in the ide.

with task rules, it allows you to specify the next marked version by doing

gradle run markNextVersion[Patch/Minor/Major/MinorIfNotRelease/Prerelease/Branch]

and then it will use the appropriate version incrementer. however, since these tasks technically don't actually exist until right before they're invoked, the ide has absolutely no knowledge of them. (basically you can tell gradle "if a task matches this pattern, then run this code right before attempting to execute the task", and the code that it runs creates the task with name of the task its about to run)

I'm debating whether or not I might just want to create a couple of dedicated tasks called

  • markNextVersionPatch
  • markNextVersionMinor
  • markNextVersionMajor
  • etc.

that way, they'd actually show up inside of the gradle sidebar in intellij, for greater discoverability.

Opinions?

@solonovamax solonovamax changed the title Add gradle task rules for marking the next version Add gradle task rule for marking the next version May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[question] can I create a shortcut gradle task to bump major\minor without args?
1 participant