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. Cheers, Antoine
-----Urspr�ngliche Nachricht----- Von: Decker, Scott [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 19. September 2003 17:25 An: [EMAIL PROTECTED] 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 task. 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 Replace: String newLabel = "Label: " + name + "\n" + "Description: " + desc + "\n" + "Options: unlocked\n" + "View: \n\t" + P4View; With String newLabel = "Label: " + name + "\n" + "Description: " + desc + "\n" + "Options: unlocked\n" + "View: "; if (multipleViews == null) { newLabel += P4View + "\n"; } else { StringTokenizer tokenizer = new StringTokenizer(multipleViews,";"); while(tokenizer.hasMoreTokens()){ String token = tokenizer.nextToken(); newLabel += token + System.getProperty("line.separator"); if (tokenizer.hasMoreTokens()) newLabel += "\t"; } } Scott Decker Chief Squirrel and Programming Lead [EMAIL PROTECTED] 310-309-4916 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
