You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But that's mostly a gimmick. The power is that - if you want - you can move spotless.gradle and spotless.eclipseformat.xml into a new git repository (a "script repository"), and you can point many different gradle builds to it. The convention is to name your script repository blowdryer-{orgname}. So if you put your gradle scripts and config files into diffplug/blowdryer-diffplug, then you can consume those scripts from other builds by doing this:
// settings.gradleblowdryerSetup {
github 'diffplug/blowdryer-diffplug', 'tag', '2.0.0'// can also use commit SHA//devLocal '../blowdryer-diffplug' // for local development
}
// subproject/build.gradle
apply from: 干.file('spotless.gradle')
// github.com/acme/blowdryer-acme/src/main/resources/spotless.gradlespotless { java {
eclipse().configFile 干.file('gradle/spotless.eclipseformat.xml')
}}
Performance-wise, because git commits and tags are immutable, it only needs to download the file once, ever, system-wide, so there's no measurable overhead in using it.
So you apply Spotless to a single-project build, and it looks like this:
Then you have a multi-project build, so you factor out your spotless block into
gradle/spotless.gradle
:The chinese character for "dry" is 干. If you apply the blowdryer plugin, it lets you rewrite the above, but with fewer characters:
But that's mostly a gimmick. The power is that - if you want - you can move
spotless.gradle
andspotless.eclipseformat.xml
into a new git repository (a "script repository"), and you can point many different gradle builds to it. The convention is to name your script repositoryblowdryer-{orgname}
. So if you put your gradle scripts and config files into diffplug/blowdryer-diffplug, then you can consume those scripts from other builds by doing this:Performance-wise, because git commits and tags are immutable, it only needs to download the file once, ever, system-wide, so there's no measurable overhead in using it.
There's also a little more power you can tap into to help make
apply from:
scripts work better, and there are a ton of low hanging fruit which can make this a lot more powerful.If you'd like to help signal boost this new effort, here is the release tweet.
The text was updated successfully, but these errors were encountered: