diff --git a/build.gradle b/build.gradle index c4659fe..07be696 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,8 @@ plugins { id "idea" id "jacoco" id "com.github.johnrengelman.shadow" version "5.1.0" - id "com.diffplug.gradle.spotless" version "3.24.3" + id "com.diffplug.gradle.spotless" version "3.25.0" + id "de.undercouch.download" version "4.0.0" } description 'web3j command line tools' @@ -27,7 +28,7 @@ apply { 'javadoc', 'repositories', 'spotless' - ].each { + ].each { buildScript -> download { src "https://raw.githubusercontent.com/web3j/build-tools/master/gradle/$buildScript/build.gradle" dest "$rootDir/gradle/$buildScript/build.gradle" diff --git a/gradle/spotless/build.gradle b/gradle/spotless/build.gradle index e14803e..9ef8688 100644 --- a/gradle/spotless/build.gradle +++ b/gradle/spotless/build.gradle @@ -1,5 +1,20 @@ apply plugin: 'com.diffplug.gradle.spotless' +apply plugin: "de.undercouch.download" + +task downloadJavaLicense(type: Download) { + src 'https://raw.githubusercontent.com/web3j/build-tools/master/gradle/spotless/java.license' + dest new File("$rootDir/gradle/spotless",'java.license') + quiet true + onlyIfModified true +} + +task downloadFormatterProperties(type: Download) { + src 'https://raw.githubusercontent.com/web3j/build-tools/master/gradle/spotless/formatter.properties' + dest new File("$rootDir/gradle/spotless",'formatter.properties') + quiet true + onlyIfModified true +} spotless { java { @@ -35,3 +50,5 @@ spotless { paddedCell() } } + + spotlessCheck.dependsOn('downloadJavaLicense', 'downloadFormatterProperties')