river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dre...@apache.org
Subject svn commit: r1590736 - in /river/jtsk/skunk/qa_refactor/trunk/modularize: ModularizeRiver.groovy apache-river/pom.xml apache-river/river-platform/pom.xml apache-river/river-resources/ apache-river/river-resources/pom.xml
Date Mon, 28 Apr 2014 18:22:57 GMT
Author: dreedy
Date: Mon Apr 28 18:22:56 2014
New Revision: 1590736

URL: http://svn.apache.org/r1590736
Log:
Added support to generate PREFERRED.LISt files read from jars, and added support to create
the river-resources module

Added:
    river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-resources/
    river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-resources/pom.xml
Modified:
    river/jtsk/skunk/qa_refactor/trunk/modularize/ModularizeRiver.groovy
    river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/pom.xml
    river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-platform/pom.xml

Modified: river/jtsk/skunk/qa_refactor/trunk/modularize/ModularizeRiver.groovy
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/modularize/ModularizeRiver.groovy?rev=1590736&r1=1590735&r2=1590736&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/modularize/ModularizeRiver.groovy (original)
+++ river/jtsk/skunk/qa_refactor/trunk/modularize/ModularizeRiver.groovy Mon Apr 28 18:22:56
2014
@@ -1,5 +1,21 @@
 #!/usr/bin/env groovy
-
+/*
+ * 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.
+ */
 import java.util.zip.ZipEntry
 import java.util.zip.ZipFile
 
@@ -36,10 +52,12 @@ for(Map.Entry<String, String> entry : ja
     Enumeration zipEntries = zipFile.entries()
     while(zipEntries.hasMoreElements()) {
         ZipEntry zipEntry = (ZipEntry)zipEntries.nextElement()
-        if(zipEntry.getName().endsWith("MANIFEST.MF"))
+        if(zipEntry.getName().endsWith("MANIFEST.MF") ||
+           zipEntry.getName().endsWith("META-INF/")   ||
+           zipEntry.getName().endsWith("META-INF/services/"))
             continue
         if(jar.contains("jsk-resources")) {
-            println "\t${zipEntry.getName()}"
+            prepAndCopy(zipFile, zipEntry, src, target)
         } else {
             if(!zipEntry.getName().contains("\$") && !zipEntry.isDirectory()) {
                 if(jar.contains("jsk-platform")) {
@@ -96,10 +114,28 @@ void prepAndCopy(zipFile, zipEntry, src,
                           zipEntry.getName().substring(0, zipEntry.getName().length()-"class".length()))
     } else if(zipEntry.getName().endsWith("PREFERRED.LIST")) {
         iStream = zipFile.getInputStream(zipEntry)
-        //println(iStream.text)
-        println("\t"+String.format("%s/src/main/resources/PREFERRED.LIST", target))
+        File preferredList = new File(String.format("%s/src/main/resources/PREFERRED.LIST",
target))
+        File parent = preferredList.getParentFile()
+        parent.mkdirs()
+        def writer = preferredList.newWriter()
+        writer << iStream.text
+        writer.flush()
+        writer.close()
+        println("\tGenerated "+preferredList.path)
         iStream.close()
         return
+    } else if(zipEntry.getName().startsWith("META-INF/services/")) {
+        String service = zipEntry.getName().substring("META-INF/services/".length())
+        File serviceResource = new File(String.format("%s/src/main/resources/services/%s",
target, service))
+        File parent = serviceResource.getParentFile()
+        parent.mkdirs()
+        iStream = zipFile.getInputStream(zipEntry)
+        def writer = serviceResource.newWriter()
+        writer << iStream.text
+        writer.flush()
+        writer.close()
+        println("\tGenerated "+serviceResource.path)
+        return
     } else {
         source = zipEntry.getName()
     }

Modified: river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/pom.xml
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/pom.xml?rev=1590736&r1=1590735&r2=1590736&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/pom.xml (original)
+++ river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/pom.xml Mon Apr 28 18:22:56
2014
@@ -266,6 +266,7 @@
     <modules>
 	    <module>river-platform</module> 
         <module>river-start</module>
+		<module>river-resources</module> 
         <module>river-lib</module>
         <module>river-dl</module>
         <module>river-services/outrigger/outrigger-dl</module>

Modified: river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-platform/pom.xml
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-platform/pom.xml?rev=1590736&r1=1590735&r2=1590736&view=diff
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-platform/pom.xml (original)
+++ river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-platform/pom.xml Mon
Apr 28 18:22:56 2014
@@ -12,7 +12,13 @@
     <artifactId>river-platform</artifactId>
     <name>Module :: River Platform</name>
 
-     <dependencies>       
+     <dependencies>  
+		 
+         <dependency>
+             <groupId>${project.groupId}</groupId>
+             <artifactId>river-resources</artifactId>
+             <version>${project.version}</version>
+         </dependency>     
         
 		<dependency>
             <groupId>org.codehaus.groovy</groupId>

Added: river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-resources/pom.xml
URL: http://svn.apache.org/viewvc/river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-resources/pom.xml?rev=1590736&view=auto
==============================================================================
--- river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-resources/pom.xml (added)
+++ river/jtsk/skunk/qa_refactor/trunk/modularize/apache-river/river-resources/pom.xml Mon
Apr 28 18:22:56 2014
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <artifactId>river</artifactId>
+        <groupId>org.apache</groupId>
+        <version>3.0-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+    </parent>
+    <groupId>org.apache.river</groupId>
+    <artifactId>river-resources</artifactId>
+    <name>Module :: River Resources</name>
+    <packaging>jar</packaging>
+
+</project>



Mime
View raw message