Author: yradtsevich
Date: 2011-11-01 12:05:53 -0400 (Tue, 01 Nov 2011)
New Revision: 36113
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web
apps
- BrowserSimLauncher adapted to run also on Mac OS X
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java
===================================================================
---
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java 2011-11-01
15:50:40 UTC (rev 36112)
+++
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/util/BrowserSimLauncher.java 2011-11-01
16:05:53 UTC (rev 36113)
@@ -22,14 +22,22 @@
*/
public class BrowserSimLauncher {
public static void launchBrowserSim(String initialUrl) {
+ String pathSeparator = System.getProperty("path.separator");
+
String classPath = getBundleLocation("org.jboss.tools.browsersim") +
"bin/"
- + ';' + getBundleLocation("org.jboss.tools.browsersim.webkit") +
"bin/"
- + ';' + getBundleLocation("org.eclipse.swt")
- + ';' + getBundleLocation("org.eclipse.swt." +
PlatformUtil.CURRENT_PLATFORM);
+ + pathSeparator + getBundleLocation("org.jboss.tools.browsersim.webkit") +
"bin/"
+ + pathSeparator + getBundleLocation("org.eclipse.swt")
+ + pathSeparator + getBundleLocation("org.eclipse.swt." +
PlatformUtil.CURRENT_PLATFORM);
String javaCommand = System.getProperty("java.home") +
"/bin/java";
List<String> commandElements = new ArrayList<String>();
commandElements.add(javaCommand);
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ commandElements.add("-XstartOnFirstThread");
+ if (Platform.ARCH_X86.equals(Platform.getOSArch())) {
+ commandElements.add("-d32");
+ }
+ }
commandElements.add("-Dosgi.os=" + Platform.getOS());
commandElements.add("-Dosgi.arch=" + Platform.getOSArch());
if (Platform.getWS() != null) {
@@ -51,8 +59,8 @@
private static String getBundleLocation(String symbolicName) {
String locationId = Platform.getBundle(symbolicName).getLocation();
- if (locationId.startsWith("reference:file:/")) {
- return locationId.substring("reference:file:/".length());
+ if (locationId.startsWith("reference:file:")) {
+ return locationId.substring("reference:file:".length());
}
return locationId;
}