diff init.gradle @ 78:e47f80ef056b

finish cleanLocal. start adding artifactory plugin
author smith@nwoca.org
date Mon, 06 Feb 2012 18:40:34 -0500
parents e9605748e5ce
children f0c29c1ac1f4
line wrap: on
line diff
--- a/init.gradle	Mon Feb 06 15:27:43 2012 -0500
+++ b/init.gradle	Mon Feb 06 18:40:34 2012 -0500
@@ -10,12 +10,18 @@
 
     task cleanLocal << {
         def local = project.repositories.find { it.name == 'local' } 
-        println local
         if ( local ) {                
-
+            local.dirs.each { 
+                logger.info "removing local repo: $it"
+                it.deleteDir() 
+            }
         }
     }
     
+    cleanLocal.onlyIf { 
+        project.repositories.find { it.name == 'local' }?.dirs.any { it.exists() } 
+    }
+    
     task publishLocal(dependsOn: 'uploadArchives')  << { println "published to local repository" }
 
 }
@@ -23,9 +29,25 @@
 
 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()
+       
         root.subprojects {
         
             configurations.all {
@@ -33,12 +55,6 @@
                 resolutionStrategy.cacheDynamicVersionsFor 120, 'minutes'
             }
         
-            buildscript {
-                repositories {
-                    mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins"
-                }
-            }
-            
             repositories {
 
                 if (!gradle.bambooBuild) {