LoginSignup
15
13

More than 5 years have passed since last update.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. に対応する

Posted at

Gradle のバージョン上げると、以下のような警告が表示される事がある。

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.1/userguide/command_line_interface.html#sec:command_line_warnings

まぁ中身はその通りで、非推奨の機能を使っていて、5.0 では無くなるよ、という警告です。

実際に何が非推奨かを具体的に教えて欲しかったら、以下のファイルを作っておくとよい。

gradle.properties
org.gradle.warning.mode=all

(コマンドラインから一時的に指定することもできるけど、warn は常に ON にしておくべきなのだ。。。たぶん)

自分の場合

自分の場合、以下のように ConfigurableReport.setDestination が悪いと言われた。

The ConfigurableReport.setDestination(Object) method has been deprecated. This is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
        at build_7lmo6x5yy25habfnsnz0lhhh2$_run_closure3$_closure25.doCall(~/build.gradle:191)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

実際に gradle は明示的に書いていなくても method 呼び出しになったりするので、行数を見るのが言い

build.gradle#該当の行
        xml.destination "${buildDir}/reports/jacoco/report.xml"

buildDir というところにビルドディレクトリが入るので、この書き方で full path が取得できて実際動くのですが、もう少し現代的に  file('ビルドディレクトリからの相対パス')File 型で該当ファイルのパスがとれます

build.gradle#TOBE
        xml.destination file('reports/jacoco/report.xml')
15
13
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
15
13