[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [pde-dev] org.eclipse.core.runtime.CoreException: BUILD FAILED
|
The following are the approaches i tried using eclipse PDE project.
Method 1 (this throws CoreException, BUILD FAILED)
---------
Bundle bundle = Platform.getBundle("....)
Path path = new Path(BUILD_FILE);
URL buildFileURL = Platform.find(bundle, path);
AntRunner runner = null;
if(buildFileURL != null) {
runner = new AntRunner();
try {
runner.setBuildFileLocation(Platform.asLocalURL(buildFileURL).toExternalForm());
}
catch (IOException e) {
e.printStackTrace();
}
runner.setArguments("-Dmessage=Building -verbose");
runner.addBuildLogger(ANT_LOGGER_CLASS);
runner.setExecutionTargets(new String[] {"test"});
}
try {
runner.run();
}
catch (CoreException e) {
e.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
Method 2 (this will not work under PDE Project whereas it works from java
project)
---------
Project ant = new Project();
ProjectHelper helper = new ProjectHelperImpl();
ant.init();
helper.parse(ant, new File ("..\resource\\test-build.xml"));
ant.executeTarget("test");
Method 3 (This is not working as well)
---------
IProject proj =
ResourcesPlugin.getWorkspace().getRoot().getProject("...");
IFile launchFile = proj.getFile("test-build.xml.launch");
ILaunchConfiguration launchConf =
DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(launchFile);
launchConf.launch("run", new NullProgressMonitor());
I don't see any better approaches for this problem. Any help would be
greatly appreciated. Thanks.
jpv wrote:
>
> Hi,
>
> I am working on my first Eclipse Plug-in Project.
>
> Objective: I am trying to execute a target of ANT build file from
> Created Menu Item Action using Eclipse Plug-in Project.
>
> Approach: Inside the method using AntRunner Class I am trying to call
> the external build file to run the default target.
>
> public void run(IAction action) {
> Bundle bundle =
> Platform.getBundle("com.test.eclipse.plugins.testbuild");
> Path path = new Path("/resource/test-build.xml");
> URL buildFileURL = Platform.find(bundle, path);
>
> AntRunner runner = null;
> if(buildFileURL != null) {
> runner = new AntRunner();
> try {
>
> runner.setBuildFileLocation(Platform.asLocalURL(buildFileURL).toExternal
> Form());
> }
> catch (IOException e) {
> e.printStackTrace();
> }
> runner.setArguments("-Dmessage=Building -verbose");
> runner.addBuildLogger(ANT_LOGGER_CLASS);
> }
>
> try {
> runner.run();
> }
> catch (CoreException e) {
> e.printStackTrace();
> }
> catch (Exception e) {
> e.printStackTrace();
> }
>
> Exception: I am getting the following exception
> org.eclipse.core.runtime.CoreException: BUILD FAILED
> at org.eclipse.ant.core.AntRunner.run(AntRunner.java:387)
> at org.eclipse.ant.core.AntRunner.run(AntRunner.java:474)
>
> Verified: The above program locates the build file properly but when it
> tries to execute it throws the CoreException.
>
> Note: The test build file I tried works fine independently.
>
> Any thoughts/help would be greatly appreciated.
>
> Thanks
>
> -- jpv
>
>
> _______________________________________________
> pde-dev mailing list
> pde-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/pde-dev
>
>
--
View this message in context: http://www.nabble.com/org.eclipse.core.runtime.CoreException%3A-BUILD-FAILED-tp20538305p23294770.html
Sent from the Eclipse PDE - General mailing list archive at Nabble.com.