You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by br...@apache.org on 2004/09/24 12:47:03 UTC

cvs commit: maven-plugins/changelog/src/test/org/apache/maven/perforcelib PerforceChangeLogGeneratorTest.java

brett       2004/09/24 03:47:03

  Modified:    changelog project.xml
               changelog/src/main/org/apache/maven/cvslib
                        CvsChangeLogGenerator.java
               changelog/src/test/org/apache/maven/cvslib
                        CvsChangeLogGeneratorTest.java
               changelog/src/test/org/apache/maven/perforcelib
                        PerforceChangeLogGeneratorTest.java
  Added:       changelog/src/main/org/apache/maven/util
                        RepositoryUtils.java
  Log:
  changelog works in 1.0.x again
  
  Revision  Changes    Path
  1.53      +2 -2      maven-plugins/changelog/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changelog/project.xml,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- project.xml	21 Sep 2004 13:47:52 -0000	1.52
  +++ project.xml	24 Sep 2004 10:47:03 -0000	1.53
  @@ -24,7 +24,7 @@
     <id>maven-changelog-plugin</id>
     <name>Maven Changelog Plugin</name>
     <currentVersion>1.8-SNAPSHOT</currentVersion>
  -  <shortDescription>Produce SCM changelog reports. Requires Maven 1.1.</shortDescription>
  +  <shortDescription>Produce SCM changelog reports.</shortDescription>
     <url>http://maven.apache.org/reference/plugins/changelog/</url>
     <issueTrackingUrl>http://jira.codehaus.org/browse/MPCHANGELOG</issueTrackingUrl>
     <siteDirectory>/www/maven.apache.org/reference/plugins/changelog/</siteDirectory>
  @@ -152,7 +152,7 @@
       <dependency>
         <groupId>maven</groupId>
         <artifactId>maven</artifactId>
  -      <version>1.1-SNAPSHOT</version>
  +      <version>1.0</version>
       </dependency>
       <dependency>
         <groupId>maven</groupId>
  
  
  
  1.12      +1 -2      maven-plugins/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java
  
  Index: CvsChangeLogGenerator.java
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CvsChangeLogGenerator.java	21 Sep 2004 13:47:52 -0000	1.11
  +++ CvsChangeLogGenerator.java	24 Sep 2004 10:47:03 -0000	1.12
  @@ -29,9 +29,8 @@
   import org.apache.commons.logging.LogFactory;
   import org.apache.maven.changelog.AbstractChangeLogGenerator;
   import org.apache.maven.changelog.ChangeLogParser;
  -// TODO: use maven-scm for this, remove dep on Maven 1.1
  -import org.apache.maven.project.RepositoryUtils;
   import org.apache.maven.util.AsyncStreamReader;
  +import org.apache.maven.util.RepositoryUtils;
   import org.apache.tools.ant.types.Commandline;
   
   /**
  
  
  
  1.1                  maven-plugins/changelog/src/main/org/apache/maven/util/RepositoryUtils.java
  
  Index: RepositoryUtils.java
  ===================================================================
  package org.apache.maven.util;
  
  /* ====================================================================
   *   Copyright 2001-2004 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 java.util.ArrayList;
  import java.util.List;
  
  /**
   * NOTE: This is very CVS specific, but I would like to try additional SCM
   * package like subversion ASAP.
   *
   * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
   *
   * @version $Id: RepositoryUtils.java,v 1.1 2004/09/24 10:47:03 brett Exp $
   */
  public final class RepositoryUtils
  {
      /**
       * Splits an SCM string into parts 
       * @param connection
       * @return
       */
      public static String[] splitSCMConnection(String connection)
      {
          if (connection == null)
          {
              throw new NullPointerException("repository connection is null");
          }
  
          if (connection.length() < 4)
          {
              throw new IllegalArgumentException("repository connection is too short");
          }
  
          if (!connection.startsWith("scm"))
          {
              throw new IllegalArgumentException("repository connection must start with scm[delim]");
          }
          
          String delimiter = "" + connection.charAt(3);
  
          EnhancedStringTokenizer tok = new EnhancedStringTokenizer(connection, delimiter);
  
          String[] tokens = tokenizerToArray(tok);
  
          // for a valid repository, it should be scm:<provider> at least
          if (tokens.length >= 1 && tokens[1].equals("cvs"))
          {
              if (tokens.length != 6)
              {
                  throw new IllegalArgumentException("cvs repository connection string doesn't contain six tokens");
              }
          }
          return tokens;
      }
  
      /**
       * Converts a tokenizer to an array of strings
       * FIXME: This should be in a string util class
       * @param tok
       * @return String[]
       */
      public static String[] tokenizerToArray(EnhancedStringTokenizer tok)
      {
          List l = new ArrayList();
          while (tok.hasMoreTokens())
          {
              l.add(tok.nextToken());
          }
          return (String[]) l.toArray(new String[l.size()]);
      }
  
  }
  
  
  
  1.11      +3 -4      maven-plugins/changelog/src/test/org/apache/maven/cvslib/CvsChangeLogGeneratorTest.java
  
  Index: CvsChangeLogGeneratorTest.java
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changelog/src/test/org/apache/maven/cvslib/CvsChangeLogGeneratorTest.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- CvsChangeLogGeneratorTest.java	21 Sep 2004 13:47:52 -0000	1.10
  +++ CvsChangeLogGeneratorTest.java	24 Sep 2004 10:47:03 -0000	1.11
  @@ -18,9 +18,8 @@
    */
   
   
  -// TODO: use maven-scm
  -import org.apache.maven.project.RepositoryUtils;
   import org.apache.maven.util.EnhancedStringTokenizer;
  +import org.apache.maven.util.RepositoryUtils;
   import org.apache.tools.ant.types.Commandline;
   
   import junit.framework.TestCase;
  
  
  
  1.4       +1 -2      maven-plugins/changelog/src/test/org/apache/maven/perforcelib/PerforceChangeLogGeneratorTest.java
  
  Index: PerforceChangeLogGeneratorTest.java
  ===================================================================
  RCS file: /home/cvs/maven-plugins/changelog/src/test/org/apache/maven/perforcelib/PerforceChangeLogGeneratorTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PerforceChangeLogGeneratorTest.java	21 Sep 2004 13:47:52 -0000	1.3
  +++ PerforceChangeLogGeneratorTest.java	24 Sep 2004 10:47:03 -0000	1.4
  @@ -17,9 +17,8 @@
    * ====================================================================
    */
   
  -// TODO: use maven-scm
  -import org.apache.maven.project.RepositoryUtils;
   import org.apache.maven.util.EnhancedStringTokenizer;
  +import org.apache.maven.util.RepositoryUtils;
   import org.apache.tools.ant.types.Commandline;
   
   import junit.framework.TestCase;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org