changeset 75:02cc8e50945e

allow local file repo for local builds
author smith@nwoca.org
date Sun, 05 Feb 2012 15:44:08 -0500
parents a622ec40a570
children 15a5fd89d80b
files init.gradle
diffstat 1 files changed, 33 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/init.gradle	Sat Feb 04 16:24:38 2012 -0500
+++ b/init.gradle	Sun Feb 05 15:44:08 2012 -0500
@@ -3,13 +3,27 @@
 
 gradle.addListener(new ArtifactoryGradleSettings())
 
+subprojects {
+
+    task cleanLocal << {
+        def local = project.repositories.find { it.name == 'local' } 
+        println local
+        if ( local ) {                
+
+        }
+    }
+    
+    task publishLocal(dependsOn: 'uploadArchives')  << { println "published to local repository" }
+
+}
+    
+
 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
 
     def void projectsEvaluated(Gradle gradle) {
-    
-    
+        
         Project root = gradle.getRootProject()
-        root.allprojects {
+        root.subprojects {
         
             configurations.all {
                 resolutionStrategy.cacheChangingModulesFor 120, 'minutes'
@@ -21,9 +35,14 @@
                     mavenRepo name: 'plugins-repo', url: "http://repos.ssdt.nwoca.org/artifactory/gradle-plugins"
                 }
             }
-
+            
             repositories {
 
+                flatDir {
+                    name "local"
+                    dirs System.properties['user.home'] + "/.ssdt/local-repo"
+                }    
+                
                 add(new org.apache.ivy.plugins.resolver.URLResolver()) {
                   name = 'ssdt-snapshots'
                   m2compatible =  true
@@ -42,7 +61,16 @@
                   addIvyPattern('http://repos.ssdt.nwoca.org/artifactory/ssdt-releases/[organization]/[module]/ivy-[revision].xml')
                 }
                 mavenRepo name: 'ssdt-repo', url: 'http://repos.ssdt.nwoca.org/artifactory/ssdt-repo'
-            }
+                 
+            }           
+              
+            uploadArchives {
+                repositories {
+                    if ( project.repositories.find { it.name == 'local' } ) {                
+                        add project.repositories.local
+                    }
+                }
+            }          
         }
     }
 }
\ No newline at end of file