[p4] Exiting 1 wont work with pre-trigger

Stephen Vance steve at vance.com
Sat Dec 8 17:34:33 PST 2001


First, you have a problem trying to use a pre-submit trigger as a build 
verifier.  The files being submitted are not available at the time of the 
trigger invocation.  They won't be available until the submit completes.

As for the other, my guess is that ant.bat is not exiting with a non-zero 
when one of its commands exits with a non-zero.

At 03:52 PM 12/8/2001 -0800, Travis Morris wrote:
>I'm trying setup a pre-trigger which uses Ant to build all my java
>classes before submitting to the baseline. Basically I have a home
>directory on the server mapped to my client machine thus allowing me to
>build the client workspace before submitting.
>
>I created a batch file which sets up the environment variables, and
>calls Ant, which uses a BuildListener. Its setup so if the build fails
>it performs the following:
>
>if(status=="failed")
>
>{
>
>System.out.println("Your changelist failed.");
>
>System.exit(1);
>
>}
>
>I dont see why its still submitting the changelist even though I'm
>exiting with non zero.
>
>Does it make a difference that its not the actual batch file returning
>the non zero, and its actually a build monitor being called by Ant?
>
>Essentially this is my setup:
>
>----------------------------------------------------------------
>
>Trigger:
>
>Build_CMAutomation //depot/... d:/buildscripts/build.bat
>
>----------------------------------------------------------------
>
>The only reason I'm using this batch file is because Perforce wont find
>the environment variables unless I set the right before I call the
>command.. I have no clue why.
>
>set
>CLASSPATH=d:\buildscripts;d:\buildscripts\ant.jar;d:\buildscripts\mail.j
>ar;d:\buildscripts\activation.jar
>
>set PATH=d:\buildscripts;d:\ant\bin
>
>set JAVA_HOME=c:\jbuilder5\jdk1.3
>
>ant.bat -listener BuildMonitor -f build.xml -quiet
>
>
>
>Thanks for any help you can provide.
>
>_______________________________________________
>perforce-user mailing list  -  perforce-user at perforce.com
>http://maillist.perforce.com/mailman/listinfo/perforce-user

Stephen Vance
mailto:steve at vance.com
http://www.vance.com/




More information about the perforce-user mailing list