ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wolfgang Werner" <wwer...@picturesafe.de>
Subject Cvs Task, 2nd try
Date Wed, 19 Apr 2000 07:37:22 GMT
Hi,

I followed your suggestions, Thomas, and have added your fix
to my version.

cvs diff -u output here, full file attached.

---------------------------- schnipp -------------------------------
Index: Cvs.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java,v
retrieving revision 1.3
diff -u -r1.3 Cvs.java
--- Cvs.java	2000/01/30 17:15:32	1.3
+++ Cvs.java	2000/04/19 06:21:58
@@ -66,23 +66,49 @@

 public class Cvs extends Exec {

-    private String cvsRoot;
-    private String pack;
-    private String tag;
+    private String  cvsRoot;
+    private String  pack;
+    private String  tag;
+    private String  command = "checkout";
+    private boolean quiet   = false;
+    private boolean noexec  = false;

     public void execute() throws BuildException {

 	// XXX: we should use JCVS (www.ice.com/JCVS) instead of command line
 	// execution so that we don't rely on having native CVS stuff around (SM)

-	StringBuffer sb=new StringBuffer();
-	sb.append(" cvs -d ").append( cvsRoot ).append(" checkout ");
-	if (tag!=null)
-            sb.append("-r ").append(tag).append(" ");
-
-	sb.append( pack );
+	StringBuffer
+		sb = new StringBuffer();
+
+	sb.append(" cvs ");
+
+	if ((null != cvsRoot) && (cvsRoot.length() > 0))
+	{
+		sb.append("-d ")
+	      .append(cvsRoot)
+	      .append(" ");
+	}
+
+	sb.append(noexec ? "-n " : "")
+	  .append(quiet  ? "-q " : "")
+	  .append(" ")
+	  .append(command)
+	  .append(" ");
+
+	if ((null != tag) && (tag.length() > 0))
+	{
+		sb.append("-r ")
+		  .append(tag)
+		  .append(" ");
+	}
+
+	if ((null != pack) && (pack.length() > 0))
+	{
+		sb.append(pack);
+	}

-        run(sb.toString());
+    run(sb.toString());
     }

     public void setCvsRoot(String root) {
@@ -100,6 +126,18 @@
     public void setTag(String p) {
 	this.tag = p;
     }
+
+    public void setCommand(String c) {
+	this.command = c;
+	}
+
+    public void setQuiet(String q) {
+    quiet = Project.toBoolean(q);
+	}
+
+    public void setNoexec(String ne) {
+    noexec = Project.toBoolean(ne);
+	}
 }
 ---------------------------- schnapp -------------------------------

works for me.

Wolfgang Werner

Mime
View raw message