Comments (8)
Hi!
I know why: to run my recipes, I don't use a gradle init but I have my own code, like the example in the past on the "running recipes" url (I made an upgrade to OpenRewrite 8).
On this part of code
Files.writeString(result.getAfter().getSourcePath(),
result.getAfter().printAll());
I have an exception Caused by: java.nio.file.NoSuchFileException: foo/bar/baz.yaml
I will search how to solve it.
Thanks.
from rewrite.
Hi! The way to do this would be to just create the YAML file from a recipe, and that should result in the folder being created as well; no need to manually create the folder first! :)
Let me know if that doesn't work out for you somehow, and we can look into specifics. I'll monitor any replies here, but will close the issue already as I'm assuming there's nothing left to do.
from rewrite.
Ah yes would not immediately have expected that; in that case you'll want to check that any parent to sourcePath exists before you write out the file.
Any particular reason you rolled your own solution for running recipes? Curious what case wasn't covered, and if there's something to adopt.
from rewrite.
In my opinion, It is easier to deploy a jar in a context where there is a lots of developers and Java’s applications. I had the possibility to get recipes from a remote server, so it is transparent for developers (they don’t have to download recipes first and they have always the latest version of them). There is also different option to verbose output when recipes don’t work as expected.
For cases where it is not a Java application context, we don’t need to install Gradle or have a Gradle wrapper (JRE is installed everywhere for us).
And one year ago, when I tried with Gradle, I had some problems so I started to develop my own solution.
from rewrite.
Ah sorry to hear you had issues with Gradle earlier; curious to know if those persist, as we've made a lot of improvements over the past year.
Just be aware that we use the Maven and Gradle plugins to set markers common to all source files, some of which are used by recipes. You'd have to replicate that and keep it in sync if you roll your own, but you likely will have encountered that already.
from rewrite.
What do mean by markers ? FencedMarkerPrinter for example or SanitizedMarkerPrinter in grade plugin?
You have an example of recipe which use them ?
I will test gradle again to know if those persist.
from rewrite.
Ah not I meant the provenance markers we attach to source files. These are for instance used when we upgrade Maven or Gradle wrappers, or when we want to check what Java version is used before running a recipe.
from rewrite.
Ok ! I didn’t have the problem but I will check, thanks !
from rewrite.
Related Issues (20)
- Declarative Preconditions - Control applicability to ScanningRecipes HOT 6
- Split method signature line into multiple lines based on the length HOT 1
- Add or merge content to yaml file HOT 7
- Create YAML File with remote content HOT 2
- [Windows build from source] Gradle JDK auto-download doesn't work as expected HOT 2
- Unirest 4.x HOT 1
- foo.properties is not print idempotent due to `key==value` HOT 1
- `ChangeType` not working with types provided to the parser using `dependsOn`. HOT 6
- RemoveObjectsIsNull doesn't remove unnecessary parentheses, if it HOT 1
- `AddManagedDependency` should allow version placeholder properties HOT 7
- org.openrewrite.gradle.RemoveDependency does not remove dependency in subproject HOT 3
- Performance issue with classpath scanning HOT 2
- Openrewrite: apply recipe list step by step (to have a proper commit history) HOT 1
- `module-info.java` trips up the JavaParser and Gradle/Maven plugin HOT 35
- Problem with parsing groovy files HOT 1
- RenameVariable does not modify variables referenced through type casts HOT 5
- Groovy Parser Failes on Method Reference Operator :: HOT 3
- Allow custom YAML filenames in YamlParser HOT 4
- There were problems parsing Inner Class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rewrite.