-
Notifications
You must be signed in to change notification settings - Fork 77
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
Suggestion: run recipes with arguments #345
Comments
hi @ferblaca Thanks for the suggestion. I think the problem with using system properties to pass arguments is that they would still need to enforce some sort of recipe namespace because many times the active recipe may actually be a composite (which could then include other composite recipes). It is also possible to use the same recipe multiple times with different parameters as with this example We would be interested in hearing any troubles you are having with the declarative approach. |
hi @tkvangorder!! thank you very much for your quick reply 👍 For example I would like to configure a main recipe to call other recipes depending on an input parameter. For example, if I have a recipe like this:
Depending on the value of the parameter |
I have a slightly different use case for using command line arguments. Given a ChangeTagValue (as an alternative way of changing the pom project version) - org.openrewrite.xml.ChangeTagValue:
elementName: /project/version
newValue: 8.0.1-SNAPSHOT I would like to be able to pass the newVersion as a command line parameter. - org.openrewrite.xml.ChangeTagValue:
elementName: /project/version
newValue: ${newValue} |
We now recommend folks use the Moderne CLI when there's a desire to set run recipe options.
Folks that use the Maven and Gradle plugins can continue to use declarative yaml recipes in |
It would be great to be able to run recipes that accept parameters by giving them value with arguments.
For example the recipe
org.openrewrite.java.ChangePackage
that acceptsoldPackageName
,newPackageName
andrecursive
as parameters could be executed for example:Is there a way to add value to parameters dynamically without having to do it declaratively?
thank you in advance!
The text was updated successfully, but these errors were encountered: