[Esbox-commits] r902 - in branches/sdkPlusSupport: org.maemo.esbox.maemosdk.core org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters org.maemo.esbox.scratchbox.sb1 org.maemo.esbox.scratchbox.sb1/about_files org.maemo.esbox.scratchbox.sb1/icons org.maemo.esbox.scratchbox.sb1/icons/full org.maemo.esbox.scratchbox.sb1/icons/full/wizban org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1 org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk org.maemo.esbox.scratchbox.sb2 org.maemo.esbox.scratchbox.sb2/META-INF org.maemo.esbox.scratchbox.sb2/about_files org.maemo.esbox.scratchbox.sb2/icons/full org.maemo.esbox.scratchbox.sb2/icons/full/obj16 org.maemo.esbox.scratchbox.sb2/icons/full/wizban org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2 org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk
baranov at garage.maemo.org
baranov at garage.maemo.org
Tue Oct 28 17:09:25 EET 2008
Author: baranov
Date: 2008-10-28 17:09:24 +0200 (Tue, 28 Oct 2008)
New Revision: 902
Added:
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/about.html
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironmentHandler.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapter.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapterFactory.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironmentHandler.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironments.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironmentHandler.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about.html
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about_files/
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about_files/epl-v10.html
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/icons/
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/icons/full/
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/icons/full/wizban/
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/icons/full/wizban/target_wizban.gif
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapter.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapterFactory.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDKTarget.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about.html
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about_files/
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about_files/epl-v10.html
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/icons/full/wizban/
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/icons/full/wizban/target_wizban.gif
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapCommand.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoSdkCommand.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapter.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapterFactory.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDKTarget.java
Removed:
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironment.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironment.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironment.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoLauncher.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/icons/full/obj16/maemoprj_obj.png
Modified:
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/build.properties
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/plugin.xml
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java
branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/build.properties
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/plugin.xml
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Scratchbox1PrepareTargetProcessLaunchAdapter.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/build.properties
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/plugin.xml
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java
branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java
Log:
saving working copy
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/about.html
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/about.html (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/about.html 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,16 @@
+<h3>About This Content</h3>
+
+<h3>ESbox</h3>
+
+<p><a href="http://esbox.garage.maemo.org/" target="_blank">ESbox</a>
+is an Eclipse plug-in that helps programmers to develop applications for
+maemo platform on Scratchbox Apophis. It supports C/C++ and Python programming
+languages. Maemo 4.x SDKs (and later) will be supported.
+</p>
+
+<h3>License</h3>
+
+<p>See <a href="about_files/epl-v10.html">Eclipse Public License Version 1.0 ("EPL")</a>.
+</p>
+
+<address> © Copyright 2007-2008 INdT. All rights reserved. </address>
Modified: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/build.properties
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/build.properties 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/build.properties 2008-10-28 15:09:24 UTC (rev 902)
@@ -2,4 +2,6 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.xml
+ plugin.xml,\
+ about.html,\
+ conf/
Modified: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/plugin.xml
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/plugin.xml 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/plugin.xml 2008-10-28 15:09:24 UTC (rev 902)
@@ -10,6 +10,13 @@
type="org.maemo.mica.common.launch.adapters.ITargetEnvironmentModifierAdapter">
</adapter>
</factory>
+ <factory
+ adaptableType="org.maemo.mica.common.core.sdk.ISDKTarget"
+ class="org.maemo.esbox.internal.api.maemosdk.core.execEnv.MaemoEmulatorExecutionEnvironmentProviderAdapterFactory">
+ <adapter
+ type="org.maemo.mica.common.core.execEnv.IExecutionEnvironmentProviderAdapter">
+ </adapter>
+ </factory>
</extension>
<extension
@@ -18,15 +25,15 @@
point="org.maemo.mica.common.core.execution_environment">
<execution_environment
id="x11"
- class="org.maemo.esbox.internal.api.maemosdk.core.execEnv.X11ExecutionEnvironment">
+ name="X11">
</execution_environment>
<execution_environment
id="gtk"
- class="org.maemo.esbox.internal.api.maemosdk.core.execEnv.GTKExecutionEnvironment">
+ name="GTK">
</execution_environment>
<execution_environment
id="maemo"
- class="org.maemo.esbox.internal.api.maemosdk.core.execEnv.MaemoExecutionEnvironment">
+ name="Maemo AF">
</execution_environment>
</extension>
Deleted: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
-
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.mica.common.core.execEnv.BaseExecutionEnvironment;
-
-/**
- * @author eswartz
- *
- */
-public abstract class BaseScratchboxExecutionEnvironment extends
- BaseExecutionEnvironment {
- /** Base id for scratchbox execution environment ids */
- public static final String SB_EXEC_ENV_BASE = Activator.PLUGIN_ID;
-
- public BaseScratchboxExecutionEnvironment(String id, String name) {
- super(id, name);
- }
-
-}
Deleted: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironment.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironment.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironment.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
-
-/**
- * Environment for GTK applications in X11
- *
- * @author eswartz
- *
- */
-public class GTKExecutionEnvironment extends X11ExecutionEnvironment {
- @SuppressWarnings("hiding")
- public static final String ID = SB_EXEC_ENV_BASE + ".gtk";
-
- public GTKExecutionEnvironment() {
- super(ID, "GTK");
- }
-}
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironmentHandler.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironmentHandler.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/GTKExecutionEnvironmentHandler.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
+
+/**
+ * Environment for GTK applications in X11
+ *
+ * @author eswartz
+ *
+ */
+public class GTKExecutionEnvironmentHandler extends X11ExecutionEnvironmentHandler {
+}
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapter.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapter.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapter.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
+
+import org.maemo.mica.common.core.execEnv.*;
+
+/**
+ * This provides the execution environments supported inside a maemo emulator.
+ * @author eswartz
+ *
+ */
+public class MaemoEmulatorExecutionEnvironmentProviderAdapter implements IExecutionEnvironmentProviderAdapter {
+
+ public MaemoEmulatorExecutionEnvironmentProviderAdapter() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.common.core.execEnv.IExecutionEnvironmentAdapter#getExecutionEnvironmentHandler(java.lang.String)
+ */
+ public IExecutionEnvironmentHandler getExecutionEnvironmentHandler(
+ IExecutionEnvironment execEnv) {
+ if (execEnv == null) {
+ return null;
+ }
+ if (execEnv.getId().equals(MaemoExecutionEnvironments.MAEMO)) {
+ return new MaemoExecutionEnvironmentHandler();
+ }
+ if (execEnv.getId().equals(MaemoExecutionEnvironments.GTK)) {
+ return new GTKExecutionEnvironmentHandler();
+ }
+ if (execEnv.getId().equals(MaemoExecutionEnvironments.X11)) {
+ return new X11ExecutionEnvironmentHandler();
+ }
+ return null;
+ }
+
+
+}
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapterFactory.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapterFactory.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoEmulatorExecutionEnvironmentProviderAdapterFactory.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.mica.common.core.execEnv.IExecutionEnvironmentProviderAdapter;
+
+/**
+ * Generate instances of {@link IExecutionEnvironmentProviderAdapter} for SDK targets
+ * that live inside maemo emulator contexts.
+ * @author eswartz
+ *
+ */
+public class MaemoEmulatorExecutionEnvironmentProviderAdapterFactory implements IAdapterFactory {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+ */
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adaptableObject instanceof IScratchboxSDKTarget) {
+ return new MaemoEmulatorExecutionEnvironmentProviderAdapter();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+ */
+ public Class[] getAdapterList() {
+ return new Class[] { IExecutionEnvironmentProviderAdapter.class };
+ }
+
+}
Deleted: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironment.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironment.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironment.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
-import org.maemo.mica.common.project.core.ProjectManager;
-
-/**
- * Environment for Maemo applications
- *
- * @author eswartz
- *
- */
-public class MaemoExecutionEnvironment extends X11ExecutionEnvironment {
- @SuppressWarnings("hiding")
- public static final String ID = SB_EXEC_ENV_BASE + ".maemo";
-
- public MaemoExecutionEnvironment() {
- super(ID, "Maemo");
- }
-
- public MaemoExecutionEnvironment(String id, String name) {
- super(id, name);
- }
-
- @Override
- public void establishEnvironment(Shell shell, IProject project)
- throws CoreException {
- // see if Maemo is running
- ISDKTarget sdkTarget;
- try {
- sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
- if (!MaemoScriptLauncher.getInstance().isMaemoStarted(sdkTarget)) {
- if (MessageDialog
- .openQuestion(shell, "Launch Maemo?",
- "Maemo is not running. Would you like to launch it now?")) {
- MaemoScriptLauncher.getInstance().startMaemo(sdkTarget);
- }
- }
- } catch (MicaException e) {
- Activator.getErrorLogger().logAndShowError(
- "Error querying Maemo status", e);
- // don't fail the launch
- }
- }
-
-}
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironmentHandler.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironmentHandler.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironmentHandler.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.execEnv.IExecutionEnvironmentHandler;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.project.core.ProjectManager;
+
+/**
+ * Environment for Maemo applications
+ *
+ * @author eswartz
+ *
+ */
+public class MaemoExecutionEnvironmentHandler implements IExecutionEnvironmentHandler {
+
+ public void establishEnvironment(Shell shell, IProject project)
+ throws CoreException {
+ // see if Maemo is running
+ ISDKTarget sdkTarget;
+ try {
+ sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
+ if (!MaemoScriptLauncher.getInstance().isMaemoStarted(sdkTarget)) {
+ if (MessageDialog
+ .openQuestion(shell, "Launch Maemo?",
+ "Maemo is not running. Would you like to launch it now?")) {
+ MaemoScriptLauncher.getInstance().startMaemo(sdkTarget);
+ }
+ }
+ } catch (MicaException e) {
+ Activator.getErrorLogger().logAndShowError(
+ "Error querying Maemo status", e);
+ // don't fail the launch
+ }
+ }
+
+}
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironments.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironments.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/MaemoExecutionEnvironments.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
+
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+
+/**
+ * Registered execution environments for a maemo context
+ * @author eswartz
+ *
+ */
+public class MaemoExecutionEnvironments {
+ public static final String SB_EXEC_ENV_BASE = Activator.PLUGIN_ID;
+
+ /* A generic X11 environment */
+ public static final String X11 = SB_EXEC_ENV_BASE + ".x11";
+ /* A generic GTK environment */
+ public static final String GTK = SB_EXEC_ENV_BASE + ".gtk";
+ /* A Maemo Application Framework environment */
+ public static final String MAEMO = SB_EXEC_ENV_BASE + ".maemo";
+}
Deleted: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironment.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironment.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironment.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
-import org.maemo.mica.common.project.core.ProjectManager;
-
-/**
- * Environment for X11-based programs
- *
- * @author eswartz
- *
- */
-public class X11ExecutionEnvironment extends BaseScratchboxExecutionEnvironment {
-
- /**
- *
- */
- public static final String ID = SB_EXEC_ENV_BASE + ".x11";
-
- public X11ExecutionEnvironment() {
- super(ID, "X11");
- }
-
- public X11ExecutionEnvironment(String id, String name) {
- super(id, name);
- }
-
- @Override
- public void establishEnvironment(Shell shell, IProject project)
- throws CoreException {
- super.establishEnvironment(shell, project);
-
- ISDKTarget sdkTarget;
- try {
- sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
- } catch (MicaException e1) {
- throw new CoreException(Activator.createErrorStatus(
- "Not an ESbox project: " + project, e1));
- }
-
- try {
- if (!MaemoScriptLauncher.getInstance().isXServerStarted(sdkTarget)) {
-
- if (MessageDialog
- .openQuestion(shell, "Launch X Server?",
- "The X server is not running. Would you like to launch it now?")) {
- MaemoScriptLauncher.getInstance().startX();
- }
- }
- } catch (MicaException e) {
- Activator.getErrorLogger().logAndShowError(
- "Error querying X status", e);
- // don't fail the launch
- }
- }
-
-}
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironmentHandler.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironmentHandler.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/execEnv/X11ExecutionEnvironmentHandler.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.api.maemosdk.core.execEnv;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.execEnv.IExecutionEnvironmentHandler;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.project.core.ProjectManager;
+
+/**
+ * Environment for X11-based programs
+ *
+ * @author eswartz
+ *
+ */
+public class X11ExecutionEnvironmentHandler implements IExecutionEnvironmentHandler {
+
+ public void establishEnvironment(Shell shell, IProject project)
+ throws CoreException {
+ ISDKTarget sdkTarget;
+ try {
+ sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
+ } catch (MicaException e1) {
+ throw new CoreException(Activator.createErrorStatus(
+ "Not an ESbox project: " + project, e1));
+ }
+
+ try {
+ if (!MaemoScriptLauncher.getInstance().isXServerStarted(sdkTarget)) {
+
+ if (MessageDialog
+ .openQuestion(shell, "Launch X Server?",
+ "The X server is not running. Would you like to launch it now?")) {
+ MaemoScriptLauncher.getInstance().startX();
+ }
+ }
+ } catch (MicaException e) {
+ Activator.getErrorLogger().logAndShowError(
+ "Error querying X status", e);
+ // don't fail the launch
+ }
+ }
+}
Added: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,46 @@
+package org.maemo.esbox.internal.api.maemosdk.core.tools;
+
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+public interface IMaemoLauncherAdapter {
+
+ /**
+ * Start maemo if it's not running.
+ *
+ * @param sdkTarget
+ * @throws MicaException
+ * if already running or cannot be started
+ */
+ public abstract void startMaemo() throws MicaException;
+
+ /**
+ * Stop maemo if it's running
+ *
+ * @param sdkTarget
+ * @throws MicaException
+ * if not running or cannot be stopped
+ */
+ public abstract void stopMaemo() throws MicaException;
+
+ /**
+ * Restart maemo
+ *
+ * @param sdkTarget
+ * @throws MicaException
+ * if cannot be restarted
+ */
+ public abstract void restartMaemo()
+ throws MicaException;
+
+ /**
+ * Kill maemo by forcibly killing instances of the launcher left behind
+ *
+ * @param sdkTarget
+ * @throws MicaException
+ */
+ public abstract void killMaemo() throws MicaException;
+
+ public abstract boolean isMaemoRunning() throws MicaException;
+
+}
\ No newline at end of file
Deleted: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoLauncher.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoLauncher.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoLauncher.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Raul Herbster (UFCG) - initial implementation
- * Ed Swartz (Nokia) - adaptation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.api.maemosdk.core.tools;
-
-import java.io.IOException;
-import java.util.*;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.ui.console.*;
-import org.maemo.esbox.internal.api.maemosdk.core.MaemoEnvironmentUtils;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.mica.common.core.*;
-import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
-import org.maemo.mica.common.core.machine.*;
-import org.maemo.mica.common.core.process.*;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
-
-/**
- * This class maintains knowledge about whether maemo is running in a target and
- * controls access to starting, stopping, and querying status.
- *
- * @author eswartz
- *
- */
-public class MaemoLauncher {
-
- private static final String MAEMO_LAUNCHER_APP = "maemo-launcher";
- private static MaemoLauncher instance;
-
-
- public synchronized static MaemoLauncher getInstance() {
- if (instance == null) {
- instance = new MaemoLauncher();
- }
- return instance;
- }
-
- static class MaemoCommand {
-
- private ISDKTarget sdkTarget;
-
- public MaemoCommand(ISDKTarget sdkTarget) {
- this.sdkTarget = sdkTarget;
- }
-
- private void performCommand(List<String> params) throws MicaException {
- String maemoCommand = sdkTarget.getPreferenceValue(
- MaemoPreferenceConstants.MAEMO_COMMAND);
- maemoCommand = this.replaceActions(maemoCommand,params.get(0));
-
- IProcessLauncherFactory processLauncherFactory = sdkTarget.getProcessLauncherFactory();
-
- IEnvironmentModifierBlock envBlock = processLauncherFactory.defaultEnvironmentModifierBlock();
- MaemoEnvironmentUtils.defineEmulatorXDisplayVariable(sdkTarget.getSDK().getMachine(), envBlock);
-
- IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory, null,
- Collections.singletonList(maemoCommand), envBlock);
-
- Process process = processLauncher.createProcess();
-
- // spit the consumed output to the console
- MessageConsole console = CoreConsoleManager.getInstance().getConsole(true,
- sdkTarget, "Running Maemo command (" + params.get(0) + ")");
-
- console.addPatternMatchListener(new IPatternMatchListener() {
-
- public int getCompilerFlags() {
- return 0;
- }
-
- public String getLineQualifier() {
- return null;
- }
-
- public String getPattern() {
- return "ERROR:.*";
- }
-
- public void connect(TextConsole console) {
- }
-
- public void disconnect() {
- }
-
- public void matchFound(PatternMatchEvent event) {
- TextConsole console = (TextConsole) event.getSource();
- String content;
- try {
- content = console.getDocument().get(event.getOffset(),
- event.getLength());
- } catch (BadLocationException e) {
- content = console.getDocument().get();
- }
- ErrorLogger errorLogger = Activator.getErrorLogger();
- errorLogger.logAndShowError("Error launching maemo",
- new MicaException(content));
- }
-
- });
-
- // emit everything else to the console
- processLauncher.redirectToConsole(console);
-
- // wait for it to finish
- try {
- process.waitFor();
- } catch (InterruptedException e) {
-
- }
- }
-
- public void startMaemoCommand(ISDKTarget sdkTarget) throws MicaException {
- if (sdkTarget == null) {
- throw new MicaException("No SDK target specified");
- }
-
- List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_START_ACTION);
-
- performCommand(params);
- }
-
- public void stopMaemoCommand(ISDKTarget sdkTarget) throws MicaException {
- if (sdkTarget == null) {
- throw new MicaException("No SDK target specified");
- }
-
- List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_STOP_ACTION);
- performCommand(params);
- }
-
- public void restartMaemoCommand(ISDKTarget sdkTarget)
- throws MicaException {
- if (sdkTarget == null) {
- throw new MicaException("No SDK target specified");
- }
-
- List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_RESTART_ACTION);
- performCommand(params);
- }
-
- private List<String> getParamList(String key) {
- List<String> params = new ArrayList<String>();
- params.add(sdkTarget.getPreferenceValue(key));
- return params;
- }
-
- private String replaceActions(String command, String action) {
- return command.replaceAll("\\$\\{ACTIONS\\}", action);
- }
- }
-
-
- /**
- * Test whether maemo is running. We look for 'maemo-launcher' in the
- * process list.
- *
- * @param sdkTarget
- * @return true if maemo process found
- * @throws MicaException
- * if query is impossible
- */
- private boolean testMaemoLauncher(ISDKTarget sdkTarget)
- throws MicaException {
- List<IProcess> runningProcesses = getMaemoLaunchers(sdkTarget.getSDK()
- .getMachine());
- return runningProcesses.size() > 0;
- }
-
- private List<IProcess> getMaemoLaunchers(IMachine machine) {
- // includes scratchbox call that launched maemo-launcher
- List<IProcess> runningProcesses = machine.getProcessLister()
- .getProcesses(
- new ProcessFilterCmdLineRegexp(".*/"
- + MAEMO_LAUNCHER_APP + "\\s+.*"));
- return runningProcesses;
- }
-
- /**
- * Test whether maemo is started by testing the existence of the
- * maemo-launcher daemon
- *
- * @param sdkTarget
- * @return flag
- */
- public boolean isMaemoRunning(ISDKTarget sdkTarget) throws MicaException {
- return testMaemoLauncher(sdkTarget);
- }
-
- /**
- * Start maemo if it's not running.
- *
- * @param sdkTarget
- * @throws MicaException
- * if already running or cannot be started
- */
- public void startMaemo(ISDKTarget sdkTarget) throws MicaException {
- if (isMaemoRunning(sdkTarget))
- throw new MicaException("Maemo is already running");
-
- MaemoCommand maemoCommand = new MaemoCommand(sdkTarget);
- maemoCommand.startMaemoCommand(sdkTarget);
- }
-
- /**
- * Stop maemo if it's running
- *
- * @param sdkTarget
- * @throws MicaException
- * if not running or cannot be stopped
- */
- public void stopMaemo(ISDKTarget sdkTarget) throws MicaException {
- // always try... may be half-initialized
- // if (!isMaemoRunning(sdkTarget))
- // throw new
- // ScratchboxException("Maemo is not running, or failed to launch.");
-
- MaemoCommand maemoCommand = new MaemoCommand(sdkTarget);
- maemoCommand.stopMaemoCommand(sdkTarget);
- }
-
- /**
- * Restart maemo
- *
- * @param sdkTarget
- * @throws MicaException
- * if cannot be restarted
- */
- public void restartMaemo(ISDKTarget sdkTarget) throws MicaException {
- MaemoCommand maemoCommand = new MaemoCommand(sdkTarget);
- maemoCommand.restartMaemoCommand(sdkTarget);
- }
-
- /**
- * Kill maemo by forcibly killing instances of the launcher left behind
- *
- * @param sdkTarget
- * @throws MicaException
- */
- public void killMaemo(ISDKTarget sdkTarget) throws MicaException {
- List<IProcess> pids = getMaemoLaunchers(sdkTarget.getSDK().getMachine());
- if (pids.size() == 0)
- return;
-
- try {
- for (IProcess process : pids) {
- process.terminate();
- }
- } catch (IOException e) {
-
- }
-
- // try again
- pids = getMaemoLaunchers(sdkTarget.getSDK().getMachine());
- if (pids.size() == 0)
- return;
-
- try {
- for (IProcess process : pids) {
- process.kill();
- }
- } catch (IOException e) {
- throw new MicaException("Could not kill " + MAEMO_LAUNCHER_APP, e);
- }
-
- }
-}
Modified: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -32,12 +32,23 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.ui.console.MessageConsole;
-import org.maemo.mica.common.core.*;
-import org.maemo.mica.common.core.machine.*;
-import org.maemo.mica.common.core.process.*;
-import org.maemo.mica.common.core.sdk.*;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.mica.common.core.CoreConsoleManager;
+import org.maemo.mica.common.core.CorePreferenceManager;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.Policy;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.IProcess;
+import org.maemo.mica.common.core.machine.MachineManager;
+import org.maemo.mica.common.core.machine.ProcessFilterCmdLineRegexp;
+import org.maemo.mica.common.core.process.CommandLineArguments;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.process.ProcessLauncherCreator;
+import org.maemo.mica.common.core.sdk.IPreferenceProvider;
+import org.maemo.mica.common.core.sdk.ISDK;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
import org.maemo.mica.common.project.core.ProjectManager;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
/**
* Class handle all methods that needs some graphical environment. It invokes
@@ -67,21 +78,19 @@
*/
public void startX() throws MicaException {
- XLauncher.getInstance().startX(
- CorePreferenceManager.getInstance().getPreferenceProvider());
+ XLauncher.getInstance().startX(CorePreferenceManager.getInstance().getPreferenceProvider());
}
/**
* Method that stop X-environment for Scratchbox
*/
public void stopX(ISDKTarget sdkTarget) throws MicaException {
-
- if (sdkTarget != null
- && MaemoLauncher.getInstance().isMaemoRunning(sdkTarget))
+ IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)sdkTarget.getAdapter(IMaemoLauncherAdapter.class);
+
+ if (launcher!=null && sdkTarget != null && launcher.isMaemoRunning())
throw new MicaException("Maemo is still running. Stop Maemo first");
- XLauncher.getInstance().stopX(
- CorePreferenceManager.getInstance().getPreferenceProvider());
+ XLauncher.getInstance().stopX(CorePreferenceManager.getInstance().getPreferenceProvider());
}
/**
@@ -636,12 +645,25 @@
} catch (MicaException e1) {
}
- try {
- return MaemoLauncher.getInstance().isMaemoRunning(sdkTarget);
- } catch (MicaException e) {
- Activator.getErrorLogger().logError("Cannot test maemo status", e);
+ IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)sdkTarget.getAdapter(IMaemoLauncherAdapter.class);
+ if(launcher!=null){
+ try{
+ return launcher.isMaemoRunning();
+ }catch (MicaException e) {
+ Activator.getErrorLogger().logError("Cannot test maemo status", e);
+ return false;
+ }
+ }else{
+ // TODO: Throw exception here
return false;
}
+
+// try {
+// return MaemoLauncher.getInstance().isMaemoRunning(sdkTarget);
+// } catch (MicaException e) {
+// Activator.getErrorLogger().logError("Cannot test maemo status", e);
+// return false;
+// }
}
public boolean isXServerStarted(IPreferenceProvider prefProvider)
@@ -681,7 +703,11 @@
// throw new
// ESboxException("Cannot stop Maemo. Start X Server first");
- MaemoLauncher.getInstance().stopMaemo(sdkTarget);
+ IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)sdkTarget.getAdapter(IMaemoLauncherAdapter.class);
+ if(launcher!=null){
+ launcher.stopMaemo();
+ }
+// MaemoLauncher.getInstance().stopMaemo(sdkTarget);
}
/**
@@ -691,13 +717,17 @@
* X is killed.
*/
public void startMaemo(ISDKTarget sdkTarget) throws MicaException {
- if (!XLauncher.getInstance().isXServerStarted(sdkTarget)) {
- MaemoLauncher.getInstance().killMaemo(sdkTarget);
+ IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)sdkTarget.getAdapter(IMaemoLauncherAdapter.class);
+ if(launcher!=null){
+ launcher.startMaemo();
}
- XLauncher.getInstance().startXIfNeeded(sdkTarget);
- if (XLauncher.getInstance().isXServerStarted(sdkTarget)) {
- MaemoLauncher.getInstance().startMaemo(sdkTarget);
- }
+// if (!XLauncher.getInstance().isXServerStarted(sdkTarget)) {
+// MaemoLauncher.getInstance().killMaemo(sdkTarget);
+// }
+// XLauncher.getInstance().startXIfNeeded(sdkTarget);
+// if (XLauncher.getInstance().isXServerStarted(sdkTarget)) {
+// MaemoLauncher.getInstance().startMaemo(sdkTarget);
+// }
}
/**
@@ -707,21 +737,29 @@
* X is killed.
*/
public void restartMaemo(ISDKTarget sdkTarget) throws MicaException {
- if (!XLauncher.getInstance().isXServerStarted(sdkTarget)) {
- MaemoLauncher.getInstance().killMaemo(sdkTarget);
+ IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)sdkTarget.getAdapter(IMaemoLauncherAdapter.class);
+ if(launcher!=null){
+ launcher.restartMaemo();
}
- XLauncher.getInstance().startXIfNeeded(sdkTarget);
-
- if (XLauncher.getInstance().isXServerStarted(sdkTarget)) {
- MaemoLauncher.getInstance().restartMaemo(sdkTarget);
- }
+// if (!XLauncher.getInstance().isXServerStarted(sdkTarget)) {
+// MaemoLauncher.getInstance().killMaemo(sdkTarget);
+// }
+// XLauncher.getInstance().startXIfNeeded(sdkTarget);
+//
+// if (XLauncher.getInstance().isXServerStarted(sdkTarget)) {
+// MaemoLauncher.getInstance().restartMaemo(sdkTarget);
+// }
}
/**
* Kill maemo. Does not kill X.
*/
public void killMaemo(ISDKTarget target) throws MicaException {
- MaemoLauncher.getInstance().killMaemo(target);
+ IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)target.getAdapter(IMaemoLauncherAdapter.class);
+ if(launcher!=null){
+ launcher.killMaemo();
+ }
+// MaemoLauncher.getInstance().killMaemo(target);
}
/**
Modified: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
+import org.maemo.esbox.internal.api.maemosdk.core.execEnv.MaemoExecutionEnvironments;
import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
@@ -80,15 +81,10 @@
IExecutionEnvironment execEnv = null;
String execEnvId = readProperty(executionEnvironmentProperty);
if (execEnvId == null) {
- // XXX: this is compatibility behavior
- // execEnvId =
- // "org.maemo.esbox.scratchbox.core.execution_environment.maemo";
+ execEnvId = MaemoExecutionEnvironments.MAEMO;
}
execEnv = ExecutionEnvironmentFactory.getInstance()
.findExecutionEnvironment(execEnvId);
- if (execEnv == null) {
- execEnv = new UnknownExecutionEnvironment();
- }
return execEnv;
}
Modified: branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -12,7 +12,7 @@
package org.maemo.esbox.internal.maemosdk.core.adapters;
import org.eclipse.core.resources.IProject;
-import org.maemo.esbox.internal.api.maemosdk.core.execEnv.MaemoExecutionEnvironment;
+import org.maemo.esbox.internal.api.maemosdk.core.execEnv.MaemoExecutionEnvironments;
import org.maemo.mica.common.core.adapters.IDefaultExecutionEnvironmentAdapter;
import org.maemo.mica.common.core.execEnv.ExecutionEnvironmentFactory;
import org.maemo.mica.common.core.execEnv.IExecutionEnvironment;
@@ -41,7 +41,7 @@
public IExecutionEnvironment getDefaultExecutionEnvironment(IProject project) {
// TODO: more intelligent check
return ExecutionEnvironmentFactory.getInstance()
- .findExecutionEnvironment(MaemoExecutionEnvironment.ID);
+ .findExecutionEnvironment(MaemoExecutionEnvironments.MAEMO);
}
}
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about.html
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about.html (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about.html 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,16 @@
+<h3>About This Content</h3>
+
+<h3>ESbox</h3>
+
+<p><a href="http://esbox.garage.maemo.org/" target="_blank">ESbox</a>
+is an Eclipse plug-in that helps programmers to develop applications for
+maemo platform on Scratchbox Apophis. It supports C/C++ and Python programming
+languages. Maemo 4.x SDKs (and later) will be supported.
+</p>
+
+<h3>License</h3>
+
+<p>See <a href="about_files/epl-v10.html">Eclipse Public License Version 1.0 ("EPL")</a>.
+</p>
+
+<address> © Copyright 2007-2008 INdT. All rights reserved. </address>
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about_files/epl-v10.html
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about_files/epl-v10.html (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/about_files/epl-v10.html 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ at font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+ at page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>
\ No newline at end of file
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/build.properties
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/build.properties 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/build.properties 2008-10-28 15:09:24 UTC (rev 902)
@@ -3,4 +3,7 @@
bin.includes = META-INF/,\
.,\
plugin.xml,\
- conf/
+ conf/,\
+ icons/,\
+ about.html,\
+ about_files/
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/icons/full/wizban/target_wizban.gif
===================================================================
(Binary files differ)
Property changes on: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/icons/full/wizban/target_wizban.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/plugin.xml
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/plugin.xml 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/plugin.xml 2008-10-28 15:09:24 UTC (rev 902)
@@ -32,6 +32,13 @@
type="org.maemo.mica.common.core.adapters.IPrepareTargetProcessLaunchAdapter">
</adapter>
</factory>
+ <factory
+ adaptableType="org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDKTarget"
+ class="org.maemo.esbox.internal.scratchbox.sb1.ui.adapters.Sb1MaemoLauncherAdapterFactory">
+ <adapter
+ type="org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter">
+ </adapter>
+ </factory>
</extension>
<extension
point="org.maemo.mica.common.core.preference_set_provider">
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/Activator.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -21,7 +21,7 @@
public class Activator extends Plugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.maemo.mica.maemosdk.sdk1";
+ public static final String PLUGIN_ID = "org.maemo.esbox.scratchbox.sb1";
// The shared instance
private static Activator plugin;
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDKTarget.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -14,6 +14,7 @@
import org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDKTarget;
import org.maemo.esbox.internal.scratchbox.sb1.command.GetGdbQemuCommandPatternCommand;
import org.maemo.esbox.internal.scratchbox.sb1.launcher.Scratchbox1ProcessLauncherFactory;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDKTarget;
import org.maemo.mica.common.core.CorePreferenceConstants;
import org.maemo.mica.common.core.MicaException;
import org.maemo.mica.common.core.process.IProcessLauncherFactory;
@@ -28,7 +29,7 @@
* @author baranov
*
*/
-public class Scratchbox1SDKTarget extends AbstractScratchboxSDKTarget {
+public class Scratchbox1SDKTarget extends AbstractScratchboxSDKTarget implements IScratchbox1SDKTarget{
private IPath targetRoot;
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapter.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapter.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapter.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,239 @@
+package org.maemo.esbox.internal.scratchbox.sb1.ui.adapters;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.ui.console.IPatternMatchListener;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.console.PatternMatchEvent;
+import org.eclipse.ui.console.TextConsole;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.XLauncher;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
+import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDKTarget;
+import org.maemo.mica.common.core.CoreConsoleManager;
+import org.maemo.mica.common.core.CorePreferenceManager;
+import org.maemo.mica.common.core.ErrorLogger;
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
+import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.IProcess;
+import org.maemo.mica.common.core.machine.ProcessFilterCmdLineRegexp;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.process.ProcessLauncherCreator;
+import org.maemo.mica.common.core.sdk.ISDKTarget;
+
+public class Sb1MaemoLauncherAdapter implements IMaemoLauncherAdapter{
+
+ private static final String MAEMO_LAUNCHER_APP = "maemo-launcher";
+ private final IScratchbox1SDKTarget target;
+ private final MaemoCommand command;
+
+ public Sb1MaemoLauncherAdapter(IScratchbox1SDKTarget target){
+ this.target = target;
+ this.command = new MaemoCommand(target);
+ }
+
+ @Override
+ public void killMaemo() throws MicaException {
+ List<IProcess> pids = getMaemoLaunchers(target.getSDK().getMachine());
+ if (pids.size() == 0)
+ return;
+
+ try {
+ for (IProcess process : pids) {
+ process.terminate();
+ }
+ } catch (IOException e) {
+
+ }
+
+ // try again
+ pids = getMaemoLaunchers(target.getSDK().getMachine());
+ if (pids.size() == 0)
+ return;
+
+ try {
+ for (IProcess process : pids) {
+ process.kill();
+ }
+ } catch (IOException e) {
+ throw new MicaException("Could not kill " + MAEMO_LAUNCHER_APP, e);
+ }
+
+ }
+
+ @Override
+ public void restartMaemo() throws MicaException {
+ command.restartMaemoCommand();
+
+ }
+
+ @Override
+ public void startMaemo() throws MicaException {
+ if (isMaemoRunning())
+ throw new MicaException("Maemo is already running");
+ XLauncher.getInstance().startXIfNeeded(target);
+ if (XLauncher.getInstance().isXServerStarted(target)) {
+ command.startMaemoCommand();
+ }
+
+
+ }
+
+ @Override
+ public void stopMaemo() throws MicaException {
+ command.stopMaemoCommand();
+
+ }
+
+
+
+ @Override
+ public boolean isMaemoRunning() throws MicaException {
+ List<IProcess> runningProcesses = getMaemoLaunchers(target.getSDK()
+ .getMachine());
+ return runningProcesses.size() > 0;
+ }
+
+ private List<IProcess> getMaemoLaunchers(IMachine machine) {
+ // includes scratchbox call that launched maemo-launcher
+ List<IProcess> runningProcesses = machine.getProcessLister()
+ .getProcesses(
+ new ProcessFilterCmdLineRegexp(".*/"
+ + MAEMO_LAUNCHER_APP + "\\s+.*"));
+ return runningProcesses;
+ }
+
+ static class MaemoCommand {
+
+ private ISDKTarget sdkTarget;
+
+ public MaemoCommand(ISDKTarget sdkTarget) {
+ this.sdkTarget = sdkTarget;
+ }
+
+ private void performCommand(List<String> params) throws MicaException {
+ String maemoCommand = sdkTarget.getPreferenceValue(
+ MaemoPreferenceConstants.MAEMO_COMMAND);
+ maemoCommand = this.replaceActions(maemoCommand,params.get(0));
+
+ IProcessLauncherFactory processLauncherFactory = sdkTarget.getProcessLauncherFactory();
+
+ IEnvironmentModifierBlock envBlock = processLauncherFactory.defaultEnvironmentModifierBlock();
+
+ defineEmulatorXDisplayVariable(sdkTarget.getSDK().getMachine(), envBlock);
+
+ IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory, null,
+ Collections.singletonList(maemoCommand), envBlock);
+
+ Process process = processLauncher.createProcess();
+
+ // spit the consumed output to the console
+ MessageConsole console = CoreConsoleManager.getInstance().getConsole(true,
+ sdkTarget, "Running Maemo command (" + params.get(0) + ")");
+
+ console.addPatternMatchListener(new IPatternMatchListener() {
+
+ public int getCompilerFlags() {
+ return 0;
+ }
+
+ public String getLineQualifier() {
+ return null;
+ }
+
+ public String getPattern() {
+ return "ERROR:.*";
+ }
+
+ public void connect(TextConsole console) {
+ }
+
+ public void disconnect() {
+ }
+
+ public void matchFound(PatternMatchEvent event) {
+ TextConsole console = (TextConsole) event.getSource();
+ String content;
+ try {
+ content = console.getDocument().get(event.getOffset(),
+ event.getLength());
+ } catch (BadLocationException e) {
+ content = console.getDocument().get();
+ }
+ ErrorLogger errorLogger = Activator.getErrorLogger();
+ errorLogger.logAndShowError("Error launching maemo",
+ new MicaException(content));
+ }
+
+ });
+
+ // emit everything else to the console
+ processLauncher.redirectToConsole(console);
+
+ // wait for it to finish
+ try {
+ process.waitFor();
+ } catch (InterruptedException e) {
+
+ }
+ }
+
+ public static void defineEmulatorXDisplayVariable(IMachine serverMachine, IEnvironmentModifierBlock envBlock) {
+ // local launches need DISPLAY that points back to the host machine
+ String display = CorePreferenceManager.getInstance().getRegisteredKeyValue(
+ MaemoPreferenceConstants.X_DISPLAY);
+ if (display != null && display.length() > 0) {
+ String host = serverMachine.getLocalMachineAddress();
+ if (host.equals(IMachine.LOCALHOST_ADDRESS)) {
+ host = "";
+ }
+ envBlock.define("DISPLAY", host + display);
+ }
+ }
+
+ public void startMaemoCommand() throws MicaException {
+ if (sdkTarget == null) {
+ throw new MicaException("No SDK target specified");
+ }
+
+ List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_START_ACTION);
+
+ performCommand(params);
+ }
+
+ public void stopMaemoCommand() throws MicaException {
+ if (sdkTarget == null) {
+ throw new MicaException("No SDK target specified");
+ }
+ List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_STOP_ACTION);
+ performCommand(params);
+ }
+
+ public void restartMaemoCommand()
+ throws MicaException {
+ if (sdkTarget == null) {
+ throw new MicaException("No SDK target specified");
+ }
+
+ List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_RESTART_ACTION);
+ performCommand(params);
+ }
+
+ private List<String> getParamList(String key) {
+ List<String> params = new ArrayList<String>();
+ params.add(sdkTarget.getPreferenceValue(key));
+ return params;
+ }
+
+ private String replaceActions(String command, String action) {
+ return command.replaceAll("\\$\\{ACTIONS\\}", action);
+ }
+ }
+}
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapterFactory.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapterFactory.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Sb1MaemoLauncherAdapterFactory.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,25 @@
+package org.maemo.esbox.internal.scratchbox.sb1.ui.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
+import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDKTarget;
+
+public class Sb1MaemoLauncherAdapterFactory implements IAdapterFactory {
+
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adapterType.equals(IMaemoLauncherAdapter.class)) {
+ if (adaptableObject instanceof IScratchbox1SDKTarget) {
+ return new Sb1MaemoLauncherAdapter((IScratchbox1SDKTarget)adaptableObject);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Class[] getAdapterList() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Scratchbox1PrepareTargetProcessLaunchAdapter.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Scratchbox1PrepareTargetProcessLaunchAdapter.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/adapters/Scratchbox1PrepareTargetProcessLaunchAdapter.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -10,22 +10,24 @@
*******************************************************************************/
package org.maemo.esbox.internal.scratchbox.sb1.ui.adapters;
+import java.text.MessageFormat;
+import java.util.List;
+
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
-import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoLauncher;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
import org.maemo.esbox.internal.api.maemosdk.core.tools.XLauncher;
import org.maemo.esbox.internal.scratchbox.sb1.Activator;
import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
+import org.maemo.mica.common.core.GeneralUtils;
import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.GeneralUtils;
import org.maemo.mica.common.core.adapters.IPrepareTargetProcessLaunchAdapter;
-import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.process.CommandLineArguments;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.ProcessLauncherCreator;
import org.maemo.mica.common.core.sdk.ISDKTarget;
-import java.text.MessageFormat;
-import java.util.List;
-
/**
* Utility class to handle switching scratchbox targets and get user approval to
* kill existing sessions if needed.
@@ -51,7 +53,10 @@
// see if maemo is running, since it needs to be killed to switch
// targets
// but isn't considered a "session" every time
- boolean isMaemoRunning = MaemoLauncher.getInstance().isMaemoRunning(sdkTarget);
+ IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)sdkTarget.getAdapter(IMaemoLauncherAdapter.class);
+ if(launcher == null){
+ // TODO: throw exception
+ }
// now try to switch and see if shells are open
boolean failedToSwitch = false;
@@ -69,7 +74,7 @@
}
}
- if (isMaemoRunning || failedToSwitch) {
+ if (launcher.isMaemoRunning() || failedToSwitch) {
final boolean[] ret = { false };
if (!GeneralUtils.isJUnitRunning()) {
@@ -90,13 +95,13 @@
// if user accepts, kill existing ones
if (ret[0]) {
- if (isMaemoRunning) {
+ if (launcher.isMaemoRunning()) {
// a target selection may succeed even if X and maemo are
// running... kill them first.
// We kill X too because some processes won't be killed by
// maemo-launcher.
try {
- MaemoLauncher.getInstance().killMaemo(sdkTarget);
+ launcher.killMaemo();
} catch (MicaException e2) {
// ignore
}
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/NewScratchbox1TargetWizard.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -55,7 +55,7 @@
setNeedsProgressMonitor(true);
setWindowTitle("New Scratchbox 1 Target");
ImageDescriptor image = Activator
- .getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");
+ .getImageDescriptor("./icons/full/wizban/target_wizban.gif");
setDefaultPageImageDescriptor(image);
initPages();
}
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDKTarget.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDKTarget.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDKTarget.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,7 @@
+package org.maemo.esbox.scratchbox.sb1.sdk;
+
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+
+public interface IScratchbox1SDKTarget extends IScratchboxSDKTarget {
+
+}
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/META-INF/MANIFEST.MF 2008-10-28 15:09:24 UTC (rev 902)
@@ -9,7 +9,8 @@
org.eclipse.ui.ide,
org.maemo.mica.maemosdk.ui;bundle-version="2.0.0",
org.maemo.esbox.scratchbox.core;bundle-version="2.0.0",
- org.maemo.esbox.scratchbox.ui;bundle-version="2.0.0"
+ org.maemo.esbox.scratchbox.ui;bundle-version="2.0.0",
+ org.maemo.esbox.maemosdk.core;bundle-version="2.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.maemo.esbox.internal.api.scratchbox.sb2.core,
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about.html
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about.html (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about.html 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,16 @@
+<h3>About This Content</h3>
+
+<h3>ESbox</h3>
+
+<p><a href="http://esbox.garage.maemo.org/" target="_blank">ESbox</a>
+is an Eclipse plug-in that helps programmers to develop applications for
+maemo platform on Scratchbox Apophis. It supports C/C++ and Python programming
+languages. Maemo 4.x SDKs (and later) will be supported.
+</p>
+
+<h3>License</h3>
+
+<p>See <a href="about_files/epl-v10.html">Eclipse Public License Version 1.0 ("EPL")</a>.
+</p>
+
+<address> © Copyright 2007-2008 INdT. All rights reserved. </address>
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about_files/epl-v10.html
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about_files/epl-v10.html (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/about_files/epl-v10.html 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,328 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office"
+xmlns:w="urn:schemas-microsoft-com:office:word"
+xmlns="http://www.w3.org/TR/REC-html40">
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
+<meta name=ProgId content=Word.Document>
+<meta name=Generator content="Microsoft Word 9">
+<meta name=Originator content="Microsoft Word 9">
+<link rel=File-List
+href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+ at font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+ at page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head>
+
+<body lang=EN-US style='tab-interval:.5in'>
+
+<div class=Section1>
+
+<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear=left>
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+changes to the Program, and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+additions to the Program;</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style='font-size:10.0pt'>"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span
+style='color:red'> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
+
+<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
+its license agreement:</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
+
+<p><span style='font-size:10.0pt'>When the Program is made available in source
+code form:</span> </p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
+it must be made available under this Agreement; and </span></p>
+
+<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style='font-size:10.0pt'>Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style='font-size:10.0pt'>For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
+
+<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
+
+</div>
+
+</body>
+
+</html>
\ No newline at end of file
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/build.properties
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/build.properties 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/build.properties 2008-10-28 15:09:24 UTC (rev 902)
@@ -4,4 +4,6 @@
.,\
plugin.xml,\
conf/,\
- icons/
+ icons/,\
+ about.html,\
+ about_files/
Deleted: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/icons/full/obj16/maemoprj_obj.png
===================================================================
(Binary files differ)
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/icons/full/wizban/target_wizban.gif
===================================================================
(Binary files differ)
Property changes on: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/icons/full/wizban/target_wizban.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/plugin.xml
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/plugin.xml 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/plugin.xml 2008-10-28 15:09:24 UTC (rev 902)
@@ -25,6 +25,13 @@
type="org.maemo.mica.common.core.adapters.ISDKManageTargetAdapter">
</adapter>
</factory>
+ <factory
+ adaptableType="org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDKTarget"
+ class="org.maemo.esbox.internal.scratchbox.sb2.ui.adapters.Sb2MaemoLauncherAdapterFactory">
+ <adapter
+ type="org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter">
+ </adapter>
+ </factory>
</extension>
<extension
point="org.maemo.mica.common.core.preference_set_provider">
@@ -42,7 +49,7 @@
point="org.eclipse.ui.newWizards">
<wizard
class="org.maemo.esbox.internal.scratchbox.sb2.ui.wizard.NewScratchbox2TargetWizard"
- icon="icons/full/obj16/maemoprj_obj.png"
+ icon="icons/full/obj16/new-scratchbox-target.gif"
id="org.maemo.mica.maemosdk.ui.scratchbox.targets.wizards.NewTargetWizard"
name="Scratchbox Targets">
</wizard>
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/Activator.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -23,7 +23,7 @@
public class Activator extends Plugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.maemo.mica.maemosdk.sdk2";
+ public static final String PLUGIN_ID = "org.maemo.esbox.scratchbox.sb2";
// The shared instance
private static Activator plugin;
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/AbstractSb2Command.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -15,6 +15,8 @@
import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
import java.security.InvalidParameterException;
+import java.util.ArrayList;
+import java.util.List;
public abstract class AbstractSb2Command extends AbstractSDKCommand {
@@ -38,4 +40,11 @@
return replaceScratchboxCommand(sboxCommand, action, options);
}
+ protected List<String> createCLI(String...args) {
+ List<String> cli = new ArrayList<String>();
+ for(String arg:args){
+ cli.add(arg);
+ }
+ return cli;
+ }
}
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapCommand.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapCommand.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoRootstrapCommand.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,79 @@
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import java.util.List;
+
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+public class MaemoRootstrapCommand extends AbstractSb2Command {
+
+
+
+ private static final String MAEMO_ROOTSTRAP = "maemo-rootstrap";
+
+ private static final String COMMAND_INSTALL = "install";
+ private static final String COMMAND_LIST = "list";
+ private static final String COMMAND_AVAILABLE = "available";
+
+ private static final String PATH = "path";
+
+
+ public MaemoRootstrapCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ }
+
+ @Override
+ public int getParametersSize() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Object performCommand(List<String> params) throws MicaException {
+ return null;
+ }
+
+ /**
+ * maemo-rootstrap install rootstrap
+ */
+ public void performInstallRootstrap(String rootstrapName) throws MicaException{
+ createProcess(createCLI(MAEMO_ROOTSTRAP,COMMAND_INSTALL,rootstrapName));
+ }
+
+ /**
+ * run maemo-rootstrap list
+ * @return
+ */
+ public List<String> performListInstalledRootstraps() throws MicaException{
+ Process process = createProcess(createCLI(MAEMO_ROOTSTRAP,COMMAND_LIST));
+ return getLineInputFromProcessAndWait(process, false);
+ }
+
+ /**
+ * run maemo-rootstrap available
+ * @return
+ */
+ public List<String> performListAvailableRooList() throws MicaException{
+ Process process = createProcess(createCLI(MAEMO_ROOTSTRAP,COMMAND_AVAILABLE));
+ return getLineInputFromProcessAndWait(process, false);
+ }
+
+ /**
+ * sudo maemo-rootstrap remove <rootstrapName>
+ * @param name
+ */
+ public void performRemoveRootstrap(String name){
+
+ }
+
+ /**
+ * run maemo-rootstrap path <name>
+ * @param name
+ */
+ public String performRootstrapLocation(String name) throws MicaException{
+ Process process = createProcess(createCLI(MAEMO_ROOTSTRAP,PATH,name));
+ return getInputFromProcessAndWait(process, false);
+ }
+
+
+}
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoSdkCommand.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoSdkCommand.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/command/MaemoSdkCommand.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,85 @@
+package org.maemo.esbox.internal.scratchbox.sb2.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.common.core.sdk.commands.ICommandAbstractor;
+
+public class MaemoSdkCommand extends AbstractSb2Command{
+
+ public static final String STATUS_UP = "up";
+ public static final String STATUS_DOWN = "down";
+
+ private static final String MAEMO_SDK = "maemo-sdk";
+
+ private static final String COMMAND_START = "start";
+ private static final String SPECIFIER_GUI = "gui";
+ private static final String COMMAND_STOP = "stop";
+ private static final String COMMAND_SHOW = "show";
+ private static final String SPECIFIER_ROOTSTRAP = "rootstrap";
+ private static final String COMMAND_LIST = "list";
+ private static final String SPECIFIER_TOOLCHAINS = "toolchains";
+
+ public MaemoSdkCommand(ICommandAbstractor commandAbstractor) {
+ super(commandAbstractor);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public int getParametersSize() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public Object performCommand(List<String> params) throws MicaException {
+ return null;
+ }
+
+ /**
+ * @param targetName
+ * @throws MicaException
+ */
+ public void performStartGui(String targetName) throws MicaException{
+ createProcess(createCLI(MAEMO_SDK,COMMAND_START,SPECIFIER_GUI,targetName));
+ }
+
+ /**
+ * @param targetName
+ * @throws MicaException
+ */
+ public void performStopMaemo(String targetName) throws MicaException{
+ createProcess(createCLI(MAEMO_SDK,COMMAND_STOP,SPECIFIER_GUI,targetName));
+ }
+
+ /**
+ * @param targetName
+ * @return
+ * @throws MicaException
+ */
+ public String performStatus(String targetName) throws MicaException{
+ Process process = createProcess(createCLI(MAEMO_SDK,COMMAND_SHOW,SPECIFIER_GUI,targetName));
+ return getInputFromProcessAndWait(process, false).toLowerCase();
+ }
+
+ /**
+ * run maemo-sdk show rootstrap
+ * @return
+ * @throws MicaException
+ */
+ public String performShowDefaultRootstrap() throws MicaException{
+ Process process = createProcess(createCLI(MAEMO_SDK,COMMAND_SHOW,SPECIFIER_ROOTSTRAP));
+ return getInputFromProcessAndWait(process, false);
+ }
+
+ /**
+ * maemo-sdk list toolchains
+ * @return
+ * @throws MicaException
+ */
+ public List<String> performListCompilers() throws MicaException{
+ Process process = createProcess(createCLI(MAEMO_SDK,COMMAND_LIST,SPECIFIER_TOOLCHAINS));
+ return getLineInputFromProcessAndWait(process, false);
+ }
+}
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDKTarget.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -16,6 +16,7 @@
import org.maemo.esbox.internal.scratchbox.sb2.command.GetGdbQemuCommandPatternCommand;
import org.maemo.esbox.internal.scratchbox.sb2.launcher.Scratchbox2ProcessLauncherFactory;
import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDKTarget;
import org.maemo.mica.common.core.CorePreferenceConstants;
import org.maemo.mica.common.core.MicaException;
import org.maemo.mica.common.core.process.IProcessLauncherFactory;
@@ -28,7 +29,7 @@
* @author baranov
*
*/
-public class Scratchbox2SDKTarget extends AbstractScratchboxSDKTarget {
+public class Scratchbox2SDKTarget extends AbstractScratchboxSDKTarget implements IScratchbox2SDKTarget{
private IPath targetRoot;
private IPath rootstrapRoot;
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapter.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapter.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapter.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,45 @@
+package org.maemo.esbox.internal.scratchbox.sb2.ui.adapters;
+
+import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
+import org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDK;
+import org.maemo.esbox.internal.scratchbox.sb2.command.MaemoSdkCommand;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDKTarget;
+import org.maemo.mica.common.core.MicaException;
+
+public class Sb2MaemoLauncherAdapter implements IMaemoLauncherAdapter {
+ private final IScratchbox2SDKTarget target;
+ private MaemoSdkCommand command;
+
+ public Sb2MaemoLauncherAdapter(IScratchbox2SDKTarget adaptableObject) {
+ target = adaptableObject;
+ try{
+ command = new MaemoSdkCommand(((AbstractScratchboxSDK)target.getSDK()).getCommandAbstractor());
+ }catch(MicaException e){
+ }
+ }
+
+ @Override
+ public boolean isMaemoRunning() throws MicaException {
+ return command.performStatus(target.getName()).equals(MaemoSdkCommand.STATUS_UP);
+ }
+
+ @Override
+ public void killMaemo() throws MicaException {
+ stopMaemo();
+ }
+
+ @Override
+ public void restartMaemo() throws MicaException {
+ startMaemo();
+ }
+
+ @Override
+ public void startMaemo() throws MicaException {
+ command.performStartGui(target.getName());
+ }
+
+ @Override
+ public void stopMaemo() throws MicaException {
+ command.performStopMaemo(target.getName());
+ }
+}
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapterFactory.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapterFactory.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/adapters/Sb2MaemoLauncherAdapterFactory.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,25 @@
+package org.maemo.esbox.internal.scratchbox.sb2.ui.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
+import org.maemo.esbox.scratchbox.sb2.sdk.IScratchbox2SDKTarget;
+
+public class Sb2MaemoLauncherAdapterFactory implements IAdapterFactory {
+
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+ if (adapterType.equals(IMaemoLauncherAdapter.class)) {
+ if (adaptableObject instanceof IScratchbox2SDKTarget) {
+ return new Sb2MaemoLauncherAdapter((IScratchbox2SDKTarget)adaptableObject);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public Class[] getAdapterList() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Modified: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java 2008-10-28 13:49:49 UTC (rev 901)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/ui/wizard/NewScratchbox2TargetWizard.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -64,7 +64,7 @@
setNeedsProgressMonitor(true);
setWindowTitle("New Scratchbox 2 Target");
ImageDescriptor image = Activator
- .getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");
+ .getImageDescriptor("./icons/full/wizban/target_wizban.gif");
setDefaultPageImageDescriptor(image);
initPages();
}
Added: branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDKTarget.java
===================================================================
--- branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDKTarget.java (rev 0)
+++ branches/sdkPlusSupport/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/scratchbox/sb2/sdk/IScratchbox2SDKTarget.java 2008-10-28 15:09:24 UTC (rev 902)
@@ -0,0 +1,7 @@
+package org.maemo.esbox.scratchbox.sb2.sdk;
+
+import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
+
+public interface IScratchbox2SDKTarget extends IScratchboxSDKTarget {
+
+}
More information about the Esbox-commits
mailing list