จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Lint
การตรวจสอบ Lint เพื่อยืนยันการใช้ Gradle API
อัปเดตล่าสุด |
รุ่นที่เสถียร |
รุ่นที่อาจได้รับการเผยแพร่ |
รุ่นเบต้า |
เวอร์ชันอัลฟ่า |
20 พฤษภาคม 2025 |
- |
- |
- |
1.0.0-alpha05 |
การประกาศทรัพยากร Dependency
หากต้องการเพิ่มทรัพยากร Dependency ของ Lint คุณต้องเพิ่มที่เก็บ Maven ของ Google ลงในโปรเจ็กต์ อ่านข้อมูลเพิ่มเติมในที่เก็บ Maven ของ Google
เพิ่มการอ้างอิงสำหรับอาร์ติแฟกต์ที่ต้องการในไฟล์ 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 ได้ โปรดแจ้งให้เราทราบหากพบปัญหาใหม่หรือมีแนวคิดในการปรับปรุงคลังนี้ โปรดดูปัญหาที่มีอยู่ในคลังนี้ก่อนสร้างปัญหาใหม่ คุณสามารถเพิ่มการโหวตให้กับปัญหาที่มีอยู่ได้โดยคลิกปุ่มดาว
สร้างปัญหาใหม่
ดูข้อมูลเพิ่มเติมได้ที่เอกสารประกอบของเครื่องมือติดตามปัญหา
ไม่มีบันทึกประจำรุ่นสำหรับอาร์ติแฟกต์นี้
รุ่น 1.0
เวอร์ชัน 1.0.0-alpha05
20 พฤษภาคม 2025
androidx.lint:lint-gradle:1.0.0-alpha05
ได้รับการปล่อยแล้ว เวอร์ชัน 1.0.0-alpha05 มีการคอมมิตเหล่านี้
ฟีเจอร์ใหม่
- เพิ่มการตรวจสอบเพื่อเตือนเกี่ยวกับการใช้
configurations.create
และ configurations.maybeCreate
เนื่องจากจะทําให้เกิดการรับรู้การกําหนดค่านั้นตั้งแต่ Gradle 8.14 จึงควรแทนที่ด้วย configurations.register
- เพิ่มการตรวจสอบเพื่อจับการใช้ Kotlin Gradle Plugin API ภายใน
- เพิ่มการตรวจสอบเพื่อจับการใช้
evaluationDependsOn
และ evaluationDependsOnChildren
เนื่องจากไม่ปลอดภัยเมื่อใช้กับฟีเจอร์โปรเจ็กต์แยก
เวอร์ชัน 1.0.0-alpha04
23 เมษายน 2025
androidx.lint:lint-gradle:1.0.0-alpha04
ได้รับการปล่อยแล้ว เวอร์ชัน 1.0.0-alpha04 มีการคอมมิตเหล่านี้
ฟีเจอร์ใหม่
- เพิ่มการตรวจสอบการโทร
Provider<String>.toString
โดยไม่ได้ตั้งใจ เนื่องจากอาจเกิดจากข้อบกพร่อง
- เพิ่มการตรวจสอบเพื่อจับการใช้เมธอด พร็อพเพอร์ตี้ ฟิลด์ที่มาจากประเภทภายใน
การแก้ไขข้อบกพร่อง
- เลือก
GradleProjectIsolation
เพื่ออนุญาตให้ใช้ Project.isolated
- แก้ไขการตรวจสอบ
WithTypeWithoutConfigureEach
เพื่อจับการใช้ Project.tasks.withType<Task>()
ที่ไม่มี configureEach
- แก้ไขการตรวจสอบ
InternalGradleApiUsage
เพื่อจับการใช้ API ภายในที่สมบูรณ์
เวอร์ชัน 1.0.0-alpha03
11 ธันวาคม 2024
androidx.lint:lint-gradle:1.0.0-alpha03
ได้รับการปล่อยแล้ว เวอร์ชัน 1.0.0-alpha03 มีการคอมมิตเหล่านี้
ฟีเจอร์ใหม่
- จับการเรียกใช้
Provider<>.toString
เนื่องจากเกือบทุกครั้งที่เรียกใช้จะมีข้อบกพร่อง
- จับการเรียกฟังก์ชันส่วนขยายของคอลเล็กชัน Kotlin ใน
TaskContainer
เนื่องจากจะทำให้เกิดการสร้าง Task
อย่างเร่งด่วน
- จับการเรียก
ConfigurableFileCollection.from
ที่ส่ง Configuration
เนื่องจากจะทำให้เกิดการแก้ไขการกำหนดค่าที่แนะนำให้ใช้ project.files(configuration)
หรือ configuration.incoming.artifactView {}.files
- จับการใช้
Property<File>
ที่แนะนำให้ใช้ RegularFileProperty
หรือ DirectoryProperty
เนื่องจากมีการบังคับใช้ไดเรกทอรีกับไฟล์
เวอร์ชัน 1.0.0-alpha02
4 กันยายน 2024
androidx.lint:lint-gradle:1.0.0-alpha02
ได้รับการปล่อยแล้ว เวอร์ชัน 1.0.0-alpha02 มีการคอมมิตเหล่านี้
ฟีเจอร์ใหม่
- เพิ่มการตรวจสอบ API
GradleRunner.withPluginClasspath
ที่ไม่แนะนํา
- เพิ่มการตรวจสอบ API ที่มีปัญหาในการกําหนดค่าแบบ Lazy โดยแจ้งว่ามีการเรียก
TaskContainer.withType
โดยไม่เรียก configureEach
- เพิ่มการตรวจสอบ API ที่มีปัญหากับการแยกโครงการ Gradle โดยแจ้งการเรียกใช้
Project.getRootProject
, Project.findProject
, Project.getParent
, Project.findProperty
, Project.getProperties
, Project.hasProperty
, Project.property
เวอร์ชัน 1.0.0-alpha01
21 กุมภาพันธ์ 2024
androidx.lint:lint-gradle:1.0.0-alpha01
ได้รับการปล่อยแล้ว เวอร์ชัน 1.0.0-alpha01 มีการคอมมิตเหล่านี้
ฟีเจอร์ใหม่
- ชุดการตรวจสอบ Lint เริ่มต้นสำหรับผู้เขียนปลั๊กอิน Gradle เพื่อช่วยตรวจหาข้อผิดพลาดในโค้ด โดยคาดว่าจะใช้ในโปรเจ็กต์ Gradle ที่ใช้
java-gradle-plugin
โดยจะตรวจจับการใช้ API ของ Gradle และปลั๊กอิน Android Gradle ภายใน รวมถึงการกำหนดค่าแบบรอดำเนินการ
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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."]]