You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/05/14 01:22:01 UTC
[1/4] git commit: Adds'-wait' flag to CordovaDeploy. Removes
unnecessary Program class.
Repository: cordova-wp8
Updated Branches:
refs/heads/master 1f52b135f -> df69b966d
Adds'-wait' flag to CordovaDeploy.
Removes unnecessary Program class.
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/0e7f7df7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/0e7f7df7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/0e7f7df7
Branch: refs/heads/master
Commit: 0e7f7df7b9c0e4b38fe71139a3ea7265c28c0fae
Parents: 1f52b13
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Thu May 8 11:50:48 2014 +0400
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu May 8 11:50:48 2014 +0400
----------------------------------------------------------------------
.../lib/CordovaDeploy/CordovaDeploy/Program.cs | 272 ++++---------------
1 file changed, 47 insertions(+), 225 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/0e7f7df7/wp8/template/cordova/lib/CordovaDeploy/CordovaDeploy/Program.cs
----------------------------------------------------------------------
diff --git a/wp8/template/cordova/lib/CordovaDeploy/CordovaDeploy/Program.cs b/wp8/template/cordova/lib/CordovaDeploy/CordovaDeploy/Program.cs
index 45f3473..5837a3a 100644
--- a/wp8/template/cordova/lib/CordovaDeploy/CordovaDeploy/Program.cs
+++ b/wp8/template/cordova/lib/CordovaDeploy/CordovaDeploy/Program.cs
@@ -132,6 +132,7 @@ namespace CordovaDeploy
string xapFilePath = "";
Guid appID = Guid.Empty;
bool uninstallFirst = false;
+ bool awaitAppClose = false;
string root = Directory.GetCurrentDirectory();
@@ -157,6 +158,10 @@ namespace CordovaDeploy
uninstallFirst = true;
}
+ if (args.Contains("-wait"))
+ {
+ awaitAppClose = true;
+ }
if (Directory.Exists(args[0]))
{
@@ -237,64 +242,67 @@ namespace CordovaDeploy
Log("Launching app on " + deviceConn.Name);
app.Launch();
- // wait for the app to launch
- Thread.Sleep(4000);
+ if (awaitAppClose)
+ {
+ // wait for the app to launch
+ Thread.Sleep(4000);
- bool isExiting = false;
+ bool isExiting = false;
- string tempFileName = Path.GetTempFileName();
+ string tempFileName = Path.GetTempFileName();
- try
- {
- IRemoteIsolatedStorageFile isoFile = app.GetIsolatedStore();
- int index = 0;
- while (!isExiting) //app.IsRunning()) // not implemented ... wtf?
+ try
{
+ IRemoteIsolatedStorageFile isoFile = app.GetIsolatedStore();
+ int index = 0;
+ while (!isExiting) //app.IsRunning()) // not implemented ... wtf?
+ {
- char[] buffer = new char[1000];
+ char[] buffer = new char[1000];
- isoFile.ReceiveFile((object)Path.DirectorySeparatorChar + "debugOutput.txt", tempFileName, true);
- using (StreamReader reader = System.IO.File.OpenText(tempFileName))
- {
- try
+ isoFile.ReceiveFile((object)Path.DirectorySeparatorChar + "debugOutput.txt", tempFileName, true);
+ using (StreamReader reader = System.IO.File.OpenText(tempFileName))
{
- int newLinesRead = 0;
- for (int lineNum = 0;; lineNum++)
+ try
{
- if (reader.Peek() > -1)
+ int newLinesRead = 0;
+ for (int lineNum = 0; ; lineNum++)
{
- string str = reader.ReadLine();
- if (lineNum >= index)
+ if (reader.Peek() > -1)
{
- newLinesRead++;
- if (str == "EXIT")
+ string str = reader.ReadLine();
+ if (lineNum >= index)
{
- isExiting = true;
+ newLinesRead++;
+ if (str == "EXIT")
+ {
+ isExiting = true;
+ }
+ Log(str);
}
- Log(str);
+ }
+ else
+ {
+ break;
}
}
- else
- {
- break;
- }
+ index += newLinesRead;
+ }
+ catch (Exception)
+ {
+ // at end of stream most likely, no worries, ... move along.
}
- index += newLinesRead;
- }
- catch (Exception ex)
- {
- // at end of stream most likely, no worries, ... move along.
}
+
+ Thread.Sleep(1000);
}
- Thread.Sleep(1000);
+ System.IO.File.Delete(tempFileName);
}
-
- System.IO.File.Delete(tempFileName);
- }
- catch (Exception ex)
- {
- Log(ex.Message);
+ catch (Exception ex)
+ {
+ Log(ex.Message);
+ }
}
// To Stop :
@@ -322,190 +330,4 @@ namespace CordovaDeploy
*/
}
- class Program
- {
- static void Usage()
- {
- Log("Usage: CordovaDeploy [ -devices BuildOutputPath -d:DeviceIndex ]");
- Log(" -devices : lists the devices and exits");
- Log(" BuildOutputPath : path to the built application, typically Bin/Debug/ or Bin/Release/");
- Log(" -d : index of the device to deploy, default is 0 ");
- Log("examples:");
- Log(" CordovaDeploy -devices");
- Log(" CordovaDeploy Bin/Debug");
- Log(" CordovaDeploy Bin/Release -d:1");
- }
-
- static void ReadWait()
- {
- // This is used when running in Visual Studio, the Command Window is created at launch, and disappears at the
- // end of the program run, this let's us see the output before the window is closed.
-
- /*
- Console.WriteLine("\nPress ENTER to continue...");
- Console.Read();
- */
- }
-
- static void Log(string msg, bool error = false)
- {
- Debug.WriteLine(msg);
- if (error)
- {
- Console.Error.WriteLine(msg);
- }
- else
- {
- Console.Out.WriteLine(msg);
- }
- }
-
- static Guid ReadAppId(string root)
- {
- Guid appID = Guid.Empty;
- string manifestFilePath = root + @"\Properties\WMAppManifest.xml";
-
- if (File.Exists(manifestFilePath))
- {
- XDocument xdoc = XDocument.Load(manifestFilePath);
- var appNode = xdoc.Root.Descendants("App").FirstOrDefault();
- if (appNode != null)
- {
- string guidStr = appNode.Attribute("ProductID").Value;
- appID = new Guid(guidStr);
- }
- else
- {
- Log(string.Format("Unable to find appID, expected to find an App.ProductID property defined in the file {0}", manifestFilePath), true);
- }
- }
- else
- {
- Log(string.Format("Error: the file {0} does not exist", manifestFilePath), true);
- }
- return appID;
- }
-
- static void ListDevices()
- {
- MultiTargetingConnectivity mtConn = new MultiTargetingConnectivity(CultureInfo.CurrentUICulture.LCID);
- Collection<ConnectableDevice> deviceList = mtConn.GetConnectableDevices();
-
- for (int index = 0; index < deviceList.Count; index++)
- {
- ConnectableDevice d = deviceList[index];
- string info = string.Format("{0} : {1} : {2}", index.ToString(), d.Id, d.Name);
- Log(info);
- }
- }
-
- static ConnectableDevice GetDeviceAtIndex(int index)
- {
- MultiTargetingConnectivity mtConn = new MultiTargetingConnectivity(CultureInfo.CurrentUICulture.LCID);
- Collection<ConnectableDevice> deviceList = mtConn.GetConnectableDevices();
- return deviceList[index];
- }
-
- static void Main(string[] args)
- {
- int deviceIndex = 0;
-
- string iconFilePath = "";
- string xapFilePath = "";
- Guid appID = Guid.Empty;
-
- string root = Directory.GetCurrentDirectory();
-
- if (args.Length < 1)
- {
- Usage();
- ReadWait();
- return;
- }
- else if (args[0] == "-devices")
- {
- ListDevices();
- ReadWait();
- return;
- }
- else if (args.Length > 1 && args[1].StartsWith("-d:"))
- {
- deviceIndex = int.Parse(args[1].Substring(3));
- }
-
-
- if (Directory.Exists(args[0]))
- {
- DirectoryInfo info = new DirectoryInfo(args[0]);
- root = info.FullName;
- }
-
- appID = ReadAppId(root);
- if (appID == Guid.Empty)
- {
- return; // Logging of errors is done in ReadAppId
- }
-
- if (File.Exists(root + @"\ApplicationIcon.png"))
- {
- iconFilePath = root + @"\ApplicationIcon.png";
- }
- else
- {
- Log(string.Format("Error: could not find application icon at {0}", root + @"\ApplicationIcon.png"), true);
- ReadWait();
- return;
- }
-
- xapFilePath = Directory.GetFiles(root + @"\Bin\Debug", "*.xap").FirstOrDefault();
- if (string.IsNullOrEmpty(xapFilePath))
- {
- Log(string.Format("Error: could not find application .xap in folder {0}", root), true);
- ReadWait();
- return;
- }
-
- ConnectableDevice deviceConn = GetDeviceAtIndex(deviceIndex);
- Log("Connecting to device :: " + deviceConn.Id + " : " + deviceConn.Name);
- try
- {
- IDevice device = deviceConn.Connect();
- IRemoteApplication app = null;
- if (device.IsApplicationInstalled(appID))
- {
- Log("Uninstalling XAP from " + deviceConn.Name);
- app = device.GetApplication(appID);
- app.Uninstall();
- }
-
- Log("Installing app on " + deviceConn.Name);
- app = device.InstallApplication(appID, appID, "NormalApp", iconFilePath, xapFilePath);
-
- Log("Launching app on " + deviceConn.Name);
- app.Launch();
-
- // To Stop :
- //app.TerminateRunningInstances();
-
- device.Disconnect();
-
- ReadWait();
-
- }
- catch (Exception ex)
- {
- Log("Error :: " + ex.Message, true);
- }
- }
-
- // To read and write ISO storage files!! :
- /*
- try
- {
- IRemoteIsolatedStorageFile isoStore = app.GetIsolatedStore();
- remoteIsolatedStorageFile.ReceiveFile("sourcePath", "destPath", true);
- }
- catch (Exception ex) { }
- */
- }
}
[4/4] git commit: Merge branch 'CB-6685' of
https://github.com/MSOpenTech/cordova-wp8
Posted by pu...@apache.org.
Merge branch 'CB-6685' of https://github.com/MSOpenTech/cordova-wp8
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/df69b966
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/df69b966
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/df69b966
Branch: refs/heads/master
Commit: df69b966d5662e774c9c501f1a2e8056e3e4447f
Parents: d70e6f8 73f5372
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue May 13 16:21:19 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue May 13 16:21:19 2014 -0700
----------------------------------------------------------------------
wp8/template/cordova/lib/build.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
[2/4] git commit: CB-6685 [3.5.0rc][WP8] Build error: Command failed
with exit code 2
Posted by pu...@apache.org.
CB-6685 [3.5.0rc][WP8] Build error: Command failed with exit code 2
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/73f53725
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/73f53725
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/73f53725
Branch: refs/heads/master
Commit: 73f5372587d3fa09d7a35dc201fb1f4df9452595
Parents: 1f52b13
Author: sgrebnov <v-...@microsoft.com>
Authored: Tue May 13 15:15:11 2014 -0700
Committer: sgrebnov <v-...@microsoft.com>
Committed: Tue May 13 15:15:11 2014 -0700
----------------------------------------------------------------------
wp8/template/cordova/lib/build.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/73f53725/wp8/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/wp8/template/cordova/lib/build.js b/wp8/template/cordova/lib/build.js
index c5b3b69..da3b6ed 100644
--- a/wp8/template/cordova/lib/build.js
+++ b/wp8/template/cordova/lib/build.js
@@ -70,6 +70,7 @@ function exec_verbose(command) {
Log(line, true);
WScript.Quit(2);
}
+ return oShell.ExitCode;
}
// escapes a path so that it can be passed to shell command.
[3/4] git commit: update master branch with next dev version number
Posted by pu...@apache.org.
update master branch with next dev version number
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/d70e6f8d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/d70e6f8d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/d70e6f8d
Branch: refs/heads/master
Commit: d70e6f8d33022da060cbc0cdafa8712f90d70b4f
Parents: 0e7f7df
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue May 13 15:56:07 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue May 13 15:56:07 2014 -0700
----------------------------------------------------------------------
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/d70e6f8d/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
index 216add7..fe9f137 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.5.0-dev
\ No newline at end of file
+3.6.0-dev
\ No newline at end of file