コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
lint
Gradle API の使用状況を確認する lint チェック
最新の更新 |
安定版リリース |
リリース候補版 |
ベータ版リリース |
アルファ版リリース |
2025 年 5 月 20 日 |
- |
- |
- |
1.0.0-alpha05 |
依存関係の宣言
Lint への依存関係を追加するには、Google の Maven リポジトリをプロジェクトに追加する必要があります。詳しくは、Google の Maven リポジトリをご覧ください。
アプリまたはモジュールの build.gradle
ファイルに、必要なアーティファクトの依存関係を追加します。
Groovy
plugins {
id("com.android.lint")
}
dependencies {
lintChecks "androidx.lint:lint-gradle:1.0.0-alpha05"
}
Kotlin
plugins {
id("com.android.lint")
}
dependencies {
lintChecks("androidx.lint:lint-gradle:1.0.0-alpha05")
}
依存関係について詳しくは、ビルド依存関係の追加をご覧ください。
フィードバック
お寄せいただいたフィードバックは Jetpack 改善の参考にさせていただきます。新しい問題が見つかった場合や、このライブラリを改善するアイデアをお持ちの場合は、お知らせください。新しい問題を報告していただく前に、このライブラリの既存の問題をご確認ください。スターボタンをクリックすると、既存の問題に投票できます。
新しい問題を報告する
詳細については、Issue Tracker のドキュメントをご覧ください。
このアーティファクトのリリースノートはありません。
バージョン 1.0
バージョン 1.0.0-alpha05
2025 年 5 月 20 日
androidx.lint:lint-gradle:1.0.0-alpha05
がリリースされました。バージョン 1.0.0-alpha05 には、これらの commit が含まれています。
新機能
configurations.create
と configurations.maybeCreate
の使用について警告するチェックを追加しました。これらは Gradle 8.14 以降でその構成を早期に実現するため、configurations.register
に置き換える必要があります。
- 内部 Kotlin Gradle プラグイン API の使用を検出するチェックを追加
- 分離プロジェクト機能では安全ではないため、
evaluationDependsOn
と evaluationDependsOnChildren
の使用を検出するチェックを追加しました。
バージョン 1.0.0-alpha04
2025 年 4 月 23 日
androidx.lint:lint-gradle:1.0.0-alpha04
がリリースされました。バージョン 1.0.0-alpha04 に含まれる commit はこちらをご覧ください。
新機能
- 誤って
Provider<String>.toString
が呼び出されていないか確認するチェックを追加しました。これはバグである可能性があります。
- 内部型からのメソッド、プロパティ、フィールドの使用を検出するチェックを追加。
バグの修正
Project.isolated
の使用を許可するように GradleProjectIsolation
チェックを修正。
configureEach
のない Project.tasks.withType<Task>()
の使用を検出するように WithTypeWithoutConfigureEach
チェックを修正しました。
- 内部 API の完全修飾された使用を検出するように
InternalGradleApiUsage
チェックを修正しました。
バージョン 1.0.0-alpha03
2024 年 12 月 11 日
androidx.lint:lint-gradle:1.0.0-alpha03
がリリースされました。バージョン 1.0.0-alpha03 には、これらの commit が含まれています。
新機能
Provider<>.toString
への呼び出しをキャッチします。これはほとんどの場合バグです。
TaskContainer
での Kotlin コレクション拡張関数の呼び出しをキャッチします。これは、Task
の早期作成を引き起こすためです。
Configuration
を渡す ConfigurableFileCollection.from
の呼び出しをキャッチします。これにより、project.files(configuration)
または configuration.incoming.artifactView {}.files
を使用することを示唆する構成が早期に解決されます。
Property<File>
の使用をキャッチし、ファイルではなくディレクトリを使用するように RegularFileProperty
または DirectoryProperty
を使用することを提案します。
バージョン 1.0.0-alpha02
2024 年 9 月 4 日
androidx.lint:lint-gradle:1.0.0-alpha02
がリリースされました。バージョン 1.0.0-alpha02 に含まれる commit はこちらをご覧ください。
新機能
- 非推奨の
GradleRunner.withPluginClasspath
API のチェックを追加しました。
configureEach
を呼び出すことなく TaskContainer.withType
の呼び出しにフラグを立てることで、遅延構成に問題がある API のチェックを追加しました。
Project.getRootProject
、Project.findProject
、Project.getParent
、Project.findProperty
、Project.getProperties
、Project.hasProperty
、Project.property
の呼び出しにフラグを立てることで、Gradle プロジェクトの分離に問題となる API のチェックを追加しました。
バージョン 1.0.0-alpha01
2024 年 2 月 21 日
androidx.lint:lint-gradle:1.0.0-alpha01
がリリースされました。バージョン 1.0.0-alpha01 に含まれる commit については、こちらをご覧ください。
新機能
- Gradle プラグイン作成者がコードの間違いを検出できるようにするための、初期の lint チェックセット。
java-gradle-plugin
を適用する Gradle プロジェクトで使用されることが想定されています。Gradle 内部 API と Android Gradle プラグイン API の使用と、早期タスク構成が検出されます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# lint\n====\n\nAPI Reference \n[androidx.lint](/reference/kotlin/androidx/lint/package-summary) \nLint checks to verify usage of Gradle APIs \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|---------------|----------------|-------------------|--------------|----------------------------------------------------------------|\n| May 20, 2025 | - | - | - | [1.0.0-alpha05](/jetpack/androidx/releases/lint#1.0.0-alpha05) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on Lint, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\nplugins {\n id(\"com.android.lint\")\n}\ndependencies {\n lintChecks \"androidx.lint:lint-gradle:1.0.0-alpha05\"\n}\n```\n\n### Kotlin\n\n```kotlin\nplugins {\n id(\"com.android.lint\")\n}\ndependencies {\n lintChecks(\"androidx.lint:lint-gradle:1.0.0-alpha05\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1518777%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1518777&template=1946997)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nThere are no release notes for this artifact.\n\nVersion 1.0\n-----------\n\n### Version 1.0.0-alpha05\n\nMay 20, 2025\n\n`androidx.lint:lint-gradle:1.0.0-alpha05` is released. Version 1.0.0-alpha05 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/7bbd2bffb18b5a7d6ab44019d31979acc72315a7..cd41781824511ce4d5c4a05d2df4aaaee669f0bc/lint/lint-gradle).\n\n**New Features**\n\n- Add a check to warn about usages of `configurations.create` and `configurations.maybeCreate` as these cause eager realization of that configuration starting with Gradle 8.14 and thus should be replaced with `configurations.register`.\n- Add a check to catch usages of internal Kotlin Gradle Plugin APIs\n- Add a check to catch usages of `evaluationDependsOn` and `evaluationDependsOnChildren` as it is not safe with Isolated Projects feature.\n\n### Version 1.0.0-alpha04\n\nApril 23, 2025\n\n`androidx.lint:lint-gradle:1.0.0-alpha04` is released. Version 1.0.0-alpha04 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/2ffcbb08c7221e79b12c0ef234bcfb5517d10ece..7bbd2bffb18b5a7d6ab44019d31979acc72315a7/lint/lint-gradle).\n\n**New Features**\n\n- Add a check for accidental `Provider\u003cString\u003e.toString` calls as they are likely bugs.\n- Add check to catch uses of methods, properties, fields coming from internal types.\n\n**Bug Fixes**\n\n- Fix `GradleProjectIsolation` check to allow usage of `Project.isolated`.\n- Fix `WithTypeWithoutConfigureEach` check to catch uses of `Project.tasks.withType\u003cTask\u003e()` without `configureEach`.\n- Fix `InternalGradleApiUsage` check to catch fully qualified usages of internal APIs.\n\n### Version 1.0.0-alpha03\n\nDecember 11, 2024\n\n`androidx.lint:lint-gradle:1.0.0-alpha03` is released. Version 1.0.0-alpha03 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/9cd42c5cbf5e69b0223d5b0c357593175182f365..2ffcbb08c7221e79b12c0ef234bcfb5517d10ece/lint/lint-gradle).\n\n**New Features**\n\n- Catch calls to `Provider\u003c\u003e.toString` as it is nearly always a bug to do that.\n- Catch calls of Kotlin collection extension functions on `TaskContainer` as these cause eager `Task` creation.\n- Catch calls to `ConfigurableFileCollection.from` passing in a `Configuration` as that causes eager resolution of the configuration suggesting to use `project.files(configuration)` or `configuration.incoming.artifactView {}.files`.\n- Catch usages of `Property\u003cFile\u003e` suggesting to use `RegularFileProperty` or `DirectoryProperty` as it is enforcing the use directory vs file.\n\n### Version 1.0.0-alpha02\n\nSeptember 4, 2024\n\n`androidx.lint:lint-gradle:1.0.0-alpha02` is released. Version 1.0.0-alpha02 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/e1b82c49c59d8e976ce558aba5586f6c61bc9054..9cd42c5cbf5e69b0223d5b0c357593175182f365/lint/lint-gradle).\n\n**New Features**\n\n- Added a check for discouraged `GradleRunner.withPluginClasspath` API.\n- Added checks for APIs that are problematic for lazy configuration by flagging calls to `TaskContainer.withType` without calling `configureEach`.\n - Added checks for APIs that are problematic for Gradle Project Isotation by flagging calls to `Project.getRootProject`, `Project.findProject`, `Project.getParent`, `Project.findProperty`, `Project.getProperties`, `Project.hasProperty`, `Project.property`.\n\n### Version 1.0.0-alpha01\n\nFebruary 21, 2024\n\n`androidx.lint:lint-gradle:1.0.0-alpha01` is released. [Version 1.0.0-alpha01 contains these commits.](https://android.googlesource.com/platform/frameworks/support/+log/e1b82c49c59d8e976ce558aba5586f6c61bc9054/lint/lint-gradle)\n\n**New Features**\n\n- An initial set of lint checks for Gradle Plugin authors to help them catch mistakes in their code. They are expected to be used on Gradle projects that apply `java-gradle-plugin`. It will catch uses of internal Gradle and Android Gradle Plugin APIs and eager task configuration."]]