Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AFA5C10513 for ; Sat, 20 Apr 2013 00:55:24 +0000 (UTC) Received: (qmail 24020 invoked by uid 500); 20 Apr 2013 00:55:24 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 23967 invoked by uid 500); 20 Apr 2013 00:55:24 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 23730 invoked by uid 99); 20 Apr 2013 00:55:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Apr 2013 00:55:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A533581B54E; Sat, 20 Apr 2013 00:55:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: commits@cordova.apache.org Date: Sat, 20 Apr 2013 00:55:30 -0000 Message-Id: <5bda123d5cbb4e0ebe9a90202a0d92b4@git.apache.org> In-Reply-To: <632edff965b94436bf12d305038c2471@git.apache.org> References: <632edff965b94436bf12d305038c2471@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [08/11] git commit: prepping for 2.7.0 release prepping for 2.7.0 release Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/964ee3e5 Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/964ee3e5 Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/964ee3e5 Branch: refs/heads/master Commit: 964ee3e5257e8e858aa8c34d2709cf1e3452b7b8 Parents: e254170 Author: Benn Mapes Authored: Fri Apr 19 15:28:55 2013 -0700 Committer: Benn Mapes Committed: Fri Apr 19 15:28:55 2013 -0700 ---------------------------------------------------------------------- templates/vs/MyTemplateStandAlone.vstemplate | 73 +++--- tooling/scripts/build.bat | 2 - tooling/scripts/build.js | 101 -------- tooling/scripts/buildjs.js | 12 +- tooling/scripts/debug.bat | 2 - tooling/scripts/deploy.js | 270 --------------------- tooling/scripts/dist.js | 29 ++- tooling/scripts/emulate.bat | 2 - tooling/scripts/new.js | 2 +- tooling/scripts/package.js | 85 ++----- tooling/scripts/reversion.js | 100 +------- tooling/scripts/win-zip.js | 5 +- 12 files changed, 92 insertions(+), 591 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/templates/vs/MyTemplateStandAlone.vstemplate ---------------------------------------------------------------------- diff --git a/templates/vs/MyTemplateStandAlone.vstemplate b/templates/vs/MyTemplateStandAlone.vstemplate index c98c4e1..8a6566b 100644 --- a/templates/vs/MyTemplateStandAlone.vstemplate +++ b/templates/vs/MyTemplateStandAlone.vstemplate @@ -1,13 +1,13 @@ - CordovaWP8_2_7_0rc1_StandAlone + CordovaWP8_2.7.0rc1 Cordova 2.7.0rc1 for Windows Phone 8 using the Cordova source code directly. CSharp 1000 true - CordovaWP8_2_7_0rc1_StandAlone + CordovaWP8_2.7.0rc1 true Enabled true @@ -21,58 +21,56 @@ ApplicationIcon.png Background.png config.xml - - debug.bat - emulate.bat - BrowserMouseHelper.cs CommandFactory.cs - Accelerometer.cs - AudioFormatsHelper.cs - AudioPlayer.cs BaseCommand.cs - Battery.cs - Camera.cs - Capture.cs - Compass.cs - Contacts.cs - DebugConsole.cs - Device.cs - File.cs - FileTransfer.cs - GeoLocation.cs - ImageExifHelper.cs - InAppBrowser.cs - Media.cs - MimeTypeMapper.cs - NetworkStatus.cs - Notification.cs ConfigHandler.cs CordovaCommandCall.cs CordovaView.xaml CordovaView.xaml.cs DOMStorageHelper.cs - - appbar.back.rest.png - appbar.close.rest.png - appbar.feature.video.rest.png - appbar.next.rest.png - appbar.save.rest.png - appbar.stop.rest.png - JsonHelper.cs NativeExecution.cs OrientationHelper.cs PluginResult.cs - - notification-beep.wav - ScriptCallback.cs + + + appbar.back.rest.png + appbar.close.rest.png + appbar.feature.video.rest.png + appbar.next.rest.png + appbar.save.rest.png + appbar.stop.rest.png + + MainPage.xaml + MainPage.xaml.cs + + Accelerometer.cs + AudioFormatsHelper.cs + AudioPlayer.cs + Battery.cs + Camera.cs + Capture.cs + Compass.cs + Contacts.cs + DebugConsole.cs + Device.cs + File.cs + FileTransfer.cs + GeoLocation.cs + Globalization.cs + ImageExifHelper.cs + InAppBrowser.cs + Media.cs + MimeTypeMapper.cs + NetworkStatus.cs + Notification.cs AudioCaptureTask.cs AudioRecorder.xaml @@ -86,9 +84,6 @@ VideoRecorder.xaml.cs - MainPage.xaml - MainPage.xaml.cs - AppManifest.xml AssemblyInfo.cs http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/build.bat ---------------------------------------------------------------------- diff --git a/tooling/scripts/build.bat b/tooling/scripts/build.bat deleted file mode 100644 index 1e0e8dc..0000000 --- a/tooling/scripts/build.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -cscript "%~dp0\build.js" %* //nologo \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/build.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/build.js b/tooling/scripts/build.js deleted file mode 100644 index 8f274b1..0000000 --- a/tooling/scripts/build.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var fso = WScript.CreateObject('Scripting.FileSystemObject'), - wscript_shell = WScript.CreateObject("WScript.Shell"); - - -function Usage() -{ - WScript.StdOut.WriteLine(""); - WScript.StdOut.WriteLine("Usage: build [ PathTOProjectFolder ]"); - WScript.StdOut.WriteLine(" PathTOProjectFolder : The path to the project being built"); - WScript.StdOut.WriteLine("examples:"); - WScript.StdOut.WriteLine(" build C:\\Users\\anonymous\\Desktop\\MyProject"); - WScript.StdOut.WriteLine(""); -} - -// exicutes a commmand in the shell -function exec(command) { - var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { - if(!oShell.StdOut.AtEndOfStream) { - var line = oShell.StdOut.ReadLine(); - // XXX: Change to verbose mode - // WScript.StdOut.WriteLine(line); - } - WScript.sleep(100); - } -} - -// builds the project and .xap -function build(path) -{ - WScript.StdOut.WriteLine("Building Cordova-WP8 Project:"); - WScript.StdOut.WriteLine("\tDirectory : " + path); - - // delete any previously generated files - if(fso.FolderExists(path + "\\obj")) - { - fso.DeleteFolder(path + "\\obj"); - } - if(fso.FolderExists(path + "\\Bin")) - { - fso.DeleteFolder(path + "\\Bin"); - } - - wscript_shell.CurrentDirectory = path; - exec('msbuild CordovaAppProj.csproj'); - - WScript.StdOut.WriteLine("BUILD SUCCESS."); -} - -var args = WScript.Arguments; - -WScript.StdOut.WriteLine(""); - -if(args.Count() > 0) -{ - // support help flags - if(args(0) == "--help" || args(0) == "/?" || - args(0) == "help" || args(0) == "-help" || args(0) == "/help") - { - Usage(); - WScript.Quit(1); - } - else - { - if(fso.FolderExists(args(0))) - { - build(args(0)); - } - else - { - WScript.StdOut.WriteLine("Could not find project directory."); - Usage(); - WScript.StdOut.WriteLine("BUILD FAILED."); - WScript.Quit(1); - } - } -} -else -{ - Usage(); - WScript.Quit(1); -} http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/buildjs.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/buildjs.js b/tooling/scripts/buildjs.js index 839a827..78e213c 100644 --- a/tooling/scripts/buildjs.js +++ b/tooling/scripts/buildjs.js @@ -49,7 +49,7 @@ function Log(msg) { function Usage() { Log(""); - Log("This Script builds the given virsion of cordova.js and injects it into this or the given cordova-wp8 ") + Log("This Script builds the given virsion of cordova.js and injects it into this or the given cordova-wp8 "); Log(""); Log("Usage: buildjs [ Version PathTOCordovaWP8 ]"); Log(" Version : The version of cordova.js to build (must already be tagged)"); @@ -82,7 +82,7 @@ function read(filename) { // executes a commmand in the shell function exec(command) { var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { WScript.sleep(100); } } @@ -91,7 +91,7 @@ function exec(command) { function exec_verbose(command) { //Log("Command: " + command); var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { //Wait a little bit so we're not super looping WScript.sleep(100); //Print any stdout output from the script @@ -103,8 +103,8 @@ function exec_verbose(command) { //Check to make sure our scripts did not encounter an error if(!oShell.StdErr.AtEndOfStream) { - var line = oShell.StdErr.ReadAll(); - WScript.StdErr.WriteLine(line); + var err_line = oShell.StdErr.ReadAll(); + WScript.StdErr.WriteLine(err_line); WScript.Quit(1); } } @@ -199,7 +199,7 @@ if(args.Count() > 0) else { Log("The provided version number is invalid, please provide"); - Log(" a version number in the format Major.Minor.Fix[rc#]") + Log(" a version number in the format Major.Minor.Fix[rc#]"); Usage(); WScript.Quit(1); } http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/debug.bat ---------------------------------------------------------------------- diff --git a/tooling/scripts/debug.bat b/tooling/scripts/debug.bat deleted file mode 100644 index abf851d..0000000 --- a/tooling/scripts/debug.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -cscript "%~dp0\deploy.js" %1 -debug //nologo \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/deploy.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/deploy.js b/tooling/scripts/deploy.js deleted file mode 100644 index 17b884b..0000000 --- a/tooling/scripts/deploy.js +++ /dev/null @@ -1,270 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - - -var fso = WScript.CreateObject('Scripting.FileSystemObject'), - wscript_shell = WScript.CreateObject("WScript.Shell"); - -var args = WScript.Arguments, - ROOT = WScript.ScriptFullName.split('\\tooling\\', 1), - // path to CordovaDeploy.exe - CORDOVA_DEPLOY_EXE = '\\tooling\\CordovaDeploy\\CordovaDeploy\\bin\\Debug\\CordovaDeploy.exe', - // path to CordovaDeploy - CORDOVA_DEPLOY = '\\tooling\\CordovaDeploy'; - - -// help function -function Usage() -{ - WScript.StdOut.WriteLine(""); - WScript.StdOut.WriteLine("Usage: [ debug | emulate ] [ PathTOProjectFolder ] "); - WScript.StdOut.WriteLine(" PathTOProjectFolder : The path to the project being launched."); - WScript.StdOut.WriteLine("examples:"); - WScript.StdOut.WriteLine(" debug C:\\Users\\anonymous\\Desktop\\MyProject"); - WScript.StdOut.WriteLine(" emulate C:\\Users\\anonymous\\Desktop\\MyBetterProject"); - WScript.StdOut.WriteLine(" deploy C:\\Users\\anonymous\\Desktop\\TheProject -emulate"); - WScript.StdOut.WriteLine(""); -} - - - -var ForReading = 1, ForWriting = 2, ForAppending = 8; -var TristateUseDefault = 2, TristateTrue = 1, TristateFalse = 0; - - -// executes a commmand in the shell -function exec(command) { - var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { - WScript.sleep(100); - } -} - -// executes a commmand in the shell -function exec_verbose(command) { - //WScript.StdOut.WriteLine("Command: " + command); - var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { - //Wait a little bit so we're not super looping - WScript.sleep(100); - //Print any stdout output from the script - if(!oShell.StdOut.AtEndOfStream) { - var line = oShell.StdOut.ReadLine(); - WScript.StdOut.WriteLine(line); - } - } - //Check to make sure our scripts did not encounter an error - if(!oShell.StdErr.AtEndOfStream) - { - var line = oShell.StdErr.ReadAll(); - WScript.StdErr.WriteLine(line); - WScript.Quit(1); - } -} - -// returns the contents of a file -function read(filename) { - //WScript.Echo('Reading in ' + filename); - if(fso.FileExists(filename)) - { - var f=fso.OpenTextFile(filename, 1,2); - var s=f.ReadAll(); - f.Close(); - return s; - } - else - { - WScript.StdErr.WriteLine('Cannot read non-existant file : ' + filename); - WScript.Quit(1); - } - return null; -} - -// builds the project and .xap -function build_xap(path) -{ - WScript.StdOut.WriteLine("Building Cordova-WP8 Project:"); - WScript.StdOut.WriteLine("\tDirectory : " + path); - - // delete any previously generated files - if(fso.FolderExists(path + "\\obj")) - { - fso.DeleteFolder(path + "\\obj"); - } - if(fso.FolderExists(path + "\\Bin")) - { - fso.DeleteFolder(path + "\\Bin"); - } - - wscript_shell.CurrentDirectory = path; - exec_verbose('msbuild CordovaAppProj.csproj'); - //From original bat : msbuild /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Debug - - //Get package name - //TODO: find a better way to do this (title in WPAppManifest? not always the name of the xap) - /*var app = read(path + '\\App.xaml'); - var temp = app.match(/x\:Class\=\"(.*)\"/)[0].split('.', 1); - var app_name = temp.toString().split('"')[1]; - - //Check if file xap was created - if(!fso.FileExists(path + '\\Bin\\Debug\\' + app_name + '.xap')) - { - WScript.StdErr.WriteLine('ERROR: MSBuild failed to create .xap when building cordova-wp8.'); - WScript.Quit(1); - } - WScript.StdOut.WriteLine("SUCESS"); - - WScript.StdOut.WriteLine("BUILD SUCCESS.");*/ -} - -// builds the CordovaDeploy.exe if it does not already exist -function cordovaDeploy() -{ - if(fso.FileExists(ROOT + CORDOVA_DEPLOY_EXE)) - { - return true; - } - - WScript.StdOut.WriteLine("CordovaDeploy.exe not found, attempting to build CordovaDeploy.exe..."); - - //Build CordovaDeploy.exe - if(fso.FolderExists(ROOT + '\\tooling') && fso.FolderExists(ROOT + CORDOVA_DEPLOY) && - fso.FileExists(ROOT + CORDOVA_DEPLOY + '\\CordovaDeploy.sln')) - { - // delete any previously generated files - if(fso.FolderExists(ROOT + CORDOVA_DEPLOY + "\\CordovaDeploy\\obj")) - { - fso.DeleteFolder(ROOT + CORDOVA_DEPLOY + "\\CordovaDeploy\\obj"); - } - if(fso.FolderExists(ROOT + CORDOVA_DEPLOY + "\\CordovaDeploy\\Bin")) - { - fso.DeleteFolder(ROOT + CORDOVA_DEPLOY + "\\CordovaDeploy\\Bin"); - } - exec_verbose('msbuild ' + ROOT + CORDOVA_DEPLOY + '\\CordovaDeploy.sln'); - - if(fso.FileExists(ROOT + CORDOVA_DEPLOY_EXE)) - { - WScript.StdOut.WriteLine("MSBUILD COMPLETE, SUCCESS."); - return true; - } - else - { - WScript.StdOut.WriteLine("MSBUILD FAILED TO COMPILE CordovaDeploy.exe"); - return false; - } - } - else - { - return false; - } -} - -//TODO: Output errors from CordovaDeploy so user can troubleshoot problems - -// builds and launches project on device -function debug(path) -{ - if(cordovaDeploy() && fso.FileExists(ROOT + CORDOVA_DEPLOY_EXE)) - { - build_xap(path); - WScript.StdOut.WriteLine('Deploying to device ...'); - exec_verbose('%comspec% /c ' + ROOT + CORDOVA_DEPLOY_EXE + ' ' + path + ' -d:0'); - } - else - { - WScript.StdOut.WriteLine("Error: Failed to find/build CordovaDeploy.exe"); - WScript.StdOut.WriteLine("DEPLOY FAILED."); - WScript.Quit(1); - } -} - -// builds and launches project on emulator -function emulate(path) -{ - if(cordovaDeploy() && fso.FileExists(ROOT + CORDOVA_DEPLOY_EXE)) - { - build_xap(path); - WScript.StdOut.WriteLine('Deploying to emulator ...'); - exec_verbose('%comspec% /c ' + ROOT + CORDOVA_DEPLOY_EXE + ' ' + path + ' -d:1'); - } - else - { - WScript.StdOut.WriteLine("Error: Failed to find/build CordovaDeploy.exe"); - WScript.StdOut.WriteLine("DEPLOY FAILED."); - WScript.Quit(1); - } -} - - -var project_path; -WScript.StdOut.WriteLine(""); - -if(args.Count() > 0) -{ - // support help flags - if(args(0) == "--help" || args(0) == "/?" || - args(0) == "help" || args(0) == "-help" || args(0) == "/help") - { - Usage(); - WScript.Quit(1); - } - else if(args.Count() > 2) - { - WScript.StdOut.WriteLine("Error: Too many arguments."); - Usage(); - WScript.Quit(1); - } - else if(fso.FolderExists(args(0))) - { - if(args.Count() > 1) - { - if(args(1) == "-emulate" || args(1) == "-e") - { - emulate(args(0)); - } - else if(args(1) == "-debug" || args(1) == "-d") - { - debug(args(0)); - } - else - { - WScript.StdOut.WriteLine("Error: \"" + arg(1) + "\" is not recognized as a deploy option"); - Usage(); - WScript.Quit(1); - } - } - else - { - WScript.StdOut.WriteLine("WARNING: Debug/Emulate not specified, defaulting to emulate..."); - emulate(args(0)); - } - } - else - { - WScript.StdOut.WriteLine("Error: Project directory not found,"); - WScript.StdOut.WriteLine("please ensure you give the path to your project."); - Usage(); - WScript.Quit(1); - } -} -else -{ - Usage(); - WScript.Quit(1); -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/dist.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/dist.js b/tooling/scripts/dist.js index 448a2a5..384912e 100644 --- a/tooling/scripts/dist.js +++ b/tooling/scripts/dist.js @@ -66,10 +66,11 @@ function Log(msg) { function Usage() { Log(""); - Log("This is a command line tool for building new releases.") - Log("Usage: dist "); - Log("Creates and packages a new cordova/wp8 project, reversioning"); - Log("it to match the VERSION file in the root directory."); + Log("This is a command line tool for building new releases. It will package a new release"); + Log(" of a cordova-wp8 project, reversioning it to match the VERSION file in the root directory."); + Log("Usage: dist [ | -f ] "); + Log(" -f : force tool to reversion the current repositoy."); + Log(" : path to create the new reversioned repositoy in."); Log(""); } @@ -96,7 +97,7 @@ function read(filename) { function exec(command) { Log("Command: " + command); var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { //Wait a little bit so we're not super looping WScript.sleep(100); //Print any stdout output from the script @@ -108,8 +109,8 @@ function exec(command) { //Check to make sure our scripts did not encounter an error if(!oShell.StdErr.AtEndOfStream) { - var line = oShell.StdErr.ReadAll(); - WScript.StdErr.WriteLine(line); + var err_line = oShell.StdErr.ReadAll(); + WScript.StdErr.WriteLine(err_line); WScript.StdErr.WriteLine("ERROR: Could not complete distribution, failed while running: " + current_script); WScript.Quit(1); } @@ -133,7 +134,11 @@ if(REPLACE) } else if(args.Count() > 0) { - BUILD_DESTINATION = args(0); + if(args(0) == '-f') { + REPLACE = true; + } else { + BUILD_DESTINATION = args(0); + } //Support help flags if(BUILD_DESTINATION.indexOf("--help") > -1 || BUILD_DESTINATION.indexOf("/?") > -1 ) @@ -154,9 +159,11 @@ else /*************************************************/ /** - Copy source code to new directory **/ /*************************************************/ -current_script = "new.js"; -//exec('cscript ' + ROOT + SCRIPTS + '\\new.js ' + BUILD_DESTINATION + ' //nologo'); -space(); +if (!REPLACE) { + current_script = "new.js"; + exec('cscript ' + ROOT + SCRIPTS + '\\new.js ' + BUILD_DESTINATION + ' //nologo'); + space(); +} /*************************************************/ /****************** Step 2 *********************/ http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/emulate.bat ---------------------------------------------------------------------- diff --git a/tooling/scripts/emulate.bat b/tooling/scripts/emulate.bat deleted file mode 100644 index f6e76cf..0000000 --- a/tooling/scripts/emulate.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -cscript "%~dp0\deploy.js" %1 -emulate //nologo \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/new.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/new.js b/tooling/scripts/new.js index 1aea3da..7462965 100644 --- a/tooling/scripts/new.js +++ b/tooling/scripts/new.js @@ -69,7 +69,7 @@ function read(filename) { // executes a commmand in the shell function exec(command) { var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { WScript.sleep(100); } } http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/package.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/package.js b/tooling/scripts/package.js index 391564d..57a7340 100644 --- a/tooling/scripts/package.js +++ b/tooling/scripts/package.js @@ -28,9 +28,6 @@ var args = WScript.Arguments, TEMPLATES_PATH = '\\templates', // sub folder for standalone project STANDALONE_PATH = TEMPLATES_PATH + '\\standalone', - // sub folder for full project - //FULL_PATH = TEMPLATES_PATH + '\\full', -// CUSTOM_PATH = TEMPLATES_PATH + '\\custom', // sub folder containing framework FRAMEWORK_PATH = '\\framework', // subfolder containing example project @@ -43,6 +40,8 @@ var args = WScript.Arguments, var BUILD_DESTINATION; // add templates to visual studio? var ADD_TO_VS = false; +// build the dll? +var BUILD_DLL = false; function Log(msg) { WScript.StdOut.WriteLine(msg); } @@ -79,16 +78,16 @@ function read(filename) { // executes a commmand in the shell function exec(command) { var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { WScript.sleep(100); } } // executes a commmand in the shell function exec_verbose(command) { - //Log("Command: " + command); + Log("Command: " + command); var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { //Wait a little bit so we're not super looping WScript.sleep(100); //Print any stdout output from the script @@ -100,8 +99,8 @@ function exec_verbose(command) { //Check to make sure our scripts did not encounter an error if(!oShell.StdErr.AtEndOfStream) { - var line = oShell.StdErr.ReadAll(); - WScript.StdErr.WriteLine(line); + var err_line = oShell.StdErr.ReadAll(); + WScript.StdErr.WriteLine(err_line); WScript.Quit(1); } } @@ -111,45 +110,18 @@ function package_templates() { Log("Creating template .zip files ..."); - var standalone_zip = BUILD_DESTINATION + '\\CordovaWP8_' + VERSION.replace(/\./g, '_') + '_StandAlone.zip'; - //var full_zip = BUILD_DESTINATION + '\\CordovaWP8_' + VERSION.replace(/\./g, '_') + '_Full.zip'; - //var custom_zip = BUILD_DESTINATION + '\\CordovaWP8_' + VERSION.replace(/\./g, '_') + '_Custom.zip'; - if(fso.FileExists(standalone_zip)) + var template_path = BUILD_DESTINATION + '\\CordovaWP8_' + VERSION.replace(/\./g, '_') + '.zip'; + if(fso.FileExists(template_path)) { - fso.DeleteFile(standalone_zip); + fso.DeleteFile(template_path); } - // if(fso.FileExists(full_zip)) - // { - // fso.DeleteFile(full_zip); - // } - - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateFull.vstemplate ' + BUILD_DESTINATION + FULL_PATH + '\\MyTemplate.vstemplate'); - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\pg_templateIcon.png ' + BUILD_DESTINATION + FULL_PATH + '\\__TemplateIcon.png'); - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\pg_templatePreview.jpg ' + BUILD_DESTINATION + FULL_PATH + '\\__PreviewImage.jpg'); - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + '\\VERSION ' + BUILD_DESTINATION + FULL_PATH); - // if(fso.FileExists(BUILD_DESTINATION + FRAMEWORK_PATH + '\\Bin\\Release\\WPCordovaClassLib.dll')) - // { - // exec('%comspec% /c /Y copy Bin\\Release\\WPCordovaClassLib.dll ' + BUILD_DESTINATION + FULL_PATH + '\\CordovaLib'); - // } - // else - // { - // Log("WARNING: WPCordovaClassLib.dll No found! Trying to build dll."); - // build_dll(); - // } exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateStandAlone.vstemplate ' + BUILD_DESTINATION + STANDALONE_PATH + '\\MyTemplate.vstemplate'); exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\pg_templateIcon.png ' + BUILD_DESTINATION + STANDALONE_PATH + '\\__TemplateIcon.png'); exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\pg_templatePreview.jpg ' + BUILD_DESTINATION + STANDALONE_PATH + '\\__PreviewImage.jpg'); exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + '\\VERSION ' + BUILD_DESTINATION + STANDALONE_PATH); - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateCustom.vstemplate ' + BUILD_DESTINATION + CUSTOM_PATH + '\\MyTemplate.vstemplate'); - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\pg_templateIcon.png ' + BUILD_DESTINATION + CUSTOM_PATH + '\\__TemplateIcon.png'); - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\pg_templatePreview.jpg ' + BUILD_DESTINATION + CUSTOM_PATH + '\\__PreviewImage.jpg'); - // exec('%comspec% /c copy /Y ' + BUILD_DESTINATION + '\\VERSION ' + BUILD_DESTINATION + CUSTOM_PATH); - - //exec('cscript ' + BUILD_DESTINATION + '\\tooling\\scripts\\win-zip.js ' + full_zip + ' ' + BUILD_DESTINATION + FULL_PATH + '\\'); - exec('cscript ' + BUILD_DESTINATION + '\\tooling\\scripts\\win-zip.js ' + standalone_zip + ' ' + BUILD_DESTINATION + STANDALONE_PATH + '\\'); - //exec('cscript ' + BUILD_DESTINATION + '\\tooling\\scripts\\win-zip.js ' + custom_zip + ' ' + BUILD_DESTINATION + CUSTOM_PATH + '\\'); + exec_verbose('cscript ' + BUILD_DESTINATION + '\\tooling\\scripts\\win-zip.js ' + template_path + ' ' + BUILD_DESTINATION + STANDALONE_PATH + '\\'); if(ADD_TO_VS) @@ -158,13 +130,11 @@ function package_templates() if(fso.FolderExists(template_dir )) { dest = shell.NameSpace(template_dir); - dest.CopyHere(standalone_zip, 4|20); - dest.CopyHere(full_zip, 4|20); - dest.CopyHere(custom_zip, 4|20); + dest.CopyHere(template_path, 4|20); } else { - Log("WARNING: Could not find template directory in Visual Studio,\n you can manually copy over the template .zip files.") + Log("WARNING: Could not find template directory in Visual Studio,\n you can manually copy over the template .zip files."); } } } @@ -184,45 +154,21 @@ function build_dll() WScript.Quit(1); } - // if(!fso.FolderExists(BUILD_DESTINATION + FULL_PATH + '\\CordovaLib')) - // { - // fso.CreateFolder(BUILD_DESTINATION + FULL_PATH + '\\CordovaLib'); - // } - // exec('%comspec% /c copy Bin\\Release\\WPCordovaClassLib.dll ' + BUILD_DESTINATION + FULL_PATH + '\\CordovaLib'); - Log("SUCESS"); } // delete any unnessisary files when finished function cleanUp() { - // if(fso.FileExists(BUILD_DESTINATION + FULL_PATH + '\\MyTemplate.vstemplate')) { - // fso.DeleteFile(BUILD_DESTINATION + FULL_PATH + '\\MyTemplate.vstemplate'); - // } if(fso.FileExists(BUILD_DESTINATION + STANDALONE_PATH + '\\MyTemplate.vstemplate')) { fso.DeleteFile(BUILD_DESTINATION + STANDALONE_PATH + '\\MyTemplate.vstemplate'); } - // if(fso.FileExists(BUILD_DESTINATION + CUSTOM_PATH + '\\MyTemplate.vstemplate')) { - // fso.DeleteFile(BUILD_DESTINATION + CUSTOM_PATH + '\\MyTemplate.vstemplate'); - // } - // if(fso.FileExists(BUILD_DESTINATION + FULL_PATH + '\\__PreviewImage.jpg')) { - // fso.DeleteFile(BUILD_DESTINATION + FULL_PATH + '\\__PreviewImage.jpg'); - // } - // if(fso.FileExists(BUILD_DESTINATION + FULL_PATH + '\\__TemplateIcon.png')) { - // fso.DeleteFile(BUILD_DESTINATION + FULL_PATH + '\\__TemplateIcon.png'); - // } if(fso.FileExists(BUILD_DESTINATION + STANDALONE_PATH + '\\__PreviewImage.jpg')) { fso.DeleteFile(BUILD_DESTINATION + STANDALONE_PATH + '\\__PreviewImage.jpg'); } if(fso.FileExists(BUILD_DESTINATION + STANDALONE_PATH + '\\__TemplateIcon.png')) { fso.DeleteFile(BUILD_DESTINATION + STANDALONE_PATH + '\\__TemplateIcon.png'); } - // if(fso.FileExists(BUILD_DESTINATION + CUSTOM_PATH + '\\__PreviewImage.jpg')) { - // fso.DeleteFile(BUILD_DESTINATION + CUSTOM_PATH + '\\__PreviewImage.jpg'); - // } - // if(fso.FileExists(BUILD_DESTINATION + CUSTOM_PATH + '\\__TemplateIcon.png')) { - // fso.DeleteFile(BUILD_DESTINATION + CUSTOM_PATH + '\\__TemplateIcon.png'); - // } //Add any other cleanup here } @@ -257,7 +203,10 @@ else } // build dll for full template -//build_dll(); +if (BUILD_DLL) { + build_dll(); +} + // build/package the templates package_templates(BUILD_DESTINATION); http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/reversion.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/reversion.js b/tooling/scripts/reversion.js index 06563db..a726817 100644 --- a/tooling/scripts/reversion.js +++ b/tooling/scripts/reversion.js @@ -36,10 +36,6 @@ var args = WScript.Arguments, TEMPLATES_PATH = '\\templates', //Sub folder for standalone project STANDALONE_PATH = TEMPLATES_PATH + '\\standalone', - //Sub folder for full project - FULL_PATH = TEMPLATES_PATH + '\\full', - //Sub folder for custom project - CUSTOM_PATH = TEMPLATES_PATH + '\\custom', //Sub folder containing framework FRAMEWORK_PATH = '\\framework', //Subfolder containing example project @@ -105,7 +101,7 @@ function replaceInFile(filename, regexp, replacement) { // executes a commmand in the shell function exec(command) { var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { WScript.sleep(100); } } @@ -114,7 +110,7 @@ function exec(command) { function exec_verbose(command) { //WScript.StdOut.WriteLine("Command: " + command); var oShell=wscript_shell.Exec(command); - while (oShell.Status == 0) { + while (oShell.Status === 0) { //Wait a little bit so we're not super looping WScript.sleep(100); //Print any stdout output from the script @@ -126,15 +122,15 @@ function exec_verbose(command) { //Check to make sure our scripts did not encounter an error if(!oShell.StdErr.AtEndOfStream) { - var line = oShell.StdErr.ReadAll(); - WScript.StdErr.WriteLine(line); + var err_line = oShell.StdErr.ReadAll(); + WScript.StdErr.WriteLine(err_line); WScript.Quit(1); } } function updateVersionNumbers() { WScript.StdOut.WriteLine("Updating version numbers...."); - var version_regex = /(\d+)[.](\d+)[.](\d+)(rc\d)?/ + var version_regex = /(\d+)[.](\d+)[.](\d+)(rc\d)?/; replaceInFile(BUILD_DESTINATION + '\\VERSION', version_regex, VERSION); // replace assembaly versions in framework var framework_regex = /Description\(\"(\d+)[.](\d+)[.](\d+)(rc\d)?\"\)\]/; //Will match ("x.x.x[rcx]")] @@ -152,18 +148,6 @@ function updateVersionNumbers() { WScript.StdOut.WriteLine("path = " + BUILD_DESTINATION + CORDOVA_LIB + '\\Plugins\\Device.cs'); replaceInFile(BUILD_DESTINATION + CORDOVA_LIB + '\\..\\Plugins\\Device.cs', version_regex, "return \"" + VERSION); - // update full project - // exec('%comspec% /c copy /Y /V ' + BUILD_DESTINATION + "\\VERSION " + BUILD_DESTINATION + FULL_PATH + "\\VERSION"); - // replaceInFile(BUILD_DESTINATION + FULL_PATH + '\\CordovaAppProj.csproj', cordova_regex, "cordova-" + VERSION); - // replaceInFile(BUILD_DESTINATION + FULL_PATH + '\\www\\index.html', cordova_regex, "cordova-" + VERSION); - // version_regex = /\"WPCordovaClassLib\,\s*Version\=(\d+)[.](\d+)[.](\d+)[.](\d+)/; //Matches "WPCordovaClassLib, Version=x.x.x.x - // replaceInFile(BUILD_DESTINATION + FULL_PATH + '\\CordovaAppProj.csproj', version_regex, "\"WPCordovaClassLib, Version=" + BASE_VERSION); - - // update custom project - // exec('%comspec% /c copy /Y /V ' + BUILD_DESTINATION + "\\VERSION " + BUILD_DESTINATION + CUSTOM_PATH + "\\VERSION"); - // replaceInFile(BUILD_DESTINATION + CUSTOM_PATH + '\\CordovaAppProj.csproj', cordova_regex, "cordova-" + VERSION); - // replaceInFile(BUILD_DESTINATION + CUSTOM_PATH + '\\www\\index.html', cordova_regex, "cordova-" + VERSION); - // update example proj replaceInFile(BUILD_DESTINATION + EXAMPLE_PATH + '\\CordovaExample.csproj', cordova_regex, "cordova-" + VERSION); version_regex = /VERSION\s*\=\s*\'(\d+)[.](\d+)[.](\d+)(rc\d)?/; //Matches VERSION = x.x.x[rcx] @@ -174,19 +158,12 @@ function updateVersionNumbers() { replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\description.txt', version_regex, "Cordova " + VERSION + " Windows"); // update .vstemplate files for the template zips. - var name_regex = /CordovaWP8[_](\d+)[_](\d+)[_](\d+)(rc\d)?/g - var discript_regex = /Cordova\s*(\d+)[.](\d+)[.](\d+)(rc\d)?/ - // replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateFull.vstemplate', name_regex, 'CordovaWP8_' + VERSION.replace(/\./g, '_')); - // replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateFull.vstemplate', discript_regex, "Cordova " + VERSION); - // replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateFull.vstemplate', cordova_regex, "cordova-" + VERSION); + var name_regex = /CordovaWP8[_](\d+)[_](\d+)[_](\d+)(rc\d)?/g; + var discript_regex = /Cordova\s*(\d+)[.](\d+)[.](\d+)(rc\d)?/; replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateStandAlone.vstemplate', name_regex, 'CordovaWP8_' + VERSION.replace(/\./g, '_')); replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateStandAlone.vstemplate', discript_regex, "Cordova " + VERSION); replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateStandAlone.vstemplate', cordova_regex, "cordova-" + VERSION); - - // replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateCustom.vstemplate', name_regex, 'CordovaWP8_' + VERSION.replace(/\./g, '_')); - // replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateCustom.vstemplate', discript_regex, "Cordova " + VERSION); - // replaceInFile(BUILD_DESTINATION + TEMPLATES_PATH + '\\vs\\MyTemplateCustom.vstemplate', cordova_regex, "cordova-" + VERSION); } // delete all cordova.js and generated files (templates) from old version numbers @@ -198,11 +175,6 @@ function cleanup() { fso.DeleteFile(BUILD_DESTINATION + '\\*.zip'); } - // remove old .dll from full template and framework - if(fso.FileExists(BUILD_DESTINATION + FULL_PATH+ '\\CordovaLib\\WPCordovaClassLib.dll')) - { - fso.DeleteFile(BUILD_DESTINATION + FULL_PATH+ '\\CordovaLib\\WPCordovaClassLib.dll'); - } // remove any generated framework files if(fso.FolderExists(BUILD_DESTINATION + FRAMEWORK_PATH + '\\Bin')) { @@ -226,70 +198,29 @@ function cleanup() var root_folder = shell.NameSpace(BUILD_DESTINATION + '\\').Items(); for(var i = 0; i < root_folder.Count; i++) { - if(root_folder.Item(i).Name.match(/CordovaWP8[_](\d+)[_](\d+)[_](\d+)(rc\d)?[_]/)) + if(root_folder.Item(i).Name.match(/CordovaWP8[_](\d+)[_](\d+)[_](\d+)(rc\d)?/)) { fso.DeleteFile(BUILD_DESTINATION + '\\' + root_folder.Item(i).Name); } } // remove old cordova.js var example_www = shell.NameSpace(BUILD_DESTINATION + EXAMPLE_PATH + '\\www').Items(); - for(var i = 0; i < example_www.Count; i++) + for(i = 0; i < example_www.Count; i++) { - if(example_www.Item(i).Name.match(/cordova[-](\d+)[.](\d+)[.](\d+)(rc\d)?[.]js/)) + if(example_www.Item(i).Name.match(/cordova\-(\d+)[.](\d+)[.](\d+)(rc\d)?[.]js/)) { fso.DeleteFile(BUILD_DESTINATION + EXAMPLE_PATH + '\\www\\' + example_www.Item(i).Name); } } - // var full_www = shell.NameSpace(BUILD_DESTINATION + FULL_PATH + '\\www').Items(); - // for(var i = 0; i < full_www.Count; i++) - // { - // if(full_www.Item(i).Name.match(/cordova[-](\d+)[.](\d+)[.](\d+)(rc\d)?[.]js/)) - // { - // fso.DeleteFile(BUILD_DESTINATION + FULL_PATH + '\\www\\' + full_www.Item(i).Name); - // } - // } + var standalone_www = shell.NameSpace(BUILD_DESTINATION + STANDALONE_PATH + '\\www').Items(); - for(var i = 0; i < standalone_www.Count; i++) + for(i = 0; i < standalone_www.Count; i++) { - if(standalone_www.Item(i).Name.match(/cordova[-](\d+)[.](\d+)[.](\d+)(rc\d)?[.]js/)) + if(standalone_www.Item(i).Name.match(/cordova\-(\d+)[.](\d+)[.](\d+)(rc\d)?[.]js/)) { fso.DeleteFile(BUILD_DESTINATION + STANDALONE_PATH + '\\www\\' + standalone_www.Item(i).Name); } } - // var custom_www = shell.NameSpace(BUILD_DESTINATION + CUSTOM_PATH + '\\www').Items(); - // for(var i = 0; i < standalone_www.Count; i++) - // { - // if(custom_www.Item(i).Name.match(/cordova[-](\d+)[.](\d+)[.](\d+)(rc\d)?[.]js/)) - // { - // fso.DeleteFile(BUILD_DESTINATION + CUSTOM_PATH + '\\www\\' + custom_www.Item(i).Name); - // } - // } -} - -// builds the new cordova dll and copys it to the full template (only done because of the version referance in Device.cs) -function build_dll() -{ - return; - - WScript.StdOut.WriteLine("Packaging .dll ..."); - // move to framework directory - wscript_shell.CurrentDirectory = BUILD_DESTINATION + FRAMEWORK_PATH; - // build .dll in Release - exec_verbose('msbuild /p:Configuration=Release;VersionNumber=' + VERSION + ';BaseVersionNumber=' + BASE_VERSION); - //Check if file dll was created - if(!fso.FileExists(BUILD_DESTINATION + FRAMEWORK_PATH + '\\Bin\\Release\\WPCordovaClassLib.dll')) - { - WScript.StdErr.WriteLine('ERROR: MSBuild failed to create .dll when reversioning cordova-wp7.'); - WScript.Quit(1); - } - - if(!fso.FolderExists(BUILD_DESTINATION + FULL_PATH + '\\CordovaLib')) - { - fso.CreateFolder(BUILD_DESTINATION + FULL_PATH + '\\CordovaLib'); - } - exec('%comspec% /c copy Bin\\Release\\WPCordovaClassLib.dll ' + BUILD_DESTINATION + FULL_PATH + '\\CordovaLib'); - - WScript.StdOut.WriteLine("SUCESS"); } @@ -333,14 +264,11 @@ if(args.Count() > 0) cleanup(); // update version numbers updateVersionNumbers(); - // build dll for full - build_dll(); - } else { WScript.StdOut.WriteLine("The version number is invalid, please provide"); - WScript.StdOut.WriteLine(" a version number in the format Major.Minor.Fix[rc#]") + WScript.StdOut.WriteLine(" a version number in the format Major.Minor.Fix[rc#]"); Usage(); WScript.Quit(1); } http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/964ee3e5/tooling/scripts/win-zip.js ---------------------------------------------------------------------- diff --git a/tooling/scripts/win-zip.js b/tooling/scripts/win-zip.js index 6790a45..7a79f43 100644 --- a/tooling/scripts/win-zip.js +++ b/tooling/scripts/win-zip.js @@ -23,9 +23,8 @@ file.Close(); var objShell = new ActiveXObject("shell.application"); var zipFolder = objShell.NameSpace(zipPath); var sourceItems = objShell.NameSpace(sourcePath).items(); -WScript.StdOut.WriteLine("sourceItems = " + sourceItems); -if (zipFolder != null) { - zipFolder.CopyHere(sourceItems, 4|20); +if (zipFolder !== null) { + zipFolder.CopyHere(sourceItems, 4|20|16); var maxTime = 5000; while(zipFolder.items().Count < sourceItems.Count) {