package org.argeo.slc.ide.ui.launch.osgi;
-import java.util.Map;
-import java.util.TreeMap;
-
import org.argeo.slc.ide.ui.SlcIdeUiPlugin;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
public void launch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
super.launch(configuration, mode, launch, monitor);
-
- // System.out.println("targetBundles="
- // + configuration.getAttribute(
- // IPDELauncherConstants.SELECTED_TARGET_PLUGINS, ""));
- // System.out.println("workspaceBundles="
- // + configuration.getAttribute(
- // IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS, ""));
-
// Refresh resources before launching
final IFile propertiesFile = (IFile) configuration.getMappedResources()[0];
propertiesFile.getParent().refreshLocal(IResource.DEPTH_INFINITE,
monitor);
}
- @SuppressWarnings("unchecked")
@Override
protected void preLaunchCheck(ILaunchConfiguration configuration,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
OsgiLaunchHelper.updateLaunchConfiguration(wc, true);
wc.doSave();
- Map<String, ?> attrs = new TreeMap<String, Object>(
- (Map<String, String>) wc.getAttributes());
- OsgiLaunchHelper.debug("WC " + wc);
- for (String key : attrs.keySet())
- OsgiLaunchHelper.debug(key + "=" + attrs.get(key));
super.preLaunchCheck(configuration, launch, monitor);
// Note that if a Java project contains a build.properties it has to
// declare the sources otherwise it will be skipped in the generation of
// the dev.properties file!
-
- // for(Object bundleId:fAllBundles.keySet()){
- // System.out.println(bundleId+"="+fAllBundles.get(bundleId));
- // }
}
}
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "");
wc.setAttribute(ATTR_DEFAULT_VM_ARGS, originalVmArgs);
- // do NOT use custom features (both must be set)
- wc.setAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, false);
- wc.setAttribute(IPDELauncherConstants.USE_DEFAULT, true);
-
// clear config area by default
wc.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, true);
} catch (CoreException e) {
}
/** Expects properties file to be set as mapped resources */
+ @SuppressWarnings("unchecked")
public static void updateLaunchConfiguration(
ILaunchConfigurationWorkingCopy wc, Boolean isEclipse) {
try {
+ if (debug)
+ debug("##\n## Launch " + wc.getName() + " - " + new Date()
+ + "\n##");
+
// Finds the properties file and load it
IFile propertiesFile = (IFile) wc.getMappedResources()[0];
propertiesFile.refreshLocal(IResource.DEPTH_ONE, null);
updateLaunchConfiguration(wc, bundlesToStart,
systemPropertiesToAppend, dataDir.getAbsolutePath(),
isEclipse);
+
+ if (debug) {
+ Map<String, ?> attrs = new TreeMap<String, Object>(
+ (Map<String, String>) wc.getAttributes());
+ for (String key : attrs.keySet())
+ OsgiLaunchHelper.debug(key + "=" + attrs.get(key));
+ }
} catch (Exception e) {
e.printStackTrace();
Shell shell = SlcIdeUiPlugin.getDefault().getWorkbench()
// Update other default information
wc.setAttribute(IPDELauncherConstants.DEFAULT_AUTO_START, false);
- // do NOT use custom features (both must be set)
wc.setAttribute(IPDELauncherConstants.USE_CUSTOM_FEATURES, false);
- wc.setAttribute(IPDELauncherConstants.USE_DEFAULT, true);
+ if (!isEclipse)
+ wc.setAttribute(IPDELauncherConstants.USE_DEFAULT, true);
// VM arguments (system properties)
String defaultVmArgs = wc.getAttribute(
protected static String interpretProperties(Properties properties,
Map<String, Integer> bundlesToStart,
Map<String, String> systemPropertiesToAppend) {
- // String argeoOsgiStart = properties
- // .getProperty(OsgiLauncherConstants.ARGEO_OSGI_START);
- // if (argeoOsgiStart != null) {
- // StringTokenizer st = new StringTokenizer(argeoOsgiStart, ",");
- // while (st.hasMoreTokens())
- // bundlesToStart.add(st.nextToken());
- // }
-
computeBundlesToStart(bundlesToStart, properties, null);
String applicationId = null;
IVMInstallType[] vmTypes = JavaRuntime.getVMInstallTypes();
for (IVMInstallType vmType : vmTypes) {
for (IVMInstall vmInstall : vmType.getVMInstalls()) {
- // printVm("", vmInstall);
// properties based on name
addVmSysProperty(vmArgs, vmInstall.getName(), vmInstall);
if (vmInstall instanceof IVMInstall2) {
*/
protected static String convertBundleList(
Map<String, Integer> bundlesToStart, String original) {
- if (debug)
- debug("Original bundle list: " + original);
-
StringTokenizer stComa = new StringTokenizer(original, ",");
// sort by bundle symbolic name
Set<String> bundleIds = new TreeSet<String>();
// We can now rely on bundleId value
if (bundleId.endsWith(".source")) {
- debug("Skip source bundle " + bundleId);
+ // debug("Skip source bundle " + bundleId);
continue bundles;
} else if (bundleId
.equals(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR)) {