diff init.gradle @ 79:f0c29c1ac1f4

finish gradle to artifactory publishing
author smith@nwoca.org
date Tue, 07 Feb 2012 22:21:53 -0500
parents e47f80ef056b
children 647840c0753d
line wrap: on
line diff
--- a/init.gradle	Mon Feb 06 18:40:34 2012 -0500
+++ b/init.gradle	Tue Feb 07 22:21:53 2012 -0500
@@ -1,13 +1,15 @@
 
-logger.debug("applying SSDT artifactory Gradle Settings")
 
 gradle.addListener(new ArtifactoryGradleSettings())
 
 gradle.bambooBuild = System.getenv().any { it.key.startsWith('BAMBOO')}
-logger.info "bamboo build: $gradle.bambooBuild"
+logger.info "applying SSDT artifactory Gradle Settings (bamboo: $gradle.bambooBuild)"
+
+if (gradle.bambooBuild) {
+   apply from: "${gradle.hasProperty('ssdtGradlekitLocation') ? gradle.ssdtGradlekitLocation :'http://hg.ssdt-ohio.org/browse/ssdt/gradlekit'}/artifactory.gradle"
+}
 
 subprojects {
-
     task cleanLocal << {
         def local = project.repositories.find { it.name == 'local' } 
         if ( local ) {                
@@ -16,54 +18,31 @@
                 it.deleteDir() 
             }
         }
-    }
-    
+    }    
     cleanLocal.onlyIf { 
         project.repositories.find { it.name == 'local' }?.dirs.any { it.exists() } 
-    }
-    
+    }    
     task publishLocal(dependsOn: 'uploadArchives')  << { println "published to local repository" }
-
 }
-    
 
 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
-
-    def void projectsLoaded(Gradle gradle) {
-
-    Project root = gradle.getRootProject()
-
-        root.allprojects {
-             buildscript {
-                repositories {
-                    mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins"
-                }
-                dependencies {
-                    classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.10')
-                }
-            }
-        }
-    }
+    
     def void projectsEvaluated(Gradle gradle) {
         
-        Project root = gradle.getRootProject()
-       
+        Project root = gradle.getRootProject()       
         root.subprojects {
         
             configurations.all {
                 resolutionStrategy.cacheChangingModulesFor 120, 'minutes'
                 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes'
-            }
-        
+            }        
             repositories {
-
                 if (!gradle.bambooBuild) {
                     flatDir {
                         name "local"
                         dirs System.properties['user.home'] + "/.ssdt/local-repo"
                     }    
-                }
-                
+                }                
                 add(new org.apache.ivy.plugins.resolver.URLResolver()) {
                   name = 'ssdt-snapshots'
                   m2compatible =  true