geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r659509 - in /geronimo/gshell/trunk: gshell-assembly/src/main/underlay/etc/ gshell-command-api/src/main/java/org/apache/geronimo/gshell/shell/ gshell-core/src/main/java/org/apache/geronimo/gshell/application/ gshell-model/src/main/java/org/...
Date Fri, 23 May 2008 11:44:33 GMT
Author: jdillon
Date: Fri May 23 04:44:32 2008
New Revision: 659509

URL: http://svn.apache.org/viewvc?rev=659509&view=rev
Log:
Add dependencies(boolean) to aggregate groups
Use groups in the default application.xml

Modified:
    geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml
    geronimo/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java
    geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/DependencyGroup.java
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
    geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
    geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java
    geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml

Modified: geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml (original)
+++ geronimo/gshell/trunk/gshell-assembly/src/main/underlay/etc/application.xml Fri May 23
04:44:32 2008
@@ -21,6 +21,10 @@
 <!-- $Rev$ $Date$ -->
 
 <application>
+
+    <groupId>org.apache.geronimo.gshell</groupId>
+    <artifactId>gshell</artifactId>
+    <version>1.0-alpha-2-SNAPSHOT</version>
     
     <localRepository>
         <directory>repository</directory>
@@ -40,13 +44,28 @@
         </remoteRepository>
     </remoteRepositories>
 
-    <dependencies>
-        <dependency>
+    <dependencyGroups>
+        <dependencyGroup>
             <groupId>org.apache.geronimo.gshell.commands</groupId>
-            <artifactId>gshell-builtins</artifactId>
             <version>1.0-alpha-2-SNAPSHOT</version>
-        </dependency>
-    </dependencies>
+
+            <dependency>
+                <artifactId>gshell-builtins</artifactId>
+            </dependency>
+
+            <dependency>
+                <artifactId>gshell-optional</artifactId>
+            </dependency>
+
+            <dependency>
+                <artifactId>gshell-bsf</artifactId>
+            </dependency>
+
+            <dependency>
+                <artifactId>gshell-vfs</artifactId>
+            </dependency>
+        </dependencyGroup>
+    </dependencyGroups>
 
     <layout>
         <nodes>
@@ -107,7 +126,6 @@
 
             <group>
                 <name>optional</name>
-
                 <nodes>
                     <command>
                         <name>cat</name>
@@ -138,7 +156,6 @@
 
             <group>
                 <name>bsf</name>
-
                 <nodes>
                     <command>
                         <name>script</name>
@@ -149,7 +166,6 @@
 
             <group>
                 <name>vfs</name>
-
                 <nodes>
                     <command>
                         <name>copy</name>
@@ -160,7 +176,6 @@
 
             <group>
                 <name>remote</name>
-
                 <nodes>
                     <command>
                         <name>rsh</name>

Modified: geronimo/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java
(original)
+++ geronimo/gshell/trunk/gshell-command-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java
Fri May 23 04:44:32 2008
@@ -29,6 +29,8 @@
  */
 public interface Environment
 {
+    // TODO: Rename to ShellContext
+    
     IO getIO();
 
     Variables getVariables();

Modified: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
(original)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
Fri May 23 04:44:32 2008
@@ -204,7 +204,7 @@
         request.setFilter(new ScopeArtifactFilter(Artifact.SCOPE_RUNTIME));
 
         Set<Artifact> artifacts = new LinkedHashSet<Artifact>();
-        List<Dependency> dependencies = application.dependencies();
+        List<Dependency> dependencies = application.dependencies(true); // include
groups
 
         if (dependencies != null && !dependencies.isEmpty()) {
             log.debug("Application dependencies:");

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/application/Application.java
Fri May 23 04:44:32 2008
@@ -30,7 +30,6 @@
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Properties;
-import java.io.File;
 
 /**
  * Application model root element.
@@ -41,15 +40,12 @@
 public class Application
     extends ModelRoot
 {
-    // TODO: Generate from g+a+v
-    private String id;
+    private String groupId;
 
-    // TODO: groupId
+    private String artifactId;
 
-    // TODO: artifactId
+    private String version;
 
-    // TODO: version
-    
     private String name;
 
     private String description;
@@ -70,12 +66,32 @@
 
     // TODO: Paths
 
-    public String getId() {
-        return id;
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public void setGroupId(final String groupId) {
+        this.groupId = groupId;
+    }
+
+    public String getArtifactId() {
+        return artifactId;
+    }
+
+    public void setArtifactId(final String artifactId) {
+        this.artifactId = artifactId;
+    }
+
+    public String getVersion() {
+        return version;
     }
 
-    public void setId(final String id) {
-        this.id = id;
+    public void setVersion(final String version) {
+        this.version = version;
+    }
+
+    public String getId() {
+        return getGroupId() + ":" + getArtifactId() + ":" + getVersion();
     }
 
     public String getName() {
@@ -114,6 +130,10 @@
         return remoteRepositories;
     }
 
+    //
+    // TODO: Consider making accessors of collection types return non-null always to simplify
usage (avoid needing that null check)
+    //
+
     public void add(final RemoteRepository repository) {
         assert repository != null;
 
@@ -124,40 +144,60 @@
         remoteRepositories.add(repository);
     }
 
-    //
-    // TODO: Change to Plugin* ?
-    //
+    public List<DependencyGroup> dependencyGroups() {
+        return dependencyGroups;
+    }
 
-    //
-    // TODO: Provide accessor to aggregate dependencies w/group dependencies
-    //
+    public void add(final DependencyGroup group) {
+        assert group != null;
+
+        if (dependencyGroups == null) {
+            dependencyGroups = new ArrayList<DependencyGroup>();
+        }
+
+        dependencyGroups.add(group);
+    }
 
     public List<Dependency> dependencies() {
-        return dependencies;
+        return dependencies(false);
     }
 
-    public void add(final Dependency dependency) {
-        assert dependency != null;
+    public List<Dependency> dependencies(boolean includeGroups) {
+        if (!includeGroups) {
+            return dependencies;
+        }
 
-        if (dependencies == null) {
-            dependencies = new ArrayList<Dependency>();
+        // Don't bother making a new list if we have nothing to populate it with
+        if (dependencies == null && dependencyGroups == null) {
+            return null;
         }
 
-        dependencies.add(dependency);
-    }
+        List<Dependency> list = new ArrayList<Dependency>();
 
-    public List<DependencyGroup> dependencyGroups() {
-        return dependencyGroups;
+        if (dependencies != null) {
+            list.addAll(dependencies);
+        }
+        
+        if (dependencyGroups != null) {
+            for (DependencyGroup group : dependencyGroups) {
+                List<Dependency> tmp = group.dependencies();
+                if (tmp != null) {
+                    list.addAll(tmp);
+                }
+            }
+        }
+
+        return list;
     }
 
-    public void add(final DependencyGroup group) {
-        assert group != null;
+    public void add(final Dependency dependency) {
+        assert dependency != null;
 
-        if (dependencyGroups == null) {
-            dependencyGroups = new ArrayList<DependencyGroup>();
+        if (dependencies == null) {
+            dependencies = new ArrayList<Dependency>();
         }
 
-        dependencyGroups.add(group);
+        dependencies.add(dependency);
     }
 
     public Branding getBranding() {

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/DependencyGroup.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/DependencyGroup.java?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/DependencyGroup.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/common/DependencyGroup.java
Fri May 23 04:44:32 2008
@@ -37,6 +37,10 @@
     @XStreamImplicit
     private List<Dependency> dependencies;
 
+    //
+    // TODO: Consider making accessors of collection types return non-null always to simplify
usage (avoid needing that null check)
+    //
+    
     public List<Dependency> dependencies() {
         return dependencies;
     }

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/plugin/Plugin.java
Fri May 23 04:44:32 2008
@@ -91,6 +91,10 @@
         this.properties = properties;
     }
 
+    //
+    // TODO: Consider making accessors of collection types return non-null always to simplify
usage (avoid needing that null check)
+    //
+    
     public List<Dependency> dependencies() {
         return dependencies;
     }

Modified: geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/main/java/org/apache/geronimo/gshell/model/settings/Settings.java
Fri May 23 04:44:32 2008
@@ -46,6 +46,10 @@
 
     // TODO: Paths
 
+    //
+    // TODO: Consider making accessors of collection types return non-null always to simplify
usage (avoid needing that null check)
+    //
+    
     public Properties getProperties() {
         return properties;
     }

Modified: geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java
(original)
+++ geronimo/gshell/trunk/gshell-model/src/test/java/org/apache/geronimo/gshell/model/application/ApplicationMarshallerTest.java
Fri May 23 04:44:32 2008
@@ -41,7 +41,9 @@
     public void testMarshal1() throws Exception {
         Application root = new Application();
 
-        root.setId("app.test");
+        root.setGroupId("app.test");
+        root.setArtifactId("app-test");
+        root.setVersion("1.0");
         root.setName("App Test");
         root.setDescription("A test app descriptor.");
 

Modified: geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml?rev=659509&r1=659508&r2=659509&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml
(original)
+++ geronimo/gshell/trunk/gshell-model/src/test/resources/org/apache/geronimo/gshell/model/application/application1.xml
Fri May 23 04:44:32 2008
@@ -21,7 +21,9 @@
 <!-- $Rev$ $Date$ -->
 
 <application>
-    <id>app.test</id>
+    <groupId>app.test</groupId>
+    <artifactId>app-test</artifactId>
+    <version>1.0</version>
     <name>App Test</name>
     <description>A test app descriptor.</description>
 



Mime
View raw message