Giter VIP home page Giter VIP logo

Comments (8)

nicolasb29 avatar nicolasb29 commented on June 24, 2024 1

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.

timtebeek avatar timtebeek commented on June 24, 2024

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.

timtebeek avatar timtebeek commented on June 24, 2024

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.

nicolasb29 avatar nicolasb29 commented on June 24, 2024

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.

timtebeek avatar timtebeek commented on June 24, 2024

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.

nicolasb29 avatar nicolasb29 commented on June 24, 2024

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.

timtebeek avatar timtebeek commented on June 24, 2024

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.

nicolasb29 avatar nicolasb29 commented on June 24, 2024

Ok ! I didn’t have the problem but I will check, thanks !

from rewrite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.