Neither the source code nor the Gradle Build Script are dependent on the version control system or the build environment
The bridge between the source code, the build environment and the version control system is the CI build script, which transfers the information from the build environment and the version control system to the Gradle Build Script.
The commit ID is optional and can be transferred to the Gradle Build Script with the parameter --project-prop vcs.commit = $ COMMIT.