Lock libraries version

Terra uses dynamic version (Android / iOS) for its libraries, which means Terra libraries' version will automatically increase when you build app.

This will help deliver libraries' fixes automatically, however it makes your build become irreproducible - which is not preferred especially with deployment builds.

Our suggestion is that for deployment builds, you should lock the libraries' version as following guideline

  • Add to your project's build.gradle following code
allprojects {
dependencyLocking {
lockAllConfigurations()
}
}
  • Add to settting.gradle following code
enableFeaturePreview("ONE_LOCKFILE_PER_PROJECT")
  • For every module of your android project that use Terra, run gradle <module>:dependencies --write-locks to generate gradle.lockfile. The file will be at the root folder of your module and look something like:
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
androidx.activity:activity-ktx:1.1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugImplementationDependenciesMetadata,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseImplementationDependenciesMetadata,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath
androidx.activity:activity:1.2.4=debugAndroidTestCompileClasspath,debugCompileClasspath,debugImplementationDependenciesMetadata,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseImplementationDependenciesMetadata,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath
androidx.annotation:annotation-experimental:1.1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugImplementationDependenciesMetadata,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseImplementationDependenciesMetadata,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath
...
  • Commit this gradle.lockfile to remote repository. Whenever you want to unlock to update new libraries' version, do not increase the version in build.gradle but edit the versions inside this file instead, then refresh the dependencies as:

For more information please refer official document