maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dant...@apache.org
Subject svn commit: r407599 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam: ./ src/main/java/org/apache/maven/scm/provider/starteam/command/ src/main/java/org/apache/maven/scm/provider/starteam/util/ src/main/mdo/
Date Thu, 18 May 2006 18:01:08 GMT
Author: dantran
Date: Thu May 18 11:01:08 2006
New Revision: 407599

URL: http://svn.apache.org/viewvc?rev=407599&view=rev
Log:
SCM-206, add starteam-settings.xml support. with compressionEnable

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.java
  (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/starteam-settings.mdo
  (with props)
Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml?rev=407599&r1=407598&r2=407599&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/pom.xml Thu May 18 11:01:08
2006
@@ -8,4 +8,27 @@
   <artifactId>maven-scm-provider-starteam</artifactId>
   <name>Maven SCM Starteam Provider</name>
   <version>1.0-SNAPSHOT</version>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-6</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+              <goal>xpp3-reader</goal>
+              <goal>xsd</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <version>1.0.0</version>
+          <model>src/main/mdo/starteam-settings.mdo</model>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>  
 </project>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java?rev=407599&r1=407598&r2=407599&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/command/StarteamCommandLineUtils.java
Thu May 18 11:01:08 2006
@@ -19,6 +19,8 @@
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.log.ScmLogger;
 import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository;
+import org.apache.maven.scm.provider.starteam.util.StarteamUtil;
+import org.apache.maven.scm.providers.starteam.settings.Settings;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
@@ -35,6 +37,7 @@
  */
 public class StarteamCommandLineUtils
 {
+    private static Settings settings = StarteamUtil.getSettings();
 
     public static Commandline createStarteamBaseCommandLine( String action, StarteamScmProviderRepository
repo )
     {
@@ -118,10 +121,7 @@
 
     private static void addCompressionOption( Commandline cl )
     {
-        //hiden feature to turn on compress during file transfer
-        String compression = System.getProperty( "maven.scm.starteam.compression" );
-
-        if ( "true".equalsIgnoreCase( compression ) )
+        if ( settings.isCompressionEnable() )
         {
             cl.createArgument().setValue( "-cmp" );
         }

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.java?rev=407599&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.java
Thu May 18 11:01:08 2006
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.starteam.util;
+
+/*
+ * Copyright 2001-2006 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.scm.providers.starteam.settings.Settings;
+import org.apache.maven.scm.providers.starteam.settings.io.xpp3.StarteamXpp3Reader;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:dantran@apache.org">Dan T. Tran</a>
+ * @version $Id: $
+ */
+public class StarteamUtil
+{
+    private StarteamUtil()
+    {
+    }
+
+    public static Settings getSettings()
+    {
+        File scmUserDir = new File( System.getProperty( "user.home" ), ".scm" );
+        File settingsFile = new File( scmUserDir, "starteam-settings.xml" );
+
+        if ( settingsFile.exists() )
+        {
+            StarteamXpp3Reader reader = new StarteamXpp3Reader();
+            try
+            {
+                return reader.read( new FileReader( settingsFile ) );
+            }
+            catch ( FileNotFoundException e )
+            {
+            }
+            catch ( IOException e )
+            {
+            }
+            catch ( XmlPullParserException e )
+            {
+                String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED."
+ e.getMessage();
+
+                System.out.println( message );
+            }
+        }
+
+        return new Settings();
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/java/org/apache/maven/scm/provider/starteam/util/StarteamUtil.java
------------------------------------------------------------------------------
    svn:executable = *

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/starteam-settings.mdo
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/starteam-settings.mdo?rev=407599&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/starteam-settings.mdo
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/starteam-settings.mdo
Thu May 18 11:01:08 2006
@@ -0,0 +1,27 @@
+<model>
+  <id>starteam</id>
+  <name>Starteam</name>
+  <description>Starteam Provider Model.</description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.scm.providers.starteam.settings</value>
+    </default>
+  </defaults>
+
+  <classes>
+    <class rootElement="true" xml.tagName="starteam-settings">
+      <name>Settings</name>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>compressionEnable</name>
+          <version>1.0.0+</version>
+          <type>boolean</type>
+          <defaultValue>false</defaultValue>
+          <description>Enable compression in all stdcmd</description>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</model>

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-starteam/src/main/mdo/starteam-settings.mdo
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message