View Javadoc

1   package org.apache.maven.perforcelib;
2   
3   /* ====================================================================
4    *   Licensed to the Apache Software Foundation (ASF) under one or more
5    *   contributor license agreements.  See the NOTICE file distributed with
6    *   this work for additional information regarding copyright ownership.
7    *   The ASF licenses this file to You under the Apache License, Version 2.0
8    *   (the "License"); you may not use this file except in compliance with
9    *   the License.  You may obtain a copy of the License at
10   *
11   *       http://www.apache.org/licenses/LICENSE-2.0
12   *
13   *   Unless required by applicable law or agreed to in writing, software
14   *   distributed under the License is distributed on an "AS IS" BASIS,
15   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   *   See the License for the specific language governing permissions and
17   *   limitations under the License.
18   * ====================================================================
19   */
20  
21  import org.apache.maven.changelog.ChangeLogFactory;
22  import org.apache.maven.changelog.ChangeLogGenerator;
23  import org.apache.maven.changelog.ChangeLogParser;
24  
25  
26  /**
27   * Provides Perforce specific instances of the ChangeLogGenerator and
28   * ChangeLogParser interfaces.
29   *
30   * It expects the repository connection element in the POM to be of
31   * this form: <b><code>scm:perforce[:P4PORT]:FILESPEC</code></b>.  If
32   * the P4PORT is omitted, the corresponding environment variable will
33   * be used.  The FILESPEC should use "depot syntax" with the
34   * appropriate Perforce wildcards to represent all of the project's
35   * files, i.e. '...'
36   *
37   * The repository URL element should refer to a <a
38   * href="http://www.perforce.com/perforce/products/p4web.html">p4web</a>
39   * instance.  The portion of the URL following the host:port should
40   * match the FILESPEC in the repository connection element, sans the
41   * '...'.  It must end with a '/'.
42   *
43   * For example,
44   * <pre>
45   * &lt;repository&gt;
46   *   &lt;connection&gt;
47   *     scm:perforce:some.host.com:1666://depot/projects/maven/...
48   *   &lt;/connection&gt;
49   *   &lt;url&gt;
50   *     http://public.perforce.com:8080//depot/projects/maven/
51   *   &lt;/url&gt;
52   * &lt;/repository&gt;
53   * </pre>
54   *
55   * @author <a href="mailto:jim@crossleys.org">Jim Crossley</a>
56   * @version $Id:
57   */
58  public class PerforceChangeLogFactory implements ChangeLogFactory
59  {
60      /**
61       * Default no-arg constructor.
62       */
63      public PerforceChangeLogFactory()
64      {
65      }
66  
67      /**
68       * Create a Perforce specific ChangeLogGenerator.
69       *
70       * @return a Perforce specific ChangeLogGenerator.
71       */
72      public ChangeLogGenerator createGenerator()
73      {
74          return new PerforceChangeLogGenerator();
75      }
76  
77      /**
78       * Create a Perforce specific ChangeLogParser.
79       *
80       * @return a Perforce specific ChangeLogParser.
81       */
82      public ChangeLogParser createParser()
83      {
84          return new PerforceChangeLogParser();
85      }
86  }