continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r279123 [3/3] - in /maven/continuum/trunk/continuum-updater: ./ src/ src/assemble/ src/bin/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/continuum/ src/...
Date Tue, 06 Sep 2005 21:36:35 GMT
Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/ScmResult.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/ScmResult.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/ScmResult.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/ScmResult.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,107 @@
+/*
+ * $Id$
+ */
+
+package org.apache.maven.continuum.scm.v1_0_0;
+
+  //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.*;
+import org.apache.maven.continuum.project.v1_0_0.AntProject;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumBuild;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumDeveloper;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumNotifier;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumProject;
+import org.apache.maven.continuum.project.v1_0_0.MavenOneProject;
+import org.apache.maven.continuum.project.v1_0_0.MavenTwoProject;
+import org.apache.maven.continuum.project.v1_0_0.ShellProject;
+
+/**
+ * Class ScmResult.
+ * 
+ * @version $Revision$ $Date$
+ */
+public abstract class ScmResult implements java.io.Serializable {
+
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field success
+     */
+    private boolean success = false;
+
+    /**
+     * Field providerMessage
+     */
+    private String providerMessage;
+
+    /**
+     * Field commandOutput
+     */
+    private String commandOutput;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method getCommandOutput
+     */
+    public String getCommandOutput()
+    {
+        return this.commandOutput;
+    } //-- String getCommandOutput() 
+
+    /**
+     * Method getProviderMessage
+     */
+    public String getProviderMessage()
+    {
+        return this.providerMessage;
+    } //-- String getProviderMessage() 
+
+    /**
+     * Method isSuccess
+     */
+    public boolean isSuccess()
+    {
+        return this.success;
+    } //-- boolean isSuccess() 
+
+    /**
+     * Method setCommandOutput
+     * 
+     * @param commandOutput
+     */
+    public void setCommandOutput(String commandOutput)
+    {
+        this.commandOutput = commandOutput;
+    } //-- void setCommandOutput(String) 
+
+    /**
+     * Method setProviderMessage
+     * 
+     * @param providerMessage
+     */
+    public void setProviderMessage(String providerMessage)
+    {
+        this.providerMessage = providerMessage;
+    } //-- void setProviderMessage(String) 
+
+    /**
+     * Method setSuccess
+     * 
+     * @param success
+     */
+    public void setSuccess(boolean success)
+    {
+        this.success = success;
+    } //-- void setSuccess(boolean) 
+
+}

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/ScmResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/ScmResult.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/UpdateScmResult.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/UpdateScmResult.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/UpdateScmResult.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/UpdateScmResult.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,89 @@
+/*
+ * $Id$
+ */
+
+package org.apache.maven.continuum.scm.v1_0_0;
+
+  //---------------------------------/
+ //- Imported classes and packages -/
+//---------------------------------/
+
+import java.util.*;
+import java.util.List;
+import org.apache.maven.continuum.project.v1_0_0.AntProject;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumBuild;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumDeveloper;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumNotifier;
+import org.apache.maven.continuum.project.v1_0_0.ContinuumProject;
+import org.apache.maven.continuum.project.v1_0_0.MavenOneProject;
+import org.apache.maven.continuum.project.v1_0_0.MavenTwoProject;
+import org.apache.maven.continuum.project.v1_0_0.ShellProject;
+
+/**
+ * Class UpdateScmResult.
+ * 
+ * @version $Revision$ $Date$
+ */
+public class UpdateScmResult extends ScmResult 
+implements java.io.Serializable
+{
+
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field updatedFiles
+     */
+    private java.util.List updatedFiles;
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method addUpdatedFile
+     * 
+     * @param scmFile
+     */
+    public void addUpdatedFile(ScmFile scmFile)
+    {
+        getUpdatedFiles().add( scmFile );
+    } //-- void addUpdatedFile(ScmFile) 
+
+    /**
+     * Method getUpdatedFiles
+     */
+    public java.util.List getUpdatedFiles()
+    {
+        if ( this.updatedFiles == null )
+        {
+            this.updatedFiles = new java.util.ArrayList();
+        }
+        
+        return this.updatedFiles;
+    } //-- java.util.List getUpdatedFiles() 
+
+    /**
+     * Method removeUpdatedFile
+     * 
+     * @param scmFile
+     */
+    public void removeUpdatedFile(ScmFile scmFile)
+    {
+        getUpdatedFiles().remove( scmFile );
+    } //-- void removeUpdatedFile(ScmFile) 
+
+    /**
+     * Method setUpdatedFiles
+     * 
+     * @param updatedFiles
+     */
+    public void setUpdatedFiles(java.util.List updatedFiles)
+    {
+        this.updatedFiles = updatedFiles;
+    } //-- void setUpdatedFiles(java.util.List) 
+
+}

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/UpdateScmResult.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/scm/v1_0_alpha_3/UpdateScmResult.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/DefaultUpdaterManager.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/DefaultUpdaterManager.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/DefaultUpdaterManager.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/DefaultUpdaterManager.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,136 @@
+package org.apache.maven.continuum.updater;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.maven.continuum.updater.exception.UpdaterException;
+import org.apache.maven.continuum.updater.model.UpdaterModel;
+import org.apache.maven.continuum.updater.model.Version;
+import org.apache.maven.continuum.updater.model.io.xpp3.ContinuumUpdaterXpp3Reader;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.File;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * @plexus.component
+ *   role="org.apache.maven.continuum.updater.UpdaterManager"
+ *
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class DefaultUpdaterManager
+    extends AbstractLogEnabled
+    implements UpdaterManager
+{
+    /**
+     * @plexus.requirement
+     *   role="org.apache.maven.continuum.updater.Updater"
+     */
+    private Map updaters;
+
+    public void execute( String version, File continuumHome )
+        throws UpdaterException
+    {
+        InputStream confAsStream;
+
+        confAsStream = DefaultUpdaterManager.class.getClassLoader().getResourceAsStream(
"updater.xml" );
+
+        InputStreamReader reader = new InputStreamReader( confAsStream );
+
+        ContinuumUpdaterXpp3Reader xpp3Reader = new ContinuumUpdaterXpp3Reader();
+
+        UpdaterModel model = null;
+
+        try
+        {
+            model = xpp3Reader.read( reader );
+        }
+        catch ( Exception e )
+        {
+            throw new UpdaterException( "Can't find updater configuration file.", e );
+        }
+
+        boolean versionFounded = false;
+
+        for( Iterator i = model.getVersions().iterator(); i.hasNext(); )
+        {
+            Version v = (Version) i.next();
+
+            if ( v.getName().equals( version ) )
+            {
+                versionFounded = true;
+            }
+
+            if ( versionFounded && v.getComponentRole() != null )
+            {
+                update( v, continuumHome );
+            }
+        }
+
+        if ( !versionFounded )
+        {
+            getLogger().warn( "There are no updater for your version(" + version + ")\n"
+ getAvailableVersions( model ) );
+        }
+    }
+
+    private String getAvailableVersions( UpdaterModel model )
+    {
+        StringBuffer sb = new StringBuffer();
+
+        for( Iterator i = model.getVersions().iterator(); i.hasNext(); )
+        {
+            Version v = (Version) i.next();
+
+            if ( v.getComponentRole() != null )
+            {
+                if ( sb.length() != 0 )
+                {
+                    sb.append( "\n" );
+                }
+
+                sb.append( v.getName() );
+            }
+        }
+
+        return sb.toString();
+    }
+
+    private void update( Version version, File continuumHome )
+        throws UpdaterException
+    {
+        getLogger().info( "************************************************************************"
);
+        getLogger().info( "Update version " + version.getName() + " with component " + version.getComponentRole()
);
+        getLogger().info( "************************************************************************"
);
+
+        Updater updater = (Updater) updaters.get( version.getComponentRole() );
+
+        getLogger().info( "Update database" );
+
+        updater.updateDatabase();
+
+        getLogger().info( "Update librairies" );
+
+        updater.updateLibraries();
+
+        getLogger().info( "Update file system" );
+
+        updater.updateFileSystem();
+    }
+}

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/DefaultUpdaterManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/DefaultUpdaterManager.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/Updater.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/Updater.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/Updater.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/Updater.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,37 @@
+package org.apache.maven.continuum.updater;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.maven.continuum.updater.exception.UpdaterException;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface Updater
+{
+    static String ROLE = Updater.class.getName();
+
+    void updateDatabase()
+        throws UpdaterException;
+
+    void updateLibraries()
+        throws UpdaterException;
+
+    void updateFileSystem()
+        throws UpdaterException;
+}

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/Updater.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/Updater.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterForContinuumOneAlphaThree.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterForContinuumOneAlphaThree.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterForContinuumOneAlphaThree.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterForContinuumOneAlphaThree.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,45 @@
+package org.apache.maven.continuum.updater;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.maven.continuum.updater.exception.UpdaterException;
+
+/**
+ * @plexus.component
+ *   role="org.apache.maven.continuum.updater.Updater"
+ *
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class UpdaterForContinuumOneAlphaThree
+    implements Updater
+{
+    public void updateDatabase()
+        throws UpdaterException
+    {
+    }
+
+    public void updateLibraries()
+        throws UpdaterException
+    {
+    }
+
+    public void updateFileSystem()
+        throws UpdaterException
+    {
+    }
+}

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterForContinuumOneAlphaThree.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterForContinuumOneAlphaThree.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterManager.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterManager.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterManager.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterManager.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,33 @@
+package org.apache.maven.continuum.updater;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.maven.continuum.updater.exception.UpdaterException;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface UpdaterManager
+{
+    static String ROLE = UpdaterManager.class.getName();
+
+    void execute( String version, File continuumHome )
+        throws UpdaterException;
+}

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/UpdaterManager.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/cli/UpdaterCli.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/cli/UpdaterCli.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/cli/UpdaterCli.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/cli/UpdaterCli.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,209 @@
+package org.apache.maven.continuum.updater.cli;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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 org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.OptionBuilder;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
+import org.apache.maven.continuum.updater.exception.UpdaterException;
+import org.apache.maven.continuum.updater.UpdaterManager;
+import org.codehaus.classworlds.ClassWorld;
+import org.codehaus.plexus.PlexusContainerException;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.embed.Embedder;
+
+import java.io.File;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class UpdaterCli
+{
+    public static int main( String[] args, ClassWorld classWorld )
+    {
+        File continuumHome;
+
+        String version;
+
+        // ----------------------------------------------------------------------
+        // Setup the command line parser
+        // ----------------------------------------------------------------------
+
+        CLIManager cliManager = new CLIManager();
+
+        CommandLine commandLine;
+
+        try
+        {
+            commandLine = cliManager.parse( args );
+        }
+        catch ( ParseException e )
+        {
+            System.err.println( "Unable to parse command line options: " + e.getMessage()
);
+
+            cliManager.displayHelp();
+
+            return 1;
+        }
+
+        // ----------------------------------------------------------------------
+        // Process command line options
+        // ----------------------------------------------------------------------
+
+        if ( commandLine.hasOption( CLIManager.HELP ) )
+        {
+            cliManager.displayHelp();
+
+            return 0;
+        }
+
+        if ( commandLine.hasOption( CLIManager.VERSION ) )
+        {
+            version = commandLine.getOptionValue( CLIManager.VERSION );
+        }
+        else
+        {
+            showError( "You must provide your actual continuum version.", null );
+
+            return 1;
+        }
+
+        if ( commandLine.hasOption( CLIManager.CONTINUUM_HOME ) )
+        {
+            continuumHome = new File( commandLine.getOptionValue( CLIManager.CONTINUUM_HOME
) );
+
+            if ( !continuumHome.exists() || !continuumHome.isDirectory() )
+            {
+                showError( "You must provide a valid path for your actual continuum installation.",
null );
+
+                return 1;
+            }
+        }
+        else
+        {
+            showError( "You must provide the path of your actual continuum installation.",
null );
+
+            return 1;
+        }
+
+        // ----------------------------------------------------------------------
+        // 
+        // ----------------------------------------------------------------------
+
+        UpdaterManager manager = null;
+
+        Embedder embedder = new Embedder();
+
+        try
+        {
+            embedder.start( classWorld );
+        }
+        catch ( PlexusContainerException e )
+        {
+            showError( "Unable to start the embedded plexus container", e );
+
+            return 1;
+        }
+
+        try
+        {
+            manager = (UpdaterManager) embedder.lookup( UpdaterManager.ROLE );
+        }
+        catch ( ComponentLookupException e )
+        {
+            showError( "Unable to configure the application", e );
+
+            return 1;
+        }
+
+        try
+        {
+            manager.execute( version, continuumHome );
+        }
+        catch ( UpdaterException e )
+        {
+            showError( "Unable to upgrade your continuum.", e );
+
+            return 1;
+        }
+
+        return 0;
+    }
+
+    private static void showError( String message, Exception e )
+    {
+        System.err.println( "[ERROR]: " + message );
+
+        if ( e != null )
+        {
+            System.err.println( "Error stacktrace:" );
+
+            e.printStackTrace();
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Command line manager
+    // ----------------------------------------------------------------------
+
+    static class CLIManager
+    {
+        public static final char CONTINUUM_HOME = 'c';
+
+        public static final char VERSION = 'v';
+
+        public static final char HELP = 'h';
+
+        private Options options = null;
+
+        public CLIManager()
+        {
+            options = new Options();
+            
+            options.addOption(
+                OptionBuilder.withLongOpt( "help" ).withDescription( "Display help information"
).create( HELP ) );
+            
+            options.addOption(
+                OptionBuilder.withLongOpt( "version").hasArg().withDescription( "Actual Continuum
version." ).create( VERSION ) );
+            
+            options.addOption(
+                OptionBuilder.withLongOpt( "continuum_home").hasArg().withDescription( "Path
to your Continuum." ).create( CONTINUUM_HOME ) );
+        }
+
+        public CommandLine parse( String[] args )
+            throws ParseException
+        {
+            CommandLineParser parser = new PosixParser();
+
+            return parser.parse( options, args );
+        }
+
+        public void displayHelp()
+        {
+            System.out.println();
+
+            HelpFormatter formatter = new HelpFormatter();
+
+            formatter.printHelp( "updater [options]", "\nOptions:", options, "\n" );
+        }
+    }
+}
\ No newline at end of file

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/cli/UpdaterCli.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/cli/UpdaterCli.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/exception/UpdaterException.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/exception/UpdaterException.java?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/exception/UpdaterException.java
(added)
+++ maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/exception/UpdaterException.java
Tue Sep  6 14:36:03 2005
@@ -0,0 +1,44 @@
+package org.apache.maven.continuum.updater.exception;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class UpdaterException
+    extends Exception
+{
+    public UpdaterException()
+    {
+    }
+
+    public UpdaterException( String message )
+    {
+        super( message );
+    }
+
+    public UpdaterException( Throwable cause )
+    {
+        super( cause );
+    }
+
+    public UpdaterException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+}
\ No newline at end of file

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/exception/UpdaterException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/java/org/apache/maven/continuum/updater/exception/UpdaterException.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-updater/src/main/mdo/updater.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/mdo/updater.mdo?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/mdo/updater.mdo (added)
+++ maven/continuum/trunk/continuum-updater/src/main/mdo/updater.mdo Tue Sep  6 14:36:03 2005
@@ -0,0 +1,44 @@
+<model>
+  <id>continuum-updater</id>
+  <name>ContinuumUpdater</name>
+  <description>Continuum updater's object model.</description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.continuum.updater.model</value>
+    </default>
+  </defaults>
+
+  <classes>
+    <class rootElement="true">
+      <name>UpdaterModel</name>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>versions</name>
+          <version>1.0.0+</version>
+          <association>
+            <type>Version</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
+      </fields>
+    </class>
+    <class>
+      <name>Version</name>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>name</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>componentRole</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</model>

Added: maven/continuum/trunk/continuum-updater/src/main/resources/updater.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-updater/src/main/resources/updater.xml?rev=279123&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-updater/src/main/resources/updater.xml (added)
+++ maven/continuum/trunk/continuum-updater/src/main/resources/updater.xml Tue Sep  6 14:36:03
2005
@@ -0,0 +1,11 @@
+<updater>
+  <versions>
+    <version>
+      <name>1.0-alpha-3</name>
+      <componentRole>updateTo1.0-alpha-4</componentRole>
+    </version>
+    <version>
+      <name>1.0-alpha-4</name>
+    </version>
+  </versions>
+</updater>

Propchange: maven/continuum/trunk/continuum-updater/src/main/resources/updater.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-updater/src/main/resources/updater.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message