Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 18090 invoked from network); 21 Sep 2003 13:23:24 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 21 Sep 2003 13:23:24 -0000 Received: (qmail 45370 invoked by uid 500); 21 Sep 2003 13:23:06 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 45327 invoked by uid 500); 21 Sep 2003 13:23:06 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 45313 invoked from network); 21 Sep 2003 13:23:05 -0000 Received: from unknown (HELO relay.t-online-com.de) (62.156.147.74) by daedalus.apache.org with SMTP; 21 Sep 2003 13:23:05 -0000 Received: from D2CFT80J (p5080ea1f.dip0.t-ipconnect.de [80.128.234.31]) by relay.t-online-com.de (SMTPSVC(1.0.0.2)) with ESMTP id 6B99314CA8C for ; Sun, 21 Sep 2003 15:17:12 +0200 (CEST) From: =?iso-8859-1?Q?Antoine_L=E9vy-Lambert?= To: "Ant Users List" Subject: AW: Adding multiple views to p4label optional task Date: Sun, 21 Sep 2003 15:22:15 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <60FDA15DE1A9B14580024C2F3D176A7E4A3B68@ex01.sm.edmunds-corp.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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:sdecker@edmunds.com] Gesendet: Freitag, 19. September 2003 17:25 An: user@ant.apache.org 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 sdecker@edmunds.com 310-309-4916 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org