From 83ed6df50332a0a0270e1e52803bc04a2c20621e Mon Sep 17 00:00:00 2001 From: Rob Spieldenner Date: Thu, 10 Nov 2016 10:45:41 -0800 Subject: [PATCH] Move where we set cache expiry to 0 when generating and updating locks --- CONTRIBUTING.md | 2 +- README.md | 6 ++++++ build.gradle | 4 ++-- .../dependencylock/DependencyLockPlugin.groovy | 17 +++++++++++------ 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 158ed0a3..f514a75c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ By contributing your code, you agree to license your contribution under the term ``` /** - * Copyright 2015 the original author or authors. + * Copyright 2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index ce827593..9ec4032f 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,12 @@ Tested with Oracle JDK8 | 2.8 | yes | | 2.9 | yes | | 2.10 | yes | +| 2.11 | yes | +| 2.12 | yes | +| 2.13 | yes | +| 2.14.1 | yes | +| 3.0 | yes | +| 3.1 | yes | LICENSE ======= diff --git a/build.gradle b/build.gradle index 8f98a28a..1e7f0ed8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 Netflix, Inc. + * Copyright 2014-2016 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,7 +64,7 @@ pluginBundle { } gradleTest { - versions '2.2.1', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.10' + versions '2.2.1', '2.3', '2.4', '2.5', '2.6', '2.7', '2.8', '2.9', '2.10', '2.11', '2.12', '2.13', '2.14.1', '3.0', '3.1' } gradleTest.dependsOn(jar) diff --git a/src/main/groovy/nebula/plugin/dependencylock/DependencyLockPlugin.groovy b/src/main/groovy/nebula/plugin/dependencylock/DependencyLockPlugin.groovy index 2ba73d0b..b32afc1a 100644 --- a/src/main/groovy/nebula/plugin/dependencylock/DependencyLockPlugin.groovy +++ b/src/main/groovy/nebula/plugin/dependencylock/DependencyLockPlugin.groovy @@ -80,6 +80,17 @@ class DependencyLockPlugin implements Plugin { LOGGER.info("Applying dependency lock during plugin apply ($LOCK_AFTER_EVALUATING set to false)") } + project.gradle.taskGraph.whenReady { + if (hasGenerationTask(project.gradle.startParameter.taskNames)) { + project.configurations.all { + resolutionStrategy { + cacheDynamicVersionsFor 0, 'seconds' + cacheChangingModulesFor 0, 'seconds' + } + } + } + } + project.configurations.all({ conf -> if (lockAfterEvaluating) { conf.incoming.beforeResolve { @@ -315,12 +326,6 @@ class DependencyLockPlugin implements Plugin { appliedLock = true } } - if (hasGenerateTask) { - conf.resolutionStrategy { - cacheDynamicVersionsFor 0, 'seconds' - cacheChangingModulesFor 0, 'seconds' - } - } if (!appliedLock) { applyOverrides(conf, overrides) }