tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r721420 - in /tuscany/java/sca: distribution/core/src/main/components/ modules/node-launcher-equinox/ modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ modules/node-launcher/src/main/java/org/apache/t...
Date Fri, 28 Nov 2008 10:39:51 GMT
Author: slaws
Date: Fri Nov 28 02:39:49 2008
New Revision: 721420

URL: http://svn.apache.org/viewvc?rev=721420&view=rev
Log:
Ensure that all of the jars are located correctly when the node launcher is run from the command
line. 

Modified:
    tuscany/java/sca/distribution/core/src/main/components/bin-samples.xml
    tuscany/java/sca/modules/node-launcher-equinox/pom.xml
    tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
    tuscany/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java

Modified: tuscany/java/sca/distribution/core/src/main/components/bin-samples.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/distribution/core/src/main/components/bin-samples.xml?rev=721420&r1=721419&r2=721420&view=diff
==============================================================================
--- tuscany/java/sca/distribution/core/src/main/components/bin-samples.xml (original)
+++ tuscany/java/sca/distribution/core/src/main/components/bin-samples.xml Fri Nov 28 02:39:49
2008
@@ -21,10 +21,13 @@
 
         <!-- Add samples to the samples directory -->
         <fileSet>
-            <directory>../../../samples</directory>
+            <directory>../../samples</directory>
             <outputDirectory>samples</outputDirectory>
             <includes>
-                <include>calculator/**/*</include>
+                <include>README</include>
+                <include>logging.properties</include>
+                <include>calculator-equinox/**/*</include>
+                <!--include>calculator/**/*</include>
                 <include>calculator-lean/**/*</include>
                 <include>binding-echo/**/*</include>
                 <include>binding-echo-extension/**/*</include>
@@ -36,13 +39,15 @@
                 <include>loanapplication/**/*</include>
                 <include>simple-bigbank/**/*</include>
                 <include>simple-callback/**/*</include>
-                <include>supplychain/**/*</include>
+                <include>supplychain/**/*</include-->
             </includes>
             <excludes>
                 <!-- General file/folders to exclude -->
                 <exclude>**/.*</exclude>
                 <exclude>**/.*/**</exclude>
                 <exclude>**/*.log</exclude>
+                <exclude>**/*.svg</exclude>
+                <exclude>**/maven-eclipse.xml</exclude>
 
                 <!-- Sample specific files/folders to exclude -->
                 <exclude>pom.xml</exclude>

Modified: tuscany/java/sca/modules/node-launcher-equinox/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-launcher-equinox/pom.xml?rev=721420&r1=721419&r2=721420&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-launcher-equinox/pom.xml (original)
+++ tuscany/java/sca/modules/node-launcher-equinox/pom.xml Fri Nov 28 02:39:49 2008
@@ -102,6 +102,7 @@
                     <archive>
                         <manifest>
                             <mainClass>org.apache.tuscany.sca.node.equinox.launcher.NodeMain</mainClass>
+                            <addClasspath>true</addClasspath>
                         </manifest>
                     </archive>
                 </configuration>

Modified: tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java?rev=721420&r1=721419&r2=721420&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
(original)
+++ tuscany/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java
Fri Nov 28 02:39:49 2008
@@ -527,13 +527,17 @@
      * @param filter
      * @throws MalformedURLException
      */
-    private static void collectClasspathEntries(File directory, Set<URL> urls, FilenameFilter
filter) throws MalformedURLException {
+    private static void collectClasspathEntries(File directory, Set<URL> urls, FilenameFilter
filter, boolean recursive) throws MalformedURLException {
         File[] files = directory.listFiles(filter);
         if (files != null) {
             int count = 0;
             for (File file: files) {
-                urls.add(file.toURI().toURL());
-                count++;
+                if (recursive && file.isDirectory()) {
+                	collectClasspathEntries(file, urls, filter, recursive);
+                } else {
+	                urls.add(file.toURI().toURL());
+	                count++;
+                }
             }
             if (count != 0) {
                 logger.info("Runtime classpath: "+ count + " JAR" + (count > 1? "s":"")+
" from " + directory.toString());
@@ -590,14 +594,14 @@
             
             // Collect files under the given directory
             jarDirectoryURLs.add(directoryURL);
-            collectClasspathEntries(directoryFile, jarURLs, filter);
+            collectClasspathEntries(directoryFile, jarURLs, filter, false);
             
             // Collect files under <directory>/modules
             File modulesDirectory = new File(directoryFile, "modules");
             URL modulesDirectoryURL = modulesDirectory.toURI().toURL(); 
             if (!jarDirectoryURLs.contains(modulesDirectoryURL) && modulesDirectory.exists())
{
                 jarDirectoryURLs.add(modulesDirectoryURL);
-                collectClasspathEntries(modulesDirectory, jarURLs, filter);
+                collectClasspathEntries(modulesDirectory, jarURLs, filter, true);
             }
 
             // Collect files under <directory>/lib
@@ -605,7 +609,7 @@
             URL libDirectoryURL = libDirectory.toURI().toURL(); 
             if (!jarDirectoryURLs.contains(libDirectoryURL) && libDirectory.exists())
{
                 jarDirectoryURLs.add(libDirectoryURL);
-                collectClasspathEntries(libDirectory, jarURLs, filter);
+                collectClasspathEntries(libDirectory, jarURLs, filter, true);
             }
         }
     }
@@ -649,7 +653,7 @@
                         // (e.g. the Tuscany modules directory)
                         URL jarDirectoryURL = jarDirectory.toURI().toURL();
                         jarDirectoryURLs.add(jarDirectoryURL);
-                        collectClasspathEntries(jarDirectory, jarURLs, new StandAloneJARFileNameFilter());
+                        collectClasspathEntries(jarDirectory, jarURLs, new StandAloneJARFileNameFilter(),
true);
         
                         File homeDirectory = jarDirectory.getParentFile();
                         if (homeDirectory != null && homeDirectory.exists()) {
@@ -770,6 +774,10 @@
         public boolean accept(File dir, String name) {
             name = name.toLowerCase(); 
             
+            if(new File(dir, name).isDirectory()) {
+                return true;
+            }
+            
             // Filter out the Tomcat and Webapp hosts
             if (name.startsWith("tuscany-host-tomcat") ||
                 name.startsWith("tuscany-host-webapp")) {
@@ -918,7 +926,7 @@
             URL libDirectoryURL = libDirectory.toURI().toURL(); 
             if (!jarDirectoryURLs.contains(libDirectoryURL) && libDirectory.exists())
{
                 jarDirectoryURLs.add(libDirectoryURL);
-                collectClasspathEntries(libDirectory, jarURLs, filter);
+                collectClasspathEntries(libDirectory, jarURLs, filter, false);
             }
         }
     }

Modified: tuscany/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java?rev=721420&r1=721419&r2=721420&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
(original)
+++ tuscany/java/sca/modules/node-launcher/src/main/java/org/apache/tuscany/sca/node/launcher/NodeLauncherUtil.java
Fri Nov 28 02:39:49 2008
@@ -115,7 +115,7 @@
                 if (jarDirectory != null && jarDirectory.exists()) {
                     File homeDirectory = jarDirectory.getParentFile();
                     if (homeDirectory != null && homeDirectory.exists()) {
-                        collectJARFiles(jarDirectory.getPath(), jarDirectoryURLs, jarURLs,
filter);
+                        collectJARFiles(homeDirectory.getPath(), jarDirectoryURLs, jarURLs,
filter);
                     }
                 }
             }
@@ -185,7 +185,7 @@
             if (!jarDirectoryURLs.contains(modulesDirectoryURL) && modulesDirectory.exists())
{
                 jarDirectoryURLs.add(modulesDirectoryURL);
                 collectJARFiles(modulesDirectory, jarURLs, filter, true);
-            }
+            }          
 
             // Collect files under $TUSCANY_HOME/lib
             File libDirectory = new File(directoryFile, "lib");



Mime
View raw message