]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/OsgiBootEquinoxLaunchConfiguration.java
Improve SLC launch plugin
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.ide.ui / src / main / java / org / argeo / slc / ide / ui / launch / osgi / OsgiBootEquinoxLaunchConfiguration.java
1 package org.argeo.slc.ide.ui.launch.osgi;
2
3 import org.argeo.slc.ide.ui.SlcIdeUiPlugin;
4 import org.eclipse.core.resources.IFile;
5 import org.eclipse.core.resources.IResource;
6 import org.eclipse.core.runtime.CoreException;
7 import org.eclipse.core.runtime.IProgressMonitor;
8 import org.eclipse.debug.core.ILaunch;
9 import org.eclipse.debug.core.ILaunchConfiguration;
10 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
11 import org.eclipse.pde.launching.EquinoxLaunchConfiguration;
12
13 /** OSGiBoot launch configuration. */
14 public class OsgiBootEquinoxLaunchConfiguration extends
15 EquinoxLaunchConfiguration {
16 public final static String ID = SlcIdeUiPlugin.ID
17 + ".OsgiBootEquinoxLauncher";
18
19 @Override
20 public void launch(ILaunchConfiguration configuration, String mode,
21 ILaunch launch, IProgressMonitor monitor) throws CoreException {
22 super.launch(configuration, mode, launch, monitor);
23
24 // System.out.println("targetBundles="
25 // + configuration.getAttribute(
26 // IPDELauncherConstants.TARGET_BUNDLES, ""));
27 // System.out.println("workspaceBundles="
28 // + configuration.getAttribute(
29 // IPDELauncherConstants.WORKSPACE_BUNDLES, ""));
30
31 // Refresh resources before launching
32 final IFile propertiesFile = (IFile) configuration.getMappedResources()[0];
33 propertiesFile.getParent().refreshLocal(IResource.DEPTH_INFINITE,
34 monitor);
35 }
36
37 @Override
38 protected void preLaunchCheck(ILaunchConfiguration configuration,
39 ILaunch launch, IProgressMonitor monitor) throws CoreException {
40 // System.out.println("Launching... " + launch);
41 ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
42 OsgiLaunchHelper.updateLaunchConfiguration(wc, false);
43 wc.doSave();
44 super.preLaunchCheck(configuration, launch, monitor);
45
46 // Note that if a Java project contains a build.properties it has to
47 // declare the sources otherwise it will be skipped in the generation of
48 // the dev.properties file!
49
50 // for(Object bundleId:fAllBundles.keySet()){
51 // System.out.println(bundleId+"="+fAllBundles.get(bundleId));
52 // }
53 }
54
55 }