KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > core > ant > EclipseAntMain


1 /*******************************************************************************
2  * Copyright (c) 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ant.internal.core.ant;
13
14 import java.util.Iterator JavaDoc;
15
16 import org.apache.tools.ant.BuildListener;
17 import org.apache.tools.ant.Main;
18 import org.apache.tools.ant.Project;
19
20 public class EclipseAntMain extends Main {
21
22     private Project fEclipseAntProject;
23
24     public EclipseAntMain(Project eclipseAntProject) {
25         super();
26         fEclipseAntProject = eclipseAntProject;
27     }
28
29     public static void run(String JavaDoc[] args, Project eclipseAntProject) {
30         Main projectHelpMain = new EclipseAntMain(eclipseAntProject);
31         projectHelpMain.startAnt(args, null, null);
32     }
33     
34     /*
35      * @see org.apache.tools.ant.Main#exit(int)
36      */

37     protected void exit(int exitCode) {
38         //disallow system exit
39
}
40     
41     /*
42      * @see org.apache.tools.ant.Main#addBuildListeners(org.apache.tools.ant.Project)
43      */

44     protected void addBuildListeners(Project project) {
45         Iterator JavaDoc listeners = fEclipseAntProject.getBuildListeners().iterator();
46         while (listeners.hasNext()) {
47             project.addBuildListener((BuildListener) listeners.next());
48         }
49     }
50 }
51
Popular Tags