GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Added support for custom JSR-223 based formatters by tisoft · Pull Request #945 · diffplug/spotless

Conversation

@tisoft

@tisoft tisoft commented Sep 23, 2021

Copy link
Copy Markdown
Contributor

Added support for custom JSR-223 based formatters in Maven.

<jsr223> <!-- specify replacements using JSR223 scripting -->
  <name>Greetings to Mars</name>
  <engine>nashorn</engine>
  <script>source.replace('World','Mars');</script>
</jsr223>

Allows an end user to create arbitrary custom formatters inside the pom. Javascript is supported by the "nashorn" engine provided by the JDK. Other engines can be used, if they are in the classpath.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tisoft
tisoft force-pushed the jsr223 branch from 51b945a to 339f7c4 Compare September 23, 2021 10:03
@tisoft

tisoft commented Sep 23, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Note: I didn't implement this for grade, since the custom step is available there. If you want this step also available in the gradle plugin, I can add it there, too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisoft
tisoft force-pushed the jsr223 branch from 339f7c4 to b72e42b Compare September 23, 2021 11:05
@nedtwigg

nedtwigg commented Sep 24, 2021

Copy link
Copy Markdown
Member

I think this is great, and I agree it makes sense to keep it maven-only. Only thing missing imo is that it needs a changelog entry in the root CHANGES.md too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisoft
tisoft force-pushed the jsr223 branch 2 times, most recently from aa5019e to b6ea481 Compare September 26, 2021 07:21
@tisoft

tisoft commented Sep 26, 2021

Copy link
Copy Markdown
Contributor Author
  • Updated root CHANGES.md
  • Load script engine from JarState
  • Added test for using a JSR-223 from a dependency
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg

nedtwigg commented Sep 26, 2021

Copy link
Copy Markdown
Member

Please merge the latest origin/main into this PR. That should fix CI, at which point I can merge and release.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisoft
tisoft force-pushed the jsr223 branch from 2f1dec3 to 9620d20 Compare September 27, 2021 05:12
@nedtwigg

nedtwigg commented Sep 27, 2021

Copy link
Copy Markdown
Member

I went ahead and merged origin/main for you. Looks like the test failure is real.

https://app.circleci.com/pipelines/github/diffplug/spotless/1259/workflows/d151483f-7468-4aed-89fa-c2fcd9a2718c/jobs/7153/tests#failed-test-0

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisoft

tisoft commented Sep 27, 2021

Copy link
Copy Markdown
Contributor Author

I'll have a look

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisoft
Added support for custom JSR-223 based formatters
8604dd4
@tisoft
tisoft force-pushed the jsr223 branch from e323239 to 8604dd4 Compare September 27, 2021 19:32
@tisoft

tisoft commented Sep 27, 2021

Copy link
Copy Markdown
Contributor Author

Rebased and fixed the test failure. The new test failure seems to be unrelated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nedtwigg
nedtwigg merged commit a9e8357 into diffplug:main Sep 27, 2021
@nedtwigg

nedtwigg commented Sep 27, 2021

Copy link
Copy Markdown
Member

Want me to cut a release now, or should I wait until POM sorting gets merged too?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisoft

tisoft commented Sep 27, 2021

Copy link
Copy Markdown
Contributor Author

I'll have a go at the pom sorting, no need for a new release for me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tisoft
tisoft deleted the jsr223 branch September 27, 2021 20:06
@nedtwigg

nedtwigg commented Sep 30, 2021

Copy link
Copy Markdown
Member

Released in plugin-maven 2.15.0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@tisoft @nedtwigg
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.