[jbossws-commits] JBossWS SVN: r6752 - common/trunk/src/main/java/org/jboss/ws/tools/ant.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Apr 29 10:29:10 EDT 2008


Author: alessio.soldano at jboss.com
Date: 2008-04-29 10:29:10 -0400 (Tue, 29 Apr 2008)
New Revision: 6752

Added:
   common/trunk/src/main/java/org/jboss/ws/tools/ant/FixPathTask.java
Modified:
   common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseProjectTask.java
Log:
Moving Ant FixPathTask to common + adding parameter to the Ant EclipseProjectTask


Modified: common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseProjectTask.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseProjectTask.java	2008-04-29 14:11:21 UTC (rev 6751)
+++ common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseProjectTask.java	2008-04-29 14:29:10 UTC (rev 6752)
@@ -39,6 +39,7 @@
 public class EclipseProjectTask extends Task
 {
    private String projectName;
+   private String outputFile;
 
    @Override
    public void execute() throws BuildException
@@ -47,7 +48,12 @@
       {
          StringBuffer sb = new StringBuffer();
          generateContent(sb);
-         BufferedWriter out = new BufferedWriter(new FileWriter(new File(getProject().getBaseDir(), ".project")));
+         File file;
+         if (outputFile != null)
+            file = new File(outputFile);
+         else
+            file = new File(getProject().getBaseDir(), ".project");
+         BufferedWriter out = new BufferedWriter(new FileWriter(file));
          out.write(sb.toString());
          out.close();
       }
@@ -84,4 +90,9 @@
    {
       this.projectName = projectName;
    }
+
+   public void setOutputFile(String outputFile)
+   {
+      this.outputFile = outputFile;
+   }
 }

Added: common/trunk/src/main/java/org/jboss/ws/tools/ant/FixPathTask.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/tools/ant/FixPathTask.java	                        (rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/tools/ant/FixPathTask.java	2008-04-29 14:29:10 UTC (rev 6752)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.tools.ant;
+
+//$Id$
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+public class FixPathTask extends Task
+{
+   private String propertyName;
+
+   @Override
+   public void execute() throws BuildException
+   {
+      String path = getProject().getProperty(propertyName);
+
+      if (path != null)
+      {
+         getProject().setProperty(propertyName, path.replace('\\', '/'));
+      }
+   }
+
+   public void setProperty(String propertyName)
+   {
+      this.propertyName = propertyName;
+   }
+}


Property changes on: common/trunk/src/main/java/org/jboss/ws/tools/ant/FixPathTask.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jbossws-commits mailing list