#4 Non-interrupting p4 tasks (especially p4change)



I use perforce for my SCM and have really liked the
possibilities that the p4 suite of task offer towards
maintaining a proper internal and shipping release

Over the last two days I have been trying to map out
my companies release procedure into a NAnt build file to
ease the work involved and to ensure consistency
across projects. So far I have had mixed results with the
NAnt p4 tasks.

Most of the problems I encountered were due to
documentation issues - to be expected I suppose for
unreleased features. Once I looked at the source code I
was better able to understand how the author of the p4
tasks intented them to be used.

One area that may have been overlooked is providing
the ability to include the descriptive text for a changelist
through a task property. Currently (and this is the
default way the perforce command line client performs
thses operations), whenever a new change list is
created, a text editor (in my case notepad) opens up,
with a populated text file that I am supposed to edit,
save and exit before perforce continues. This text file
contains some fields that are supposed to be filled out
for the perforce client. This of course means that the
nant build file cannot be executed without someone
there to fill in the necessary details (as the entire build
process stops until the text form is filled out, saved and
the text editor closed).

The perforce client does support reading this text form
from a redirected standard input, which would be ideal.
If this was supported then you could have a p4change
task that looked like this:

<p4change changelist="update-build-number"
description="The build number text file is being updated
for the lastest internal release" />

I would be happy to develop such a solution within the
current framework and submit a patch. But I would be
more interested in discussing the plans/design for the p4
suite to get an idea of what functionality it will be
intended to support.

I would also be willing, if required to produce some
documentation or article(s) on the use of the p4 tasks
to demonstrate what can be achieved etc.



  • Ian MacLean

    Ian MacLean - 2004-05-27

    Logged In: YES

    Hi Andrew,
    I was the original author of a couple of the p4 tasks, the
    rest being implemented by Jeff Hemry. Your suggestion of
    adding a description attribute is a good one - certainly we
    don't want to be popping up editors during an unattended
    build process. It would also be useful to ue the xml nodes
    text body for multiline discriptions, like:
    <p4change changelist="update-build-number" >
    The build number text file is being updated
    for the lastest internal release

    as to the ongoing plans/design for the p4 tasks - why not
    post your thoughts/ideas to the nant-contrib dev list at:
    nantcontrib-developer@lists.sourceforge.net and we can get
    responses from interested parties. Your offer to produce
    docs is also much appreciated.

  • Jeff Hemry

    Jeff Hemry - 2004-05-27

    Logged In: YES


    Well it looks like I'm the culprit here. Sorry for the lack of

    As far as the plans/design for the P4 suite, one of my
    intentions was to follow the design laid out by the p4 tasks in
    but I deviated from that path in a few places.

    I would be happy to work with you to clean up my tasks or
    work on documentation.


  • Andrew Davey

    Andrew Davey - 2004-06-02

    Logged In: YES


    I would be happy to help in either a development, testing or
    documenting capacity.

    I have nearly finished my build script (you would think I was
    writing an epic given the time it has taken me), and have
    been able to achieve most of the desired p4 functionality
    through the p4 tasks, exec tasks, and calls into the Perforce

    Once I finish I do plan to write an article/document on what
    steps I have taken to get my required processes. Once this is
    done, I would be happy to discuss some of my thoughts
    towards enhanced functionality etc.

    I've never contributed to an online project before, let alone a
    sourceforge one, so I am little unfamiliar as to which sections
    comments should be posted to etc etc (ie I have a horrible
    feeling that what I'm about to post is going to appear as a
    comment/adjustment to my original post and not as a
    seperate item). Any pointers in this regards would be greatly


  • cappy popp

    cappy popp - 2004-08-18

    Logged In: YES

    I have fixed this locally due to similar needs. I have also
    changed the <p4client> task so that it can take a clientspec
    from stdin or a stream as well. Therefore, you can now do
    something like:

    <p4print file="//depot/path/clientspec"
    <p4client fromfile="clientspec"/>

    I am unsure if anyone is interested in my posting this or
    adding it to the project; I am a sourceforge project neophyte
    (developing for them, certainly not using them :) ). Please
    comment or advise


Log in to post a comment.