mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-16 08:39:59 +07:00
29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
package com.intellij.rt.ant.execution;
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
public final class AntMain2 {
|
|
public static final int MSG_VERBOSE = 3;
|
|
public static final int MSG_ERR = 0;
|
|
public static final int MSG_WARN = 1;
|
|
|
|
public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
|
|
IdeaAntLogger2.guardStreams();
|
|
|
|
// first try to use the new way of launching ant
|
|
try {
|
|
final Class antLauncher = Class.forName("org.apache.tools.ant.launch.Launcher");
|
|
//noinspection HardCodedStringLiteral
|
|
antLauncher.getMethod("main", new Class[]{args.getClass()}).invoke(null, new Object[]{args});
|
|
return;
|
|
}
|
|
catch (ClassNotFoundException e) {
|
|
// ignore and try older variant
|
|
}
|
|
|
|
final Class antMain = Class.forName("org.apache.tools.ant.Main");
|
|
//noinspection HardCodedStringLiteral
|
|
antMain.getMethod("main", new Class[]{args.getClass()}).invoke(null, new Object[]{args});
|
|
}
|
|
}
|