git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277949 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright 2001-2004 The Apache Software Foundation | |||
| * Copyright 2001-2005 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. | |||
| @@ -40,6 +40,7 @@ public class CCMCheck extends Continuus { | |||
| protected Vector filesets = new Vector(); | |||
| /** Constructor for CCMCheck. */ | |||
| public CCMCheck() { | |||
| super(); | |||
| } | |||
| @@ -98,6 +99,7 @@ public class CCMCheck extends Continuus { | |||
| /** | |||
| * Adds a set of files to copy. | |||
| * @param set the set of files | |||
| */ | |||
| public void addFileset(FileSet set) { | |||
| filesets.addElement(set); | |||
| @@ -110,6 +112,7 @@ public class CCMCheck extends Continuus { | |||
| * Builds a command line to execute ccm and then calls Exec's run method | |||
| * to execute the command line. | |||
| * </p> | |||
| * @throws BuildException on error | |||
| */ | |||
| public void execute() throws BuildException { | |||
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright 2001-2002,2004 The Apache Software Foundation | |||
| * Copyright 2001-2002,2004-2005 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. | |||
| @@ -24,12 +24,14 @@ package org.apache.tools.ant.taskdefs.optional.ccm; | |||
| */ | |||
| public class CCMCheckinDefault extends CCMCheck { | |||
| /** Constructor for CCMCheckinDefault. */ | |||
| public CCMCheckinDefault() { | |||
| super(); | |||
| setCcmAction(COMMAND_CHECKIN); | |||
| setTask(DEFAULT_TASK); | |||
| } | |||
| /** The default task */ | |||
| public static final String DEFAULT_TASK = "default"; | |||
| } | |||
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright 2001-2004 The Apache Software Foundation | |||
| * Copyright 2001-2005 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. | |||
| @@ -44,6 +44,9 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||
| private String subSystem = null; | |||
| private String task = null; | |||
| /** | |||
| * Constructor for CCMCreateTask. | |||
| */ | |||
| public CCMCreateTask() { | |||
| super(); | |||
| setCcmAction(COMMAND_CREATE_TASK); | |||
| @@ -56,6 +59,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||
| * Builds a command line to execute ccm and then calls Exec's run method | |||
| * to execute the command line. | |||
| * </p> | |||
| * @throws BuildException on error | |||
| */ | |||
| public void execute() throws BuildException { | |||
| Commandline commandLine = new Commandline(); | |||
| @@ -264,7 +268,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||
| /** | |||
| * | |||
| * @exception java.io.IOException | |||
| * @throws IOException on error | |||
| */ | |||
| public void start() throws IOException { | |||
| } | |||
| @@ -277,16 +281,16 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||
| /** | |||
| * | |||
| * @param param1 | |||
| * @exception java.io.IOException | |||
| * @param param1 the output stream | |||
| * @exception java.io.IOException on error | |||
| */ | |||
| public void setProcessInputStream(OutputStream param1) throws IOException { | |||
| } | |||
| /** | |||
| * | |||
| * @param is | |||
| * @exception java.io.IOException | |||
| * @param is the input stream | |||
| * @exception java.io.IOException on error | |||
| */ | |||
| public void setProcessErrorStream(InputStream is) throws IOException { | |||
| BufferedReader reader = new BufferedReader(new InputStreamReader(is)); | |||
| @@ -299,7 +303,7 @@ public class CCMCreateTask extends Continuus implements ExecuteStreamHandler { | |||
| /** | |||
| * read the output stream to retrieve the new task number. | |||
| * @param is InputStream | |||
| * @exception java.io.IOException | |||
| * @throws IOException on error | |||
| */ | |||
| public void setProcessOutputStream(InputStream is) throws IOException { | |||
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright 2001-2004 The Apache Software Foundation | |||
| * Copyright 2001-2005 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. | |||
| @@ -32,6 +32,7 @@ public class CCMReconfigure extends Continuus { | |||
| private boolean recurse = false; | |||
| private boolean verbose = false; | |||
| /** Constructor for CCMReconfigure. */ | |||
| public CCMReconfigure() { | |||
| super(); | |||
| setCcmAction(COMMAND_RECONFIGURE); | |||
| @@ -44,6 +45,7 @@ public class CCMReconfigure extends Continuus { | |||
| * Builds a command line to execute ccm and then calls Exec's run method | |||
| * to execute the command line. | |||
| * </p> | |||
| * @throws BuildException on error | |||
| */ | |||
| public void execute() throws BuildException { | |||
| Commandline commandLine = new Commandline(); | |||
| @@ -69,11 +71,11 @@ public class CCMReconfigure extends Continuus { | |||
| */ | |||
| private void checkOptions(Commandline cmd) { | |||
| if (isRecurse() == true) { | |||
| if (isRecurse()) { | |||
| cmd.createArgument().setValue(FLAG_RECURSE); | |||
| } // end of if () | |||
| if (isVerbose() == true) { | |||
| if (isVerbose()) { | |||
| cmd.createArgument().setValue(FLAG_VERBOSE); | |||
| } // end of if () | |||
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| * Copyright 2001-2004 The Apache Software Foundation | |||
| * Copyright 2001-2005 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. | |||
| @@ -84,6 +84,12 @@ public abstract class Continuus extends Task { | |||
| } | |||
| /** | |||
| * Run the command. | |||
| * @param cmd the command line | |||
| * @param handler an execute stream handler | |||
| * @return the exit status of the command | |||
| */ | |||
| protected int run(Commandline cmd, ExecuteStreamHandler handler) { | |||
| try { | |||
| Execute exe = new Execute(handler); | |||
| @@ -96,6 +102,11 @@ public abstract class Continuus extends Task { | |||
| } | |||
| } | |||
| /** | |||
| * Run the command. | |||
| * @param cmd the command line | |||
| * @return the exit status of the command | |||
| */ | |||
| protected int run(Commandline cmd) { | |||
| return run(cmd, new LogStreamHandler(this, Project.MSG_VERBOSE, Project.MSG_WARN)); | |||
| } | |||