Skip to content

Commit

Permalink
Merge pull request #111 from rspieldenner/cache_expiry
Browse files Browse the repository at this point in the history
Move where we set cache expiry to 0 when generating and updating locks
  • Loading branch information
rspieldenner authored Nov 10, 2016
2 parents 9fb2cf0 + 83ed6df commit aa04aa7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ class DependencyLockPlugin implements Plugin<Project> {
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 {
Expand Down Expand Up @@ -315,12 +326,6 @@ class DependencyLockPlugin implements Plugin<Project> {
appliedLock = true
}
}
if (hasGenerateTask) {
conf.resolutionStrategy {
cacheDynamicVersionsFor 0, 'seconds'
cacheChangingModulesFor 0, 'seconds'
}
}
if (!appliedLock) {
applyOverrides(conf, overrides)
}
Expand Down

0 comments on commit aa04aa7

Please sign in to comment.