Do I need to generate gradle.lockfile for all module or just toplevel app

I have Android project that has moduleA, moduleB and the app.

When generating gradle.lockfile do I need to do this:

./gradlew :moduleA:dependencies --configuration prodReleaseRuntimeClasspath  --refresh-dependencies --write-lock
./gradlew :moduleA:dependencies --configuration prodReleaseRuntimeClasspath  --refresh-dependencies --write-lock
./gradlew :app:dependencies --configuration prodReleaseRuntimeClasspath  --refresh-dependencies --write-lock

Or this is sufficient?

./gradlew :app:dependencies --configuration prodReleaseRuntimeClasspath  --refresh-dependencies --write-lock