comparison init20.gradle @ 195:a7a7d0e263d6

allow private setting of changing/dynamic cache lifetime.
author smith@nwoca.org
date Tue, 21 Jul 2015 19:56:51 +0100
parents 0c0b1413ea70
children 57edc00a90b8
comparison
equal deleted inserted replaced
193:0c0b1413ea70 195:a7a7d0e263d6
69 gradle.environment.put('hgRepositoryUrl', gradle.hgRepositoryUrl) 69 gradle.environment.put('hgRepositoryUrl', gradle.hgRepositoryUrl)
70 gradle.environment.put('branchName', gradle.branch.name) 70 gradle.environment.put('branchName', gradle.branch.name)
71 gradle.environment.put('branchStream', gradle.branch.stream) 71 gradle.environment.put('branchStream', gradle.branch.stream)
72 gradle.environment.put('branchHash', gradle.branch.hash) 72 gradle.environment.put('branchHash', gradle.branch.hash)
73 73
74 74 def cacheTimeout = 60 * 60 * 8
75 if (gradle.environment['dependencyTimeout']) {
76 cacheTimeout = gradle.environment['dependencyTimeout'] as Integer
77 println "setting dependency timeout to $cacheTimeout seconds"
78 }
79
80 gradle.ext.cacheTimeout = cacheTimeout
75 81
76 rootProject.ext.indyCapable = { 82 rootProject.ext.indyCapable = {
77 boolean capable = true 83 boolean capable = true
78 try { 84 try {
79 Class.forName('java.lang.invoke.MethodHandle') 85 Class.forName('java.lang.invoke.MethodHandle')
335 } 341 }
336 thisProject.version = fixupVersion 342 thisProject.version = fixupVersion
337 } 343 }
338 344
339 configurations.all { 345 configurations.all {
340 resolutionStrategy.cacheChangingModulesFor 60 * 60 * 8, 'seconds' 346 resolutionStrategy.cacheChangingModulesFor gradle.cacheTimeout, 'seconds'
341 resolutionStrategy.cacheDynamicVersionsFor 60 * 60 * 8, 'seconds' 347 resolutionStrategy.cacheDynamicVersionsFor gradle.cacheTimeout, 'seconds'
342 } 348 }
343 repositories { 349 repositories {
344 350
345 if (!gradle.bambooBuild) { 351 if (!gradle.bambooBuild) {
346 ivy { 352 ivy {