forked from eclipse-archived/thym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[453701] Add support for Windows Phone 8 platform
Initial support for Windows Phone 8 platform. It does not contain Windows Phone 7.X support because this system is no longer supported. It contains set of basic features to create, launch and export native wp8 applications. I have tried to avoid any 3rd party tools for accessing Windows registry. In result, it uses reg command instead. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=453701 Change-Id: Ic0b6732e85bab0bf8845cbe1643b53a862815bfb Signed-off-by: wgalanciak <[email protected]>
- Loading branch information
1 parent
6363434
commit accf5d0
Showing
44 changed files
with
3,116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.thym.wp.core</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: %Bundle-Name | ||
Bundle-SymbolicName: org.eclipse.thym.wp.core;singleton:=true | ||
Bundle-Version: 0.1.0.qualifier | ||
Bundle-Activator: org.eclipse.thym.wp.core.WPCore | ||
Bundle-Vendor: %Bundle-Vendor | ||
Require-Bundle: org.eclipse.core.runtime, | ||
org.eclipse.thym.core, | ||
org.eclipse.debug.core, | ||
org.apache.commons.io;bundle-version="[2.0.0,2.1.0)" | ||
Bundle-ActivationPolicy: lazy | ||
Bundle-ClassPath: . | ||
Bundle-NativeCode: lib/x86/ICE_JNIRegistry.dll; selection-filter="(&(osgi.arch=x86)(osgi.os=win32))", | ||
This comment has been minimized.
Sorry, something went wrong. |
||
lib/x86_64/ICE_JNIRegistry.dll; selection-filter="(&(osgi.arch=x86_64)(osgi.os=win32))", * | ||
Export-Package: org.eclipse.thym.wp.core, | ||
org.eclipse.thym.wp.core.vstudio | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Eclipse-PlatformFilter: (osgi.os=win32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
plugin.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
############################################################################### | ||
# Copyright (c) 2014 Zend Technologies Ltd. | ||
# 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: | ||
# Red Hat Inc. - initial API and implementation and/or initial documentation | ||
# Zend Technologies Ltd. - initial implementation | ||
############################################################################### | ||
Bundle-Vendor = Eclipse.org - Thym | ||
Bundle-Name = Hybrid Mobile App. Dev. Windows Phone 8 Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
<extension | ||
point="org.eclipse.thym.core.platformSupport"> | ||
<platform | ||
id="org.eclipse.thym.wp.core.platformSupport" | ||
libraryResolver="org.eclipse.thym.wp.core.WPLibraryResolver" | ||
platform="Windows Phone 8 (Visual Studio)" | ||
platformID="wp8" | ||
pluginInstallActionFactory="org.eclipse.thym.wp.internal.core.vstudio.WPPluginInstallationActionsFactory" | ||
projectGenerator="org.eclipse.thym.wp.internal.core.vstudio.WPProjectGenerator"> | ||
</platform> | ||
</extension> | ||
<extension | ||
point="org.eclipse.thym.core.projectBuilder"> | ||
<builder | ||
delegate="org.eclipse.thym.wp.core.vstudio.MSBuild" | ||
id="org.eclipse.thym.wp.core.projectBuilder" | ||
platform="Windows Phone 8 (Visual Studio)"> | ||
</builder> | ||
</extension> | ||
<extension | ||
point="org.eclipse.debug.core.launchConfigurationTypes"> | ||
<launchConfigurationType | ||
delegate="org.eclipse.thym.wp.internal.core.WPLaunchDelegate" | ||
id="org.eclipse.thym.wp.core.WPLaunchConfigurationType" | ||
modes="run" | ||
name="Windows Phone 8 Emulator"> | ||
</launchConfigurationType> | ||
</extension> | ||
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.eclipse.thym</groupId> | ||
<artifactId>plugins</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
</parent> | ||
<groupId>.org.eclipse.thym.plugins</groupId> | ||
<artifactId>org.eclipse.thym.wp.core</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
<packaging>eclipse-plugin</packaging> | ||
</project> |
122 changes: 122 additions & 0 deletions
122
plugins/org.eclipse.thym.wp.core/src/org/eclipse/thym/wp/core/WPCore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2014 Zend Technologies Ltd. | ||
* 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: | ||
* Red Hat Inc. - initial API and implementation and/or initial documentation | ||
* Zend Technologies Ltd. - initial implementation | ||
*******************************************************************************/ | ||
package org.eclipse.thym.wp.core; | ||
|
||
import java.io.File; | ||
import java.util.Arrays; | ||
|
||
import org.eclipse.core.runtime.CoreException; | ||
import org.eclipse.core.runtime.ILog; | ||
import org.eclipse.core.runtime.Platform; | ||
import org.eclipse.core.runtime.Status; | ||
import org.eclipse.core.runtime.preferences.IEclipsePreferences; | ||
import org.eclipse.core.runtime.preferences.InstanceScope; | ||
import org.eclipse.thym.wp.core.vstudio.WPConstants; | ||
import org.eclipse.thym.wp.internal.core.WindowsRegistry; | ||
import org.osgi.framework.BundleActivator; | ||
import org.osgi.framework.BundleContext; | ||
|
||
/** | ||
* @author Wojciech Galanciak, 2014 | ||
* | ||
*/ | ||
public class WPCore implements BundleActivator { | ||
|
||
public static final String WP_LAUNCH_ID = "org.eclipse.thym.wp.core.WPLaunchConfigurationType"; //$NON-NLS-1$ | ||
|
||
public static final String PLUGIN_ID = "org.eclipse.thym.wp.core"; //$NON-NLS-1$ | ||
|
||
private static final String THYM_UI_ID = "org.eclipse.thym.ui"; //$NON-NLS-1$ | ||
|
||
private static final String WINDOWS_PHONE_REG = "HKLM\\Software\\Wow6432Node\\Microsoft\\Microsoft SDKs\\WindowsPhone"; //$NON-NLS-1$ | ||
private static final String INSTALL_PATH = "Install Path"; //$NON-NLS-1$ | ||
|
||
private static BundleContext context; | ||
|
||
private static ILog logger; | ||
|
||
static BundleContext getContext() { | ||
return context; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext | ||
* ) | ||
*/ | ||
public void start(BundleContext bundleContext) throws Exception { | ||
WPCore.context = bundleContext; | ||
logger = Platform.getLog(getContext().getBundle()); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) | ||
*/ | ||
public void stop(BundleContext bundleContext) throws Exception { | ||
WPCore.context = null; | ||
} | ||
|
||
public static void log(int status, String message, Throwable throwable) { | ||
logger.log(new Status(status, PLUGIN_ID, message, throwable)); | ||
} | ||
|
||
/** | ||
* Get path to Windows Phone SDK root folder. | ||
* | ||
* @return path to Windows Phone SDK root folder or <code>null</code> if SDK | ||
* cannot be retrieved from preferences or detected from Windows | ||
* registry. | ||
* @throws CoreException | ||
*/ | ||
public static String getSDKLocation() throws CoreException { | ||
String sdkLocation = Platform.getPreferencesService().getString( | ||
THYM_UI_ID, WPConstants.WINDOWS_PHONE_SDK_LOCATION_PREF, null, | ||
null); | ||
if (sdkLocation == null) { | ||
File location = detectSDK(); | ||
if (location.exists()) { | ||
sdkLocation = location.getAbsolutePath(); | ||
IEclipsePreferences prefs = InstanceScope.INSTANCE | ||
.getNode(THYM_UI_ID); | ||
prefs.put(WPConstants.WINDOWS_PHONE_SDK_LOCATION_PREF, | ||
sdkLocation); | ||
} | ||
} | ||
return sdkLocation; | ||
} | ||
|
||
private static File detectSDK() throws CoreException { | ||
String[] versions = WindowsRegistry.getChildren(WINDOWS_PHONE_REG); | ||
if (versions.length > 0) { | ||
Arrays.sort(versions); | ||
String installPath = null; | ||
for (int i = versions.length - 1; i >= 0; i--) { | ||
installPath = WindowsRegistry.readRegistry( | ||
WINDOWS_PHONE_REG + "\\" + versions[i] + "\\" + INSTALL_PATH, //$NON-NLS-1$ //$NON-NLS-2$ | ||
INSTALL_PATH); | ||
if (installPath != null) { | ||
break; | ||
} | ||
} | ||
if (installPath != null) { | ||
return new File(installPath); | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
} |
Oops, something went wrong.
Those libs aren't part of the commit. Is this expected? Is the license for those DLLs Eclipse-friendly?