Author: jsdelfino
Date: Tue Mar 25 02:56:25 2008
New Revision: 640755

URL: http://svn.apache.org/viewvc?rev=640755&view=rev
Log:
Fix for TUSCANY-2119. Fixed the build of the updatesite to reference the URL of 
a Tuscany distribution. Added -incubating to the names of the plugin JARs. 
Changed the ClassPathContainer to reference the runtime JARs from the Tuscany 
distro downloaded with the Eclipse feature. Minor fix to the wizard to generate 
a targetNamespace in new composite and componentType files.

Modified:
    incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF
    
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
    
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
    
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java
    incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml
    incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml
    incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml
    
incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml

Modified: incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml 
(original)
+++ incubator/tuscany/java/sca/tools/eclipse/features/feature/feature.xml Tue 
Mar 25 02:56:25 2008
@@ -22,13 +22,14 @@
       label="Apache Tuscany SCA Tools"
       version="1.2.0"
       provider-name="Apache Software Foundation">
+   <install-handler handler="org.eclipse.update.core.DefaultInstallHandler"/>
 
    <description url="http://incubator.apache.org/tuscany";>
       Apache Tuscany SCA Tools.
    </description>
 
    <license url="http://www.apache.org/licenses/LICENSE-2.0";>
-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 &quot;License&quot;); 
you may not use this file except in compliance with the License.  You may 
obtain a copy of the License at
+      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 
&quot;License&quot;); 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
     
@@ -36,6 +37,7 @@
    </license>
 
    <requires>
+      <import plugin="org.eclipse.ui.ide"/>
       <import plugin="org.eclipse.core.resources"/>
       <import plugin="org.eclipse.core.runtime"/>
       <import plugin="org.eclipse.core.jobs"/>
@@ -47,7 +49,6 @@
       <import plugin="org.eclipse.jdt.ui"/>
       <import plugin="org.eclipse.jface"/>
       <import plugin="org.eclipse.swt"/>
-      <import plugin="org.eclipse.ui.ide"/>
       <import plugin="org.eclipse.osgi"/>
    </requires>
 
@@ -57,5 +58,15 @@
          install-size="0"
          version="1.2.0"
          unpack="false"/>
+
+   <data
+         id="runtime.jar"
+         download-size="0"
+         install-size="0"/>
+
+   <data
+         id="src/apache-tuscany-sca-1.2-incubating-SNAPSHOT-src.zip"
+         download-size="0"
+         install-size="0"/>
 
 </feature>

Modified: 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF 
(original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/META-INF/MANIFEST.MF 
Tue Mar 25 02:56:25 2008
@@ -18,6 +18,7 @@
  org.eclipse.jface.resource,
  org.eclipse.jface.viewers,
  org.eclipse.jface.wizard,
+ org.eclipse.osgi.service.datalocation;version="1.0.0",
  org.eclipse.swt,
  org.eclipse.swt.graphics,
  org.eclipse.swt.widgets,

Modified: 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
 (original)
+++ 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/classpath/TuscanyClasspathContainer.java
 Tue Mar 25 02:56:25 2008
@@ -20,11 +20,14 @@
 package org.apache.tuscany.sca.core.classpath;
 
 import java.io.File;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jdt.core.IClasspathContainer;
 import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.JavaCore;
@@ -38,6 +41,9 @@
     
     private static final String TUSCANY_HOME = "TUSCANY_HOME";
     private static final String TUSCANY_SRC = "TUSCANY_SRC";
+    private static final String TUSCANY_FEATURE = 
"features/org.apache.tuscany.sca.feature_1.2.0";
+    private static final String TUSCANY_FEATURE_RUNTIME = TUSCANY_FEATURE + 
"/runtime/tuscany-sca-1.2-incubating-SNAPSHOT"; 
+    private static final String TUSCANY_FEATURE_SRC = TUSCANY_FEATURE + 
"/src/apache-tuscany-sca-1.2-incubating-SNAPSHOT-src.zip"; 
 
     public TuscanyClasspathContainer() {
     }
@@ -45,38 +51,58 @@
     public IClasspathEntry[] getClasspathEntries() {
         List<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
         
-        // Get the runtime plugin location
-//        IPath runtimePath;
-//        try {
-//            URL url = 
FileLocator.toFileURL(Platform.getBundle("org.apache.tuscany.sca.runtime").getEntry("/"));
-//            runtimePath = new Path(url.getFile());
-//        } catch (IOException e) {
-//            throw new IllegalArgumentException(e);
-//        }
-        
-        // Get the location of the Tuscany binary distribution from
-        // the TUSCANY_SOURCE property or environment variable
-        String home = System.getProperty(TUSCANY_HOME);
-        if (home == null || home.length() == 0) {
-            home = System.getenv(TUSCANY_HOME);
+        // Get the runtime location from the installed Tuscany feature
+        IPath runtimePath = null;
+        try {
+            //FIXME Need a better way to find the location of the Tuscany 
feature
+            URL url = 
FileLocator.toFileURL(Platform.getInstallLocation().getURL());
+            File file = new File(url.toURI());
+            file = new File(file, TUSCANY_FEATURE_RUNTIME);
+            if (file.exists()) {
+                runtimePath = new Path(file.getPath());
+            }
+        } catch (Exception e) {
+
+            // Try to get the location of the Tuscany binary distribution from
+            // the TUSCANY_HOME property or environment variable
+            String home = System.getProperty(TUSCANY_HOME);
+            if (home == null || home.length() == 0) {
+                home = System.getenv(TUSCANY_HOME);
+            }
+            if (home != null && home.length() != 0) {
+                if (new File(home).exists()) {
+                    runtimePath = new Path(home);
+                }
+            }
         }
-        if (home != null && home.length() != 0) {
-            IPath runtimePath = new Path(home);
+        
+        // Get the source location from the installed Tuscany feature
+        IPath sourcePath = null;
+        try {
+            //FIXME Need a better way to find the location of the Tuscany 
feature
+            URL url = 
FileLocator.toFileURL(Platform.getInstallLocation().getURL());
+            File file = new File(url.toURI());
+            file = new File(file, TUSCANY_FEATURE_SRC);
+            if (file.exists()) {
+                sourcePath = new Path(file.getPath());
+            }
+        } catch (Exception e) {
 
-            // Get the location of the Tuscany source distribution from
-            // the TUSCANY_SOURCE property or environment variable
+            // Try to get the location of the Tuscany source distribution from
+            // the TUSCANY_SRC property or environment variable
             String source = System.getProperty(TUSCANY_SRC);
             if (source == null || source.length() == 0) {
                 source = System.getenv(TUSCANY_SRC);
             }
-            IPath sourcePath;
             if (source != null && source.length() != 0) {
-                sourcePath = new Path(source);
-            } else {
-                sourcePath = null;
+                if (new File(source).exists()) {
+                    sourcePath = new Path(source);
+                }
             }
-            
-            // Add JARs from runtime/lib and runtime/modules as classpath 
entries
+        }
+        
+        // Add the JARs from runtime/lib and runtime/modules as classpath 
entries
+        if (runtimePath != null) {
             for (String directory: new String[]{"modules", "lib"}) {
                 File parent = runtimePath.append(directory).toFile();
                 if (parent != null && parent.exists()) {
@@ -86,6 +112,24 @@
                         if (!"jar".equals(extension)) {
                             continue;
                         }
+
+                        // Exclude tuscany-sca-all and tuscany-sca-manifest as 
they duplicate
+                        // code in the individual runtime module JARs
+                        String name = path.lastSegment();
+                        if (name.startsWith("tuscany-sca-all")) {
+                            continue;
+                        }
+                        if (name.startsWith("tuscany-sca-manifest")) {
+                            continue;
+                        }
+                        
+                        // Filter out the Jetty and Webapp hosts
+                        if (name.startsWith("tuscany-host-jetty") ||
+                            name.startsWith("tuscany-host-webapp")) {
+                            //FIXME This is temporary
+                            continue;
+                        }
+                        
                         list.add(JavaCore.newLibraryEntry(path, sourcePath, 
null));
                     }
                 }

Modified: 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
 (original)
+++ 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewComponentTypeWizardPage.java
 Tue Mar 25 02:56:25 2008
@@ -85,8 +85,8 @@
                ByteArrayOutputStream outputStream = new 
ByteArrayOutputStream();
                PrintWriter printWriter = new PrintWriter(outputStream);
                printWriter.println("<?xml version=\"1.0\" 
encoding=\"UTF-8\"?>");
-               printWriter.println("<componentType     
xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"";);
-               printWriter.println("                           
xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\";>"); 
+               printWriter.println("<componentType 
xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"";);
+               printWriter.println("    
xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\";>");        
                printWriter.println();
                printWriter.println();
                printWriter.println("</componentType>");

Modified: 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java
 (original)
+++ 
incubator/tuscany/java/sca/tools/eclipse/plugins/core/org/apache/tuscany/sca/core/newwizards/NewCompositeWizardPage.java
 Tue Mar 25 02:56:25 2008
@@ -89,10 +89,11 @@
                ByteArrayOutputStream outputStream = new 
ByteArrayOutputStream();
                PrintWriter printWriter = new PrintWriter(outputStream);
                printWriter.println("<?xml version=\"1.0\" 
encoding=\"UTF-8\"?>");              
-               printWriter.println("<composite 
xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"";);
-               printWriter.println("                   
xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\"";);
-               printWriter.println("                   xmlns:c=\"http://"; + 
name + "\"");      
-               printWriter.println("                   name=\"" + name + 
"\">");
+               printWriter.println("<composite 
xmlns=\"http://www.osoa.org/xmlns/sca/1.0\"";);
+               printWriter.println("    
xmlns:t=\"http://tuscany.apache.org/xmlns/sca/1.0\"";);
+               printWriter.println("    xmlns:c=\"http://"; + name + "\"");     
+                printWriter.println("    targetNamespace=\"http://"; + name + 
"\"");      
+               printWriter.println("    name=\"" + name + "\">");
                printWriter.println();
                 printWriter.println();
                printWriter.println("</composite>");

Modified: incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/plugins/core/plugin.xml Tue Mar 25 
02:56:25 2008
@@ -18,8 +18,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<plugin>
-
+<plugin>
+
        <extension point = "org.eclipse.wst.xml.core.catalogContributions">
                <catalogContribution id="default">
                        <uri name="http://www.osoa.org/xmlns/sca/1.0"; 
uri="xsd/sca-all.xsd"/>

Modified: incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/site/updatesite/pom.xml Tue Mar 25 
02:56:25 2008
@@ -30,6 +30,10 @@
     <artifactId>org.apache.tuscany.sca.updatesite</artifactId>
     <name>Apache Tuscany SCA Eclipse Tools Update Site</name>
 
+    <properties>
+        <tuscany.version>${pom.version}</tuscany.version>
+    </properties>
+    
     <dependencies>
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
@@ -71,6 +75,7 @@
                                 
<descriptor>src/main/assembly/updatesite.xml</descriptor>
                             </descriptors>
                             <tarLongFileMode>gnu</tarLongFileMode>
+                            
<finalName>apache-tuscany-sca-updatesite-${pom.version}</finalName>
                         </configuration>
                     </execution>
                 </executions>

Modified: incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml (original)
+++ incubator/tuscany/java/sca/tools/eclipse/site/updatesite/site.xml Tue Mar 
25 02:56:25 2008
@@ -1,7 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <site>
-   <description 
url="http://people.apache.org/~jsdelfino/tuscany/tools/updatesite";>
+   <description url="http://incubator.apache.org/tuscany";>
       Apache Tuscany SCA Tools.
    </description>
-   <feature url="features/org.apache.tuscany.sca.feature_1.2.0.jar" 
id="org.apache.tuscany.sca.feature" version="1.2.0"/>
+   
+   <feature id="org.apache.tuscany.sca.feature" version="1.2.0"
+      
url="features/org.apache.tuscany.sca.feature-2.0-incubating-SNAPSHOT.jar"/>
+   
+   <archive path="plugins/org.apache.tuscany.sca.core_1.2.0.jar"
+      url="plugins/org.apache.tuscany.sca.core-2.0-incubating-SNAPSHOT.jar"/>
+
+   <archive path="features/org.apache.tuscany.sca.feature_1.2.0/runtime.jar"
+      url="../apache-tuscany-sca-1.2-incubating-SNAPSHOT.zip"/>   
+
+   <archive 
path="features/org.apache.tuscany.sca.feature_1.2.0/src/apache-tuscany-sca-1.2-incubating-SNAPSHOT-src.zip"
+      url="../apache-tuscany-sca-1.2-incubating-SNAPSHOT-src.zip"/>   
 </site>

Modified: 
incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml?rev=640755&r1=640754&r2=640755&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml
 (original)
+++ 
incubator/tuscany/java/sca/tools/eclipse/site/updatesite/src/main/assembly/updatesite.xml
 Tue Mar 25 02:56:25 2008
@@ -26,6 +26,7 @@
 
     <fileSets>
         <fileSet>
+             
<outputDirectory>tuscany-sca-updatesite-${tuscany.version}</outputDirectory>
             <includes>
                 <include>DISCLAIMER</include>
                 <include>LICENSE</include>
@@ -37,23 +38,21 @@
         
     <dependencySets>
         <dependencySet>
-            <outputDirectory>plugins</outputDirectory>
+             
<outputDirectory>tuscany-sca-updatesite-${tuscany.version}/plugins</outputDirectory>
             <unpack>false</unpack>
             <includes>
                 
<include>org.apache.tuscany.sca:org.apache.tuscany.sca.core</include>
             </includes>
             <scope>runtime</scope>
-            
<outputFileNameMapping>${artifactId}_1.1.0.${extension}</outputFileNameMapping>
         </dependencySet>
 
         <dependencySet>
-            <outputDirectory>features</outputDirectory>
+            
<outputDirectory>tuscany-sca-updatesite-${tuscany.version}/features</outputDirectory>
             <unpack>false</unpack>
             <includes>
                 
<include>org.apache.tuscany.sca:org.apache.tuscany.sca.feature</include>
             </includes>
             <scope>runtime</scope>
-            
<outputFileNameMapping>${artifactId}_1.1.0.${extension}</outputFileNameMapping>
         </dependencySet>
     </dependencySets>
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to