geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r475519 - /geronimo/genesis/trunk/build-harness/installdeps.groovy
Date Thu, 16 Nov 2006 01:41:58 GMT
Author: jdillon
Date: Wed Nov 15 17:41:58 2006
New Revision: 475519

URL: http://svn.apache.org/viewvc?view=rev&rev=475519
Log:
Need groovy & ants help to install deps and clean out artifact caches

Added:
    geronimo/genesis/trunk/build-harness/installdeps.groovy   (with props)

Added: geronimo/genesis/trunk/build-harness/installdeps.groovy
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/build-harness/installdeps.groovy?view=auto&rev=475519
==============================================================================
--- geronimo/genesis/trunk/build-harness/installdeps.groovy (added)
+++ geronimo/genesis/trunk/build-harness/installdeps.groovy Wed Nov 15 17:41:58 2006
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// $Rev$ $Date$
+//
+
+class InstallDependencies
+{
+    def homedir = new File(System.getProperty("user.home"))
+    
+    def m2RepoCache = new File(homedir, ".m2/repository")
+    
+    def basedir = new File(".").getCanonicalFile()
+    
+    def depsdir = new File(basedir, "dependencies")
+    
+    def ant = new AntBuilder()
+    
+    def cleanCachedArtifacts(depdir) {
+        println "Cleaning cached artifacts..."
+        def scanner = ant.fileScanner {
+            fileset(dir: depdir) {
+                include(name: "**")
+            }
+        }
+        
+        def l = depdir.path.length() + 1
+        scanner.each { file->
+            def basepath = file.getPath()[l .. -1]
+            def dir = new File(m2RepoCache, basepath).getParentFile()
+            if (dir.exists()) {
+                ant.delete(dir: dir)
+            }
+        }
+    }
+    
+    def installArtifacts(depdir) {
+        println "Installing dependencies from: ${depdir}"
+        
+        cleanCachedArtifacts(depdir)
+        
+        println "Copying new artifacts..."
+        ant.copy(todir: m2RepoCache) {
+            fileset(dir: depdir) {
+                include(name: "**")
+            }
+        }
+    }
+    
+    def main() {
+        println "Installing dependencies..."
+        
+        for (depdir in depsdir.listFiles()) {
+            installArtifacts(depdir)
+        }
+    }
+}
+
+new InstallDependencies().main()
\ No newline at end of file

Propchange: geronimo/genesis/trunk/build-harness/installdeps.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/genesis/trunk/build-harness/installdeps.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/genesis/trunk/build-harness/installdeps.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message