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

How to run OpenRewrite against Ant projects? #247

Open
paulbarr opened this issue Nov 17, 2023 · 4 comments
Open

How to run OpenRewrite against Ant projects? #247

paulbarr opened this issue Nov 17, 2023 · 4 comments
Labels
blocked When an issue can't be worked on right now question Further information is requested

Comments

@paulbarr
Copy link

I have a build that uses ant I want to run some OpenRewrite receipes against it

Previously there was this page that described how I could do that (it was there a week ago):
https://docs.openrewrite.org/running-recipes/running-rewrite-without-build-tool-plugins

That page is gone now. Can I run OpenRewrite recipes against an ant build?

@paulbarr paulbarr added the bug Something isn't working label Nov 17, 2023
@timtebeek timtebeek transferred this issue from openrewrite/rewrite Nov 17, 2023
@timtebeek
Copy link
Contributor

Hi @paulbarr ; I see you also asked this on StackOverflow; let me copy the answer I gave there here as well.

We've recently removed that page as it had not been updated since the moved to Rewrite 8. We now recommend folks to use the Moderne CLI when using neither Maven nor Gradle.

Ant is not supported officially, but I know of at least two community members who got recipe runs to work for Ant. Feel free to join our Slack and I'll try to put you in touch there. I don't know how far they got in terms of resolving dependencies, as I didn't yet see any outcome shared there.

Also, just this past week, we had a community member wire up projects built with headless Eclipse; he might also have some insights to share with you regarding how to get things running on Rewrite 8.

Hope that helps!

@timtebeek
Copy link
Contributor

If you get this working for Ant, might I ask that you share your learnings (or even code) here? This request comes up from time to time, and would be really good to have a place to reference, even if we don't yet officially support Ant for now.

@paulbarr
Copy link
Author

paulbarr commented Nov 17, 2023 via email

@timtebeek
Copy link
Contributor

Sure; it was removed in this PR, so you can see the latest version up there still.

Here's a deep link to our Slack for that Eclipse project implementation. Some notes copied from there:

perhaps it helps to see how we create the LargeSourceSet in the Maven plugin
we had quite some changes going from Rewrite 7 to Rewrite 8; the LargeSourceSet changes are part of that
we haven't documented the internal changes that were required at the time, but perhaps it helps to see what we changed in the Maven plugin back then
you can see that for instance here you can run a recipe to get a list of results

        List<SourceFile> poms = mp.parse(Collections.singleton(project.getFile().toPath()), baseDir, ctx).collect(Collectors.toList());
        List<Result> results = recipe.run(new InMemoryLargeSourceSet(poms), ctx).getChangeset().getAllResults();

@timtebeek timtebeek moved this to Backlog in OpenRewrite Nov 17, 2023
@timtebeek timtebeek changed the title Page describing how to run OpenRewrite reciepes against non gradle/maven build is gone How to run OpenRewrite against Ant projects? Nov 17, 2023
@timtebeek timtebeek added question Further information is requested and removed bug Something isn't working labels Nov 17, 2023
@mike-solomon mike-solomon added the blocked When an issue can't be worked on right now label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked When an issue can't be worked on right now question Further information is requested
Projects
Status: Backlog
Development

No branches or pull requests

3 participants