Skip to content

Commit

Permalink
update example to 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
purplecabbage committed Apr 30, 2012
1 parent 73a3252 commit d20ea8d
Show file tree
Hide file tree
Showing 31 changed files with 747 additions and 901 deletions.
2 changes: 1 addition & 1 deletion example/App.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Application
x:Class="GapExample.App"
x:Class="CordovaExample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
Expand Down
4 changes: 2 additions & 2 deletions example/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace GapExample
namespace CordovaExample
{
public partial class App : Application
{
Expand All @@ -35,7 +35,7 @@ public App()
if (System.Diagnostics.Debugger.IsAttached)
{
// Display the current frame rate counters.
Application.Current.Host.Settings.EnableFrameRateCounter = true;
//Application.Current.Host.Settings.EnableFrameRateCounter = true;

// Show the areas of the app that are being redrawn in each frame.
//Application.Current.Host.Settings.EnableRedrawRegions = true;
Expand Down
63 changes: 63 additions & 0 deletions example/BuildManifestProcessor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

var objArgs = WScript.Arguments;
for (i = 0; i < objArgs.length; i++) {
WScript.Echo("Arg :: " + objArgs(i));
}

var projectFilePath = null;
if (objArgs && objArgs.length > 0) {
projectFilePath = objArgs(0);
}


var fso = WScript.CreateObject("Scripting.FileSystemObject");
var outFile = fso.CreateTextFile("..\\..\\CordovaSourceDictionary.xml", true);

outFile.WriteLine('<?xml version="1.0" encoding="utf-8"?>');
outFile.WriteLine('<!-- This file is auto-generated, do not edit! -jm -->');
outFile.WriteLine('<CordovaSourceDictionary>');

// We need to get any Linked files from the project

WScript.Echo("Adding Source Files ...");
if (projectFilePath != null) {
var projXml = WScript.CreateObject("Microsoft.XMLDOM");

projXml.async = false;
if (projXml.load(projectFilePath)) {

// add linked content ( windows shortcuts )
var nodes = projXml.selectNodes("/Project/ItemGroup/Content/Link");
WScript.Echo("/Project/ItemGroup/Content/Link nodes.length" + nodes.length);
for (var n = 0; n < nodes.length; n++) {
outFile.WriteLine(' <FilePath Value="' + nodes[n].text + '"/>');
}

// add files of type Resource
nodes = projXml.selectNodes("/Project/ItemGroup/Resource/Link");
WScript.Echo("/Project/ItemGroup/Resource/Link nodes.length" + nodes.length);
for (n = 0; n < nodes.length; n++) {
outFile.WriteLine(' <FilePath Value="' + nodes[n].text + '"/>');
}

// add Content files from www folder
nodes = projXml.selectNodes("/Project/ItemGroup/Content[@Include]");
WScript.Echo("/Project/ItemGroup/Content nodes.length" + nodes.length);
for (n = 0; n < nodes.length; n++) {
for (var i = 0; i < nodes[n].attributes.length; i++) {

if (nodes[n].attributes[i].name == "Include") {
var val = nodes[n].attributes[i].value;
if (val.indexOf("www") == 0) {
WScript.Echo("adding value :: " + val);
outFile.WriteLine(' <FilePath Value="' + val + '"/>');
}
}
}

}
}
}

outFile.WriteLine('</CordovaSourceDictionary>');

Loading

0 comments on commit d20ea8d

Please sign in to comment.