Add the ability to turn off dependency locking

This makes it easy to experiment with new dependency versions or new plugins
without having to update the lock files, by adding "-PdisableDependencyLocking=true" to any gradle command.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=249463575
This commit is contained in:
jianglai 2019-05-22 09:34:55 -07:00
parent 243fce84ce
commit 5f7e725c29
4 changed files with 28 additions and 18 deletions

View file

@ -1,8 +1,10 @@
buildscript { buildscript {
if (project.disableDependencyLocking.toBoolean() == false) {
// Lock buildscript dependencies. // Lock buildscript dependencies.
configurations.classpath { configurations.classpath {
resolutionStrategy.activateDependencyLocking() resolutionStrategy.activateDependencyLocking()
} }
}
dependencies { dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.3' classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.3'
@ -98,17 +100,19 @@ subprojects {
// Skip no-op project // Skip no-op project
if (project.name == 'services') return if (project.name == 'services') return
if (rootProject.disableDependencyLocking.toBoolean() == false) {
buildscript { buildscript {
// Lock buildscript dependencies. // Lock buildscript dependencies.
configurations.classpath { configurations.classpath {
resolutionStrategy.activateDependencyLocking() resolutionStrategy.activateDependencyLocking()
} }
} }
// Lock application dependencies. // Lock application dependencies.
dependencyLocking { dependencyLocking {
lockAllConfigurations() lockAllConfigurations()
} }
}
def services = [':services:default', def services = [':services:default',
':services:backend', ':services:backend',

View file

@ -1,8 +1,10 @@
buildscript { buildscript {
if (rootProject.disableDependencyLocking.toBoolean() == false) {
// Lock buildscript dependencies. // Lock buildscript dependencies.
configurations.classpath { configurations.classpath {
resolutionStrategy.activateDependencyLocking() resolutionStrategy.activateDependencyLocking()
} }
}
} }
plugins { plugins {
@ -17,9 +19,11 @@ plugins {
id 'com.diffplug.gradle.spotless' version '3.18.0' id 'com.diffplug.gradle.spotless' version '3.18.0'
} }
// Lock application dependencies. if (rootProject.disableDependencyLocking.toBoolean() == false) {
dependencyLocking { // Lock application dependencies.
dependencyLocking {
lockAllConfigurations() lockAllConfigurations()
}
} }
repositories { repositories {

View file

@ -0,0 +1 @@
disableDependencyLocking=false

View file

@ -4,3 +4,4 @@ uploaderDestination=
uploaderCredentialsFile= uploaderCredentialsFile=
uploaderMultithreadedUpload= uploaderMultithreadedUpload=
flowDocsFile= flowDocsFile=
disableDependencyLocking=false