Closed
Description
Following a discussion at diffplug/spotless#744
The way that Blowdryer grabs a resource is this simple interface:
blowdryer/src/main/java/com/diffplug/blowdryer/Blowdryer.java
Lines 176 to 178 in d116192
Which gets initialized in the settings.gradle
like this:
blowdryer/src/main/java/com/diffplug/blowdryer/BlowdryerSetup.java
Lines 56 to 62 in d116192
This interface could be adapted to extract resources from a jar on the classpath, or you could add credentials for the URL. We're happy to merge PR's which add support for either usecase.
extracting from jar
If you wanted to implement this, the pseudocode might be:
public void localJar(String jarName) {
File localJar = ... (find jar on classpath with name jarName)
String rootUrl = "file:///" + localJar.getAbsolutePath() + "!/";
Blowdryer.setResourcePlugin(resource -> rootUrl + resource);
}