ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <>
Subject AW: Adding multiple views to p4label optional task
Date Sun, 21 Sep 2003 13:22:15 GMT
Hi Scott,
there is already in ant1.6alpha something in place to accept multiple views
separated by ; or :
In the current code, multiple views are assumed.

-----Urspr√ľngliche Nachricht-----
Von: Decker, Scott []
Gesendet: Freitag, 19. September 2003 17:25
Betreff: Adding multiple views to p4label optional task

Hey there all,
  So, either I read through the source wrong, or perhaps I did something
wrong, but it doesn't seem like you can add multiple views to the p4label
There is a snippet of code in the label task that says something like
"View: \n\t" + P4View;

However, there is still no good way to pass in the correct line breaks that
perforce requires.

I am submitting a few code snippets here that alleviates this problem. I am
not a source commiter, so please feel free to take a look and have at it.
It works well for me if I have only one view, or multiple ones.  I do use a
delimeter though, and I am not sure if that is the best route to go.

I propose:

Add the following variable and setter method

protected String multipleViews = null;

     * If you need to set multiple views, use this method
     * we use a semicolon as our delimeter
     * example:
     * multipleViews="//depot/dir/...;//depot/dir2/...;//depot/dir3/..."
     * or
     * multipleViews="//depot/dir/..."
     * @param multipleViews
    public void setMultipleViews(String multipleViews) {
        this.multipleViews = multipleViews;

In the execute method
String newLabel =
                "Label: " + name + "\n" +
                "Description: " + desc + "\n" +
                "Options: unlocked\n" +
                "View: \n\t" + P4View;


String newLabel =
                "Label: " + name + "\n" +
                "Description: " + desc + "\n" +
                "Options: unlocked\n" +
                "View: ";
        if (multipleViews == null)
            newLabel += P4View + "\n";
            StringTokenizer tokenizer = new
                String token = tokenizer.nextToken();
                newLabel += token + System.getProperty("line.separator");
                if (tokenizer.hasMoreTokens())
                    newLabel += "\t";

Scott Decker
Chief Squirrel and
Programming Lead

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message