ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 7549] New: - Perforce: Add failonerror to tasks
Date Thu, 28 Mar 2002 00:04:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7549>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7549

Perforce: Add failonerror to tasks

           Summary: Perforce: Add failonerror to tasks
           Product: Ant
           Version: 1.4.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: tamm@alum.mit.edu


When running a build, the first thing we do is sync the latest codebase.  
However, often some of the files on our machine are set to readable because 
they contain some client-specific settings.  The p4sync task, however, will 
fail because without specifying force="true", it will fail instead of 
overwriting a readable file.  This is the desired behavior, however there is no 
way to keep the build going after this because P4 tasks do not have the ability 
to not fail on error.

So I'd suggest modifying P4Base to add the following code

    protected boolean failOnError = true;
    /**
     * Throw a BuildException if compilation fails
     */
    public void setFailonerror(boolean fail) {
        failOnError = fail;
    }

And modify the catch block around line 180 (i.e. the Exception catch to be)


            }catch(Exception e) {
		String failMsg = "Problem exec'ing P4 command: "+e.getMessage();
		if (failOnError) {
		   throw new BuildException(failMsg);
		}
		else {
		   log(failMsg, Project.MSG_ERR);
		}
            }

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message