X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.ide.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fide%2Fui%2Flaunch%2Fosgi%2FOsgiLaunchHelper.java;h=11135f208528fdb37eda7a336425c23e4f372665;hb=aaa675bef15fd415b09478a1ac925fd8b528dd10;hp=347f267235c64cdac0816ba9530ab4d95b582939;hpb=ef8ea7f8ddce3f1603d5e29b5e90c1cb02fd556e;p=gpl%2Fargeo-slc.git diff --git a/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/OsgiLaunchHelper.java b/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/OsgiLaunchHelper.java index 347f26723..11135f208 100644 --- a/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/OsgiLaunchHelper.java +++ b/plugins/org.argeo.slc.ide.ui/src/main/java/org/argeo/slc/ide/ui/launch/osgi/OsgiLaunchHelper.java @@ -4,6 +4,7 @@ import java.io.File; 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; @@ -76,10 +77,6 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { 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) { @@ -121,9 +118,14 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { } /** 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); @@ -153,6 +155,13 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { updateLaunchConfiguration(wc, bundlesToStart, systemPropertiesToAppend, dataDir.getAbsolutePath(), isEclipse); + + if (debug) { + Map attrs = new TreeMap( + (Map) wc.getAttributes()); + for (String key : attrs.keySet()) + OsgiLaunchHelper.debug(key + "=" + attrs.get(key)); + } } catch (Exception e) { e.printStackTrace(); Shell shell = SlcIdeUiPlugin.getDefault().getWorkbench() @@ -211,9 +220,9 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { // 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( @@ -285,14 +294,6 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { protected static String interpretProperties(Properties properties, Map bundlesToStart, Map 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; @@ -330,7 +331,6 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { 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) { @@ -373,9 +373,6 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { */ protected static String convertBundleList( Map bundlesToStart, String original) { - if (debug) - debug("Original bundle list: " + original); - StringTokenizer stComa = new StringTokenizer(original, ","); // sort by bundle symbolic name Set bundleIds = new TreeSet(); @@ -396,7 +393,7 @@ public class OsgiLaunchHelper implements OsgiLauncherConstants { // 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)) {