repo/lockfile-committed/kotlin
Dependency lockfile is committed
Implements repo/lockfile-committed for kotlin.
| Severity | error |
| Tiers | 1, 2 |
| Stacks | kotlin |
| Scope | each |
| Kind | expr |
| Source | library v0.8.0 |
| Selected by | fleetlint-recommended@v0.8.0 |
Requirement
A Gradle build tracks dependency lock state (gradle.lockfile from dependencyLocking) or dependency verification metadata (gradle/verification-metadata.xml, also at the root of a multi-project build).
Why
Builds are reproducible only when dependency versions are pinned in git.
Check
tracked().exists(f, f.matches(r'(^|/)((settings|buildscript)-)?gradle\.lockfile$') || f == "gradle/verification-metadata.xml") || ["../", "../../", "../../../"].exists(d, file(d + "gradle/verification-metadata.xml"))Fix
Enable dependencyLocking { lockAllConfigurations() } and run ./gradlew dependencies --write-locks, or write verification metadata with ./gradlew --write-verification-metadata sha256 help; commit the result.
Agent instruction (from repo/lockfile-committed): Run the package manager to produce the lockfile, remove any .gitignore entry for it, and commit it.
A finding that names no file points at gradle.lockfile.
Sources
- https://github.com/ossf/package-manager-best-practices/blob/main/published/npm.md (guidance)
- https://fleetlint.org/baseline/#dependencies (convention)
- https://docs.gradle.org/current/userguide/dependency_locking.html (spec)
- https://docs.gradle.org/current/userguide/dependency_verification.html (spec)
- https://fleetlint.org/stacks/#kotlin-jvm–android
Generated by fleetlint docs from catalog v0.8.0.