Creating Open Rewrite Recipeies in Existing Project.
I have been hard at work porting my entire Server Code over to Kotlin from Java, Mainly to reduce possibility of nullpointers and extension functions.
Intelijs change over is a bit scuffed so I had a look arouznd in the Intelij whether there are things that might be able to undo that behaviour realtively easily.
During that experimentation I stumbled across Open Rewrite
Template: https://github.com/moderneinc/rewrite-recipe-starter
However I want to integrate it into an existing Project as Gradle Sub Project to avoid having to publish to local repo nen Stuff all the time. Having to swap between Intelij Projects is also annoying.
I tried to get just a custom self made recipe to run to then code my own but so far to no avail. And I for tried HOURS. (I know tht doing it manually would be faster. But I hope to learn from it and use it in the future. If I get it to run at least.)
Recipe development environment | OpenRewrite Docs
Instructions for setting up your local development environment to create OpenRewrite recipes.
GitHub
GitHub - moderneinc/rewrite-recipe-starter: A forkable starter for ...
A forkable starter for building your own recipes and deploying them on the Moderne SaaS - moderneinc/rewrite-recipe-starter






31 Replies
⌛ This post has been reserved for your question.
Hey @Hype_the_Time (PING ON REPLY)! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.Bump
What is the exact issue that happens with your custom recipe?
im just trying to even get 1 to "run"
like i basically dont get grade configured
or rather open rewrite using gradle
and what happens when trying to run it? Is it ignored? Are you getting an exception? Does the build fail?
if i run main build. it runs just fine (BUILD SUCCESSFUL in 32s)
Rewruite run was causing issues.
I noticed 2 things which i thought i did previously which did not cause an errors as i saw them earlier. Im checking stuff rn
What exactly are you running that is causing issues and what exactly happens?
it was unable to find the recipe previously. this time it for some reason worked. im checking stuff on my own and will come back to this once I get into an issue again. idk why it works now.
Rewrite configuration file /home/spieler/IdeaProjects/BingoNet-Server/main/resources/META-INF/rewrite/BN-Server.yml does not exist.
Validating active recipes
Scanning sources in project :main
Using active styles []
first time i saw Rewrite configuration file /home/spieler/IdeaProjects/BingoNet-Server/main/resources/META-INF/rewrite/BN-Server.yml does not exist.
wait nvm does not exiost instead of does exist
Well, does the file exist?
yes

and the
main is in /home/spieler/IdeaProjects/BingoNet-Server?yes
Can you run
ls -la /home/spieler/IdeaProjects/BingoNet-Server/main/resources/META-INF/rewrite/BN-Server.yml in a terminal and show the output?copying that file path via intlij: /home/spieler/IdeaProjects/BingoNet-Server/main/src/main/resources/META-INF/rewrite/BN-Server.yml
main/src/main/resourceswait
diff
yep
questuion is where its taking that from
ah found sth
BUILD SUCCESSFUL in 34s
question is on how to get the breakpoint in the file activated
?
in the custom recipe
What do you mean with getting the breakpoint in that file activated?
in package de.hype.openrewrite.recipes;
import org.openrewrite.ExecutionContext;
import org.openrewrite.NlsRewrite;
import org.openrewrite.Recipe;
import org.openrewrite.TreeVisitor;
import org.openrewrite.kotlin.KotlinIsoVisitor;
import org.openrewrite.kotlin.tree.K;
This message has been formatted automatically. You can disable this using
/preferences.Do you have a breakpoint in that file for debugging?

just noticed that its not having gradle dameon off yet
ok so Gradle doesn't run with a debugger attached
but you should be able to just attach a debugger to Gradle
Are you running the Gradle build from the terminal? If so, what exact command are you using?
ah daemon off worked
ah ok
I think alternatively, you could just attach a debugger to the daemon
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.