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

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

Open
sreich opened this issue Apr 1, 2023 · 2 comments · May be fixed by #750
Open

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

sreich opened this issue Apr 1, 2023 · 2 comments · May be fixed by #750

Comments

@sreich
Copy link
Contributor

sreich commented Apr 1, 2023

Hey, one of my little complaints and something that I think makes it a little bit more difficult for new learners is it needing to use the -Prelease=incrementMajor etc...

It doesn't help because gradle does not auto complete those, I looked around to see if that's possible but maybe it's just the way gradle is designed, that it cannot grab those info's for the IDE to auto complete on...

Did anyone else run into this concern and how could it be alleviated?

I was thinking it would just be easier for me to have a markNextReleaseMajor, markNextReleaseMinor and then it's just a simple easily discoverable gradle task. Gradle (kts ) doesn't seem to like tasks calling other tasks and passing command args, even though in this case it isn't a part of the execution, its intention is just a shortcut to a task we would normally run

Asking newcomers to simply run and remember these 2 tasks would be so much better than copying and pasting command line args and remembering those each time

Thoughts?

@bgalek
Copy link
Collaborator

bgalek commented Apr 4, 2023

hi @sreich, cool idea - feel free to submit a PR - I'll be happy to review it!

@solonovamax
Copy link

solonovamax commented May 3, 2024

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 linked a pull request May 3, 2024 that will close this issue
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 a pull request may close this issue.

3 participants