LoginSignup
0
2

More than 5 years have passed since last update.

GradleでCheckstyleを実行する際にWeb上にある設定ファイルを見るようにする

Posted at

IntellijのプラグインだとWeb上の設定ファイルを見るような設定があるので、それをgradleのタスクとしても出来るようにしてみました。

Gradle Download Taskのプラグインを使って、ローカルに設定ファイルを落としてきてから、configFileに落としてきたファイルを指定するようにしています。

サンプルコード

buildscript {
    repositories {
        ...
        jcenter()
    }
    dependencies {
        ...
        classpath 'de.undercouch:gradle-download-task:x.y.z'
    }
}

...

apply plugin: 'checkstyle'
apply plugin: 'de.undercouch.download'

...

checkstyle {
    def downloadedFile = new File('[ダウンロード先のファイルパス]')
    download {
        src '[設定ファイルの設置先のURL]'
        dest downloadedFile
    }
    configFile file('[ダウンロード先のファイルパス]')
}
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2