KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > utils > AntUtils


1 /*
2  * Created on 9 mars 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package com.bull.eclipse.jonas.utils;
8
9 import java.io.File JavaDoc;
10
11 import org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchShortcut;
12 import org.eclipse.ant.internal.ui.model.AntUtil;
13 import org.eclipse.core.resources.IFile;
14 import org.eclipse.debug.core.ILaunchManager;
15
16 import com.bull.eclipse.jonas.JonasLauncherPlugin;
17
18 /**
19  * @author riase
20  *
21  * To change the template for this generated type comment go to
22  * Window>Preferences>Java>Code Generation>Code and Comments
23  */

24 public class AntUtils {
25     
26     public static void runAnt(String JavaDoc buildFile) {
27         IFile file = AntUtil.getFile(buildFile);
28         JonasLauncherPlugin.log("File exist ? " + file.exists());
29         JonasLauncherPlugin.log(file.toString());
30         AntLaunchShortcut shortcut= new AntLaunchShortcut();
31         shortcut.setShowDialog(false);
32         shortcut.launch(file, ILaunchManager.RUN_MODE, null);
33     }
34
35     public static void runAnt(String JavaDoc buildFile, String JavaDoc target) {
36         IFile file = AntUtil.getFile(buildFile);
37         JonasLauncherPlugin.log("File exist ? " + file.exists());
38         JonasLauncherPlugin.log(file.toString());
39         AntLaunchShortcut shortcut= new AntLaunchShortcut();
40         shortcut.setShowDialog(false);
41         shortcut.launch(file, ILaunchManager.RUN_MODE, target);
42     }
43
44 }
45
Popular Tags