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

Load config resources from classpath / URL #1204

Closed
nedtwigg opened this issue May 11, 2022 · 0 comments
Closed

Load config resources from classpath / URL #1204

nedtwigg opened this issue May 11, 2022 · 0 comments
Labels

Comments

@nedtwigg
Copy link
Member

It comes up from time to time that users want to setup their formatter steps from classpath resources and/or URLs. A few previous requests:

I'll answer it once and for all here. The short answer is use blowdryer.

The longer answer is that File is a good interface. Sometimes the formatting happens within the JVM, but othertimes we are actually passing the file to a different process, and File works for either case.

So instead of overloading every method that takes a File to have another version that takes URL url and another that takes String localResource, what you really want is some function that takes a URL or local classpath resource and returns a File. That's simple to do, but there's some tricky bookkeeping - what should the name be, where should the file live, when do we reuse the same file, etc.

blowdryer answers all those questions with the shortest answer we could think of. It introduces no tasks - it creates the Files at configuration time and uses caching to support fully-offline builds and the best possible performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant