diff init.gradle @ 83:9c551ecc816a

clean up script to be more maintainable
author smith@nwoca.org
date Thu, 09 Feb 2012 17:19:06 -0500
parents c7cbf5e9db74
children fa7b349201eb
line wrap: on
line diff
--- a/init.gradle	Thu Feb 09 17:01:08 2012 -0500
+++ b/init.gradle	Thu Feb 09 17:19:06 2012 -0500
@@ -13,11 +13,10 @@
 }
 
 wrapper << {
-    // patch wrapper path for 1.0-milestone-7 bug (http://issues.gradle.org/browse/GRADLE-1823)
+    // patch wrapper path for 1.0-milestone-7 (http://issues.gradle.org/browse/GRADLE-1823)
     ant.replace(file: 'gradlew', token: '\\wrapper\\gradle-wrapper.jar',value:'/wrapper/gradle-wrapper.jar')
 }
 
-
 allprojects {
     task cleanLocal << {
         def local = project.repositories.find { it.name == 'local' } 
@@ -36,10 +35,10 @@
 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
     
     def void projectsEvaluated(Gradle gradle) {
+        def ssdtArtifactory = 'http://repos.ssdt.nwoca.org/artifactory'
         Project root = gradle.getRootProject()       
         root.allprojects {
-            def thisProject = delegate
-        
+            def thisProject = delegate        
             configurations.all {
                 resolutionStrategy.cacheChangingModulesFor 120, 'minutes'
                 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes'
@@ -55,23 +54,23 @@
                     }                       
                 }                
                 add(new org.apache.ivy.plugins.resolver.URLResolver()) {
-                  name = 'ssdt-snapshots'
-                  m2compatible =  true
-                  url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots'
-                  addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]')
-                  addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-snapshots/[organization]/[module]/ivy-[revision].xml')
-                  checkmodified = true
-                  changingMatcher = 'regexp'
-                  changingPattern = '.*SNAPSHOT'                  
+                    name = 'ssdt-snapshots'
+                    m2compatible =  true
+                    url = "${ssdtArtifactory}/ssdt-snapshots"
+                    addArtifactPattern("${url}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]")
+                    addIvyPattern("${url}/[organization]/[module]/ivy-[revision].xml")
+                    checkmodified = true
+                    changingMatcher = 'regexp'
+                    changingPattern = '.*SNAPSHOT'                  
                 }
-                add(new org.apache.ivy.plugins.resolver.URLResolver()) {
-                  name = 'ssdt-releases'
-                  m2compatible = false
-                  url = 'http://repos.ssdt.nwoca.org/artifactory/ssdt-releases'
-                  addArtifactPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]')
-                  addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/ivy-[revision].xml')
+                add(new org.apache.ivy.plugins.resolver.URLResolver()) {                
+                    name = 'ssdt-releases'
+                    m2compatible = false
+                    url = "${ssdtArtifactory}/ssdt-releases"
+                    addArtifactPattern("${url}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]")
+                    addIvyPattern("${url}/[organization]/[module]/ivy-[revision].xml")                   
                 }
-                mavenRepo name: 'ssdt-repo', url: 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo'
+                mavenRepo name: 'ssdt-repo', url: "${ssdtArtifactory}/ssdt-repo"
                  
             }