diff init.gradle @ 94:1290b23e7b76

modify ivy and gradle to use same local repo
author smith@nwoca.org
date Sat, 03 Mar 2012 21:19:58 +0000
parents 90325a10fe95
children ebb42488396a
line wrap: on
line diff
--- a/init.gradle	Wed Feb 22 19:14:04 2012 +0000
+++ b/init.gradle	Sat Mar 03 21:19:58 2012 +0000
@@ -1,6 +1,11 @@
 
 gradle.ssdtDevelkitLocation = gradle.hasProperty('ssdtDevelkitLocation') ? gradle.ssdtDevelkitLocation : 'http://hg.ssdt-ohio.org/browse/public/develkit'
 
+ant.property(file: System.getProperty('user.home') + "/.ssdt/private.properties")
+if (ant.properties['ivy.default.ivy.user.dir']) {
+  gradle.ivyUserDir = ant.properties['ivy.default.ivy.user.dir'] ?: System.getProperty('user.home') + "/.ivy2"
+}
+
 gradle.addListener(new ArtifactoryGradleSettings())
 
 gradle.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')}
@@ -31,6 +36,7 @@
         if ( local ) {                  
             logger.info "removing local repo: $it"
             new File(System.properties['user.home'] + "/.ssdt/local-repo").deleteDir() 
+            new File(gradle.ivyUserDir + "/local").deleteDir() 
         }
     }    
     
@@ -55,10 +61,13 @@
                 if (!gradle.bambooBuild) {                         
                     add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) {
                         name = 'local'
-                        addIvyPattern System.properties['user.home'] + "/.ssdt/local-repo/[module]-ivy-[revision].xml"
-                        addArtifactPattern System.properties['user.home'] + "/.ssdt/local-repo/[module]-[revision](-[classifier]).[ext]"
+                        addIvyPattern gradle.ivyUserDir + "/local/[module]-ivy-[revision].xml"
+                        addArtifactPattern gradle.ivyUserDir + '/local/[module]-[revision](-[classifier]).[ext]'
                         descriptor = 'optional'
                         checkmodified = true
+                        changingMatcher = 'regexp'
+                        changingPattern = '.*SNAPSHOT'   
+                        force = true
                     }                       
                 }                
                 add(new org.apache.ivy.plugins.resolver.URLResolver()) {