0
0

build.gradleのdependencies依存関係指定方法

Posted at
  • implementation
    • コンパイルと実行時に必要な依存関係を指定。
    • 依存関係はほかのプロジェクトから見えず、依存関係の依存関係も含めてコンパイル時に使用される
  • compileOnly
    • コンパイル時にのみ必要な依存関係のみを指定する。
    • 実行時にはこれで指定された依存関係は含まれない。
    • アノテーション処理やコンパイル時のチェックに必要な依存関係を指定するのに使用
  • developmentOnly
    • 開発環境でのみ必要な依存関係の指定。
    • 本番環境ではこれで指定した依存関係は含まれない
  • testImplementation
    • テストのコンパイルおよび実行時に必要な依存関係を指定。
    • テスト用フレームワークやモックライブラリに使用される
  • runtimeOnly
    • 実行時にのみ必要な依存関係を指定。コンパイル時にはこれらの依存関係は含まれないが実行時に必要なもの。
  • 他にも
    • compileClasspath
    • annotationProcessor
    • がある
0
0
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
0