Last active
June 4, 2018 11:11
-
-
Save nikolauskrismer/54f3c1e14f6c26ce52ca179a8ef8a876 to your computer and use it in GitHub Desktop.
Includes checkstyle_nkr.xml configuration file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Version handling checkstyke_nkrchecks.xml download | |
*/ | |
apply plugin: 'checkstyle' | |
checkstyle { | |
configFile = file("${buildDir}/checkstyle.xml") | |
ignoreFailures = true | |
showViolations = false | |
toolVersion = '+' | |
} | |
tasks.withType(Checkstyle) { | |
it.dependsOn 'downloadCheckstyleConfig' | |
} | |
task downloadCheckstyleConfig(type: DownloadFileTask) { | |
description = 'Download checkstyle configuration file' | |
url = 'https://gist.github.com/nikolauskrismer/10e3fd728ddac0afa55405a3fa13dca9/raw/' | |
destinationFile = checkstyle.configFile | |
} | |
class DownloadFileTask extends DefaultTask { | |
@Input | |
String url | |
@OutputFile | |
File destinationFile | |
@TaskAction | |
def downloadFile() { | |
destinationFile.bytes = new URL(url).bytes | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment