You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/06/27 17:21:24 UTC
[1/2] git commit: Reverted commit e6923ac CB-6976 Add support for
Windows Universal apps (Windows 8.1 and WP 8.1)
Repository: cordova-lib
Updated Branches:
refs/heads/rb_0.21.6 [created] 4732ff010
Reverted commit e6923ac CB-6976 Add support for Windows Universal apps (Windows 8.1 and WP 8.1)
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/17c7465f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/17c7465f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/17c7465f
Branch: refs/heads/rb_0.21.6
Commit: 17c7465f19a37902cce44ea63b8595d12bdab2bc
Parents: 42dfd66
Author: sgrebnov <v-...@microsoft.com>
Authored: Fri Jun 27 11:30:19 2014 +0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri Jun 27 10:55:10 2014 -0400
----------------------------------------------------------------------
.../metadata/windows8_parser.spec.js | 4 +-
.../spec-plugman/platforms/windows8.spec.js | 2 +-
.../src/cordova/metadata/windows8_parser.js | 332 ++++++++++++++++++
.../src/cordova/metadata/windows_parser.js | 349 -------------------
cordova-lib/src/cordova/platform.js | 12 -
cordova-lib/src/cordova/platforms.js | 13 +-
cordova-lib/src/cordova/prepare.js | 7 -
cordova-lib/src/plugman/install.js | 5 -
cordova-lib/src/plugman/platforms.js | 3 +-
cordova-lib/src/plugman/platforms/windows.js | 147 --------
cordova-lib/src/plugman/platforms/windows8.js | 136 ++++++++
cordova-lib/src/plugman/prepare.js | 15 +-
cordova-lib/src/plugman/uninstall.js | 5 -
cordova-lib/src/plugman/util/config-changes.js | 25 --
cordova-lib/src/util/windows/jsproj.js | 15 +-
15 files changed, 482 insertions(+), 588 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js b/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
index 79af143..cb5504a 100644
--- a/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
@@ -74,8 +74,8 @@ describe('windows8 project parser', function() {
it('should create an instance with path, manifest properties', function() {
expect(function() {
var parser = new platforms.windows8.parser(proj);
- expect(parser.projDir).toEqual(proj);
- expect(parser.manifestPath).toEqual(path.join(proj, 'package.appxmanifest'));
+ expect(parser.windows8_proj_dir).toEqual(proj);
+ expect(parser.manifest_path).toEqual(path.join(proj, 'package.appxmanifest'));
}).not.toThrow();
});
});
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/spec-plugman/platforms/windows8.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/windows8.spec.js b/cordova-lib/spec-plugman/platforms/windows8.spec.js
index ee68bd8..6683f74 100644
--- a/cordova-lib/spec-plugman/platforms/windows8.spec.js
+++ b/cordova-lib/spec-plugman/platforms/windows8.spec.js
@@ -16,7 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
-var windows8 = require('../../src/plugman/platforms/windows'),
+var windows8 = require('../../src/plugman/platforms/windows8'),
common = require('../../src/plugman/platforms/common'),
install = require('../../src/plugman/install'),
path = require('path'),
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/cordova/metadata/windows8_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/windows8_parser.js b/cordova-lib/src/cordova/metadata/windows8_parser.js
new file mode 100644
index 0000000..c267f73
--- /dev/null
+++ b/cordova-lib/src/cordova/metadata/windows8_parser.js
@@ -0,0 +1,332 @@
+/**
+ 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.
+*/
+
+/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
+ indent:4, unused:vars, latedef:nofunc, sub:true
+*/
+
+var fs = require('fs'),
+ path = require('path'),
+ util = require('../util'),
+ events = require('../../events'),
+ shell = require('shelljs'),
+ Q = require('q'),
+ child_process = require('child_process'),
+ ConfigParser = require('../../configparser/ConfigParser'),
+ CordovaError = require('../../CordovaError'),
+ xml = require('../../util/xml-helpers'),
+ config = require('../config'),
+ hooker = require('../hooker'),
+ jsproj = require('../../util/windows/jsproj');
+
+module.exports = function windows8_parser(project) {
+ try {
+ // TODO : Check that it's not a windows8 project?
+ var jsproj_file = fs.readdirSync(project).filter(function(e) { return e.match(/\.jsproj$/i); })[0];
+ if (!jsproj_file) throw new CordovaError('No .jsproj file in "'+project+'"');
+ this.windows8_proj_dir = project;
+ this.jsproj_path = path.join(this.windows8_proj_dir, jsproj_file);
+ this.sln_path = path.join(this.windows8_proj_dir, jsproj_file.replace(/\.jsproj/, '.sln'));
+ } catch(e) {
+ throw new CordovaError('The provided path "' + project + '" is not a Windows 8 project. ' + e);
+ }
+ this.manifest_path = path.join(this.windows8_proj_dir, 'package.appxmanifest');
+};
+
+// Returns a promise
+module.exports.check_requirements = function(project_root) {
+ events.emit('log', 'Checking windows8 requirements...');
+ var lib_path = path.join(util.libDirectory, 'windows8', 'cordova',
+ require('../platforms').windows8.version, 'windows8');
+
+ var custom_path = config.has_custom_path(project_root, 'windows8');
+ if (custom_path) {
+ lib_path = path.join(custom_path, 'windows8');
+ }
+ var command = '"' + path.join(lib_path, 'bin', 'check_reqs') + '"';
+ events.emit('verbose', 'Running "' + command + '" (output to follow)');
+ var d = Q.defer();
+
+ child_process.exec(command, function(err, output, stderr) {
+ events.emit('verbose', output);
+ if (err) {
+ d.reject(new CordovaError('Requirements check failed: ' + output + stderr));
+ } else {
+ d.resolve();
+ }
+ });
+ return d.promise;
+};
+
+module.exports.prototype = {
+
+ update_from_config:function(config) {
+
+ //check config parser
+ if (config instanceof ConfigParser) {
+ } else throw new Error('update_from_config requires a ConfigParser object');
+
+ //Get manifest file
+ var manifest = xml.parseElementtreeSync(this.manifest_path);
+
+ var version = this.fixConfigVersion(config.version());
+ var name = config.name();
+ var pkgName = config.packageName();
+ var author = config.author();
+
+ var identityNode = manifest.find('.//Identity');
+ if(identityNode) {
+ // Update app name in identity
+ var appIdName = identityNode['attrib']['Name'];
+ if (appIdName != pkgName) {
+ identityNode['attrib']['Name'] = pkgName;
+ }
+
+ // Update app version
+ var appVersion = identityNode['attrib']['Version'];
+ if(appVersion != version) {
+ identityNode['attrib']['Version'] = version;
+ }
+ }
+
+ // Update name (windows8 has it in the Application[@Id] and Application.VisualElements[@DisplayName])
+ var app = manifest.find('.//Application');
+ if(app) {
+
+ var appId = app['attrib']['Id'];
+
+ if (appId != pkgName) {
+ app['attrib']['Id'] = pkgName;
+ }
+
+ var visualElems = manifest.find('.//VisualElements') || manifest.find('.//m2:VisualElements');
+
+ if(visualElems) {
+ var displayName = visualElems['attrib']['DisplayName'];
+ if(displayName != name) {
+ visualElems['attrib']['DisplayName'] = name;
+ }
+ }
+ else {
+ throw new Error('update_from_config expected a valid package.appxmanifest' +
+ ' with a <VisualElements> node');
+ }
+ }
+ else {
+ throw new Error('update_from_config expected a valid package.appxmanifest' +
+ ' with a <Application> node');
+ }
+
+ // Update properties
+ var properties = manifest.find('.//Properties');
+ if (properties && properties.find) {
+ var displayNameElement = properties.find('.//DisplayName');
+ if (displayNameElement && displayNameElement.text != name) {
+ displayNameElement.text = name;
+ }
+
+ var publisherNameElement = properties.find('.//PublisherDisplayName');
+ if (publisherNameElement && publisherNameElement.text != author) {
+ publisherNameElement.text = author;
+ }
+ }
+
+ // sort Capability elements as per CB-5350 Windows8 build fails due to invalid 'Capabilities' definition
+ // to sort elements we remove them and then add again in the appropriate order
+ var capabilitiesRoot = manifest.find('.//Capabilities'),
+ capabilities = capabilitiesRoot._children || [];
+
+ capabilities.forEach(function(elem){
+ capabilitiesRoot.remove(0, elem);
+ });
+ capabilities.sort(function(a, b) {
+ return (a.tag > b.tag)? 1: -1;
+ });
+ capabilities.forEach(function(elem){
+ capabilitiesRoot.append(elem);
+ });
+
+ //Write out manifest
+ fs.writeFileSync(this.manifest_path, manifest.write({indent: 4}), 'utf-8');
+
+ // Update icons
+ var icons = config.getIcons('windows8');
+ var platformRoot = this.windows8_proj_dir;
+ var appRoot = util.isCordova(platformRoot);
+
+ // Icons, that should be added to platform
+ var platformIcons = [
+ {dest: 'images/logo.png', width: 150, height: 150},
+ {dest: 'images/smalllogo.png', width: 30, height: 30},
+ {dest: 'images/storelogo.png', width: 50, height: 50},
+ ];
+
+ platformIcons.forEach(function (item) {
+ var icon = icons.getBySize(item.width, item.height) || icons.getDefault();
+ if (icon){
+ var src = path.join(appRoot, icon.src),
+ dest = path.join(platformRoot, item.dest);
+ events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
+ shell.cp('-f', src, dest);
+ }
+ });
+
+ // Update splashscreen
+ // Image size for Windows 8 should be 620 x 300 px
+ // See http://msdn.microsoft.com/en-us/library/windows/apps/hh465338.aspx for reference
+ var splash = config.getSplashScreens('windows8').getBySize(620, 300);
+ if (splash){
+ var src = path.join(appRoot, splash.src),
+ dest = path.join(platformRoot, 'images/splashscreen.png');
+ events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
+ shell.cp('-f', src, dest);
+ }
+ },
+
+ // Returns the platform-specific www directory.
+ www_dir:function() {
+ return path.join(this.windows8_proj_dir, 'www');
+ },
+ config_xml:function() {
+ return path.join(this.windows8_proj_dir,'config.xml');
+ },
+ // copy files from merges directory to actual www dir
+ copy_merges:function(merges_sub_path) {
+ var merges_path = path.join(util.appDir(util.isCordova(this.windows8_proj_dir)), 'merges', merges_sub_path);
+ if (fs.existsSync(merges_path)) {
+ var overrides = path.join(merges_path, '*');
+ shell.cp('-rf', overrides, this.www_dir());
+ }
+ },
+
+ // Used for creating platform_www in projects created by older versions.
+ cordovajs_path:function(libDir) {
+ var jsPath = path.join(libDir, 'template', 'www', 'cordova.js');
+ return path.resolve(jsPath);
+ },
+
+ // Replace the www dir with contents of platform_www and app www and updates the csproj file.
+ update_www:function() {
+ var projectRoot = util.isCordova(this.windows8_proj_dir);
+ var app_www = util.projectWww(projectRoot);
+ var platform_www = path.join(this.windows8_proj_dir, 'platform_www');
+
+ // Clear the www dir
+ shell.rm('-rf', this.www_dir());
+ shell.mkdir(this.www_dir());
+ // Copy over all app www assets
+ shell.cp('-rf', path.join(app_www, '*'), this.www_dir());
+
+ // Copy all files from merges directory.
+ this.copy_merges('windows8');
+
+ // Copy over stock platform www assets (cordova.js)
+ shell.cp('-rf', path.join(platform_www, '*'), this.www_dir());
+ },
+
+ // updates the jsproj file to explicitly list all www content.
+ update_jsproj:function() {
+ var projFile = new jsproj(this.jsproj_path);
+
+ // remove any previous references to the www files
+ projFile.removeSourceFile(new RegExp('www\\\\*', 'i'));
+
+ // now add all www references back in from the root www folder
+ var www_files = this.folder_contents('www', this.www_dir());
+ for(var file in www_files) {
+ projFile.addSourceFile(www_files[file]);
+ }
+ // save file
+ projFile.write();
+ },
+ // Returns an array of all the files in the given directory with relative paths
+ // - name : the name of the top level directory (i.e all files will start with this in their path)
+ // - dir : the directory whos contents will be listed under 'name' directory
+ folder_contents:function(name, dir) {
+ var results = [];
+ var folder_dir = fs.readdirSync(dir);
+ for(var item in folder_dir) {
+ var stat = fs.statSync(path.join(dir, folder_dir[item]));
+ // Add all subfolder item paths if it's not a .svn dir.
+ if( stat.isDirectory() && (folder_dir[item] !== '.svn') ) {
+ var sub_dir = this.folder_contents(path.join(name, folder_dir[item]), path.join(dir, folder_dir[item]));
+ for(var sub_item in sub_dir) {
+ results.push(sub_dir[sub_item]);
+ }
+ } else if(stat.isFile()) {
+ results.push(path.join(name, folder_dir[item]));
+ }
+ // else { it is a FIFO, or a Socket, Symbolic Link or something ... }
+ }
+ return results;
+ },
+
+ // calls the nessesary functions to update the windows8 project
+ update_project:function(cfg) {
+ //console.log("Updating windows8 project...");
+
+ try {
+ this.update_from_config(cfg);
+ } catch(e) {
+ return Q.reject(e);
+ }
+
+ var that = this;
+ var projectRoot = util.isCordova(process.cwd());
+
+ var hooks = new hooker(projectRoot);
+ return hooks.fire('pre_package', { wwwPath:this.www_dir(), platforms: ['windows8'] })
+ .then(function() {
+ // overrides (merges) are handled in update_www()
+ that.update_jsproj();
+ that.add_bom();
+ util.deleteSvnFolders(that.www_dir());
+ });
+ },
+
+ // Adjust version number as per CB-5337 Windows8 build fails due to invalid app version
+ fixConfigVersion: function (version) {
+ if(version && version.match(/\.\d/g)) {
+ var numVersionComponents = version.match(/\.\d/g).length + 1;
+ while (numVersionComponents++ < 4) {
+ version += '.0';
+ }
+ }
+ return version;
+ },
+
+ // CB-5421 Add BOM to all html, js, css files to ensure app can pass Windows Store Certification
+ add_bom: function () {
+ var www = this.www_dir();
+ var files = shell.ls('-R', www);
+
+ files.forEach(function (file) {
+ if (!file.match(/\.(js|html|css|json)/)) {
+ return;
+ }
+
+ var filePath = path.join(www, file);
+ var content = fs.readFileSync(filePath);
+
+ if (content[0] !== 0xEF && content[1] !== 0xBE && content[2] !== 0xBB) {
+ fs.writeFileSync(filePath, '\ufeff' + content);
+ }
+ });
+ }
+};
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/cordova/metadata/windows_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/windows_parser.js b/cordova-lib/src/cordova/metadata/windows_parser.js
deleted file mode 100644
index ce08abf..0000000
--- a/cordova-lib/src/cordova/metadata/windows_parser.js
+++ /dev/null
@@ -1,349 +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.
-*/
-
-/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
- indent:4, unused:vars, latedef:nofunc, sub:true
-*/
-
-var fs = require('fs'),
- path = require('path'),
- util = require('../util'),
- events = require('../../events'),
- shell = require('shelljs'),
- Q = require('q'),
- child_process = require('child_process'),
- ConfigParser = require('../../configparser/ConfigParser'),
- CordovaError = require('../../CordovaError'),
- xml = require('../../util/xml-helpers'),
- config = require('../config'),
- hooker = require('../hooker'),
- jsproj = require('../../util/windows/jsproj');
-
-module.exports = function windows_parser(project) {
- try {
- this.isOldProjectTemplate = false;
- // Check that it's a universal windows store project
- var projFile = fs.readdirSync(project).filter(function(e) { return e.match(/\.projitems$/i); })[0];
- if (!projFile) {
- this.isOldProjectTemplate = true;
- projFile = fs.readdirSync(project).filter(function(e) { return e.match(/\.jsproj$/i); })[0];
- }
- if (!projFile) {
- throw new CordovaError('No project file in "'+project+'"');
- }
- this.projDir = project;
- this.projFilePath = path.join(this.projDir, projFile);
-
- if (this.isOldProjectTemplate) {
- this.manifestPath = path.join(this.projDir, 'package.appxmanifest');
- }
-
- } catch(e) {
- throw new CordovaError('The provided path "' + project + '" is not a Windows project. ' + e);
- }
-};
-
-// Returns a promise
-module.exports.check_requirements = function(project_root) {
- events.emit('log', 'Checking windows requirements...');
- var lib_path = path.join(util.libDirectory, 'windows', 'cordova',
- require('../platforms').windows.version, 'windows');
-
- var custom_path = config.has_custom_path(project_root, 'windows8') ||
- config.has_custom_path(project_root, 'windows');
- if (custom_path) {
- lib_path = path.join(custom_path, 'windows');
- }
- var command = '"' + path.join(lib_path, 'bin', 'check_reqs') + '"';
- events.emit('verbose', 'Running "' + command + '" (output to follow)');
- var d = Q.defer();
-
- child_process.exec(command, function(err, output, stderr) {
- events.emit('verbose', output);
- if (err) {
- d.reject(new CordovaError('Requirements check failed: ' + output + stderr));
- } else {
- d.resolve();
- }
- });
- return d.promise;
-};
-
-module.exports.prototype = {
-
- update_from_config:function(config) {
-
- //check config parser
- if (config instanceof ConfigParser) {
- } else throw new Error('update_from_config requires a ConfigParser object');
-
- if (!this.isOldProjectTemplate) {
- return;
- }
-
- // code below is required for compatibility reason. New template version is not required this anymore.
-
- //Get manifest file
- var manifest = xml.parseElementtreeSync(this.manifestPath);
-
- var version = this.fixConfigVersion(config.version());
- var name = config.name();
- var pkgName = config.packageName();
- var author = config.author();
-
- var identityNode = manifest.find('.//Identity');
- if(identityNode) {
- // Update app name in identity
- var appIdName = identityNode['attrib']['Name'];
- if (appIdName != pkgName) {
- identityNode['attrib']['Name'] = pkgName;
- }
-
- // Update app version
- var appVersion = identityNode['attrib']['Version'];
- if(appVersion != version) {
- identityNode['attrib']['Version'] = version;
- }
- }
-
- // Update name (windows8 has it in the Application[@Id] and Application.VisualElements[@DisplayName])
- var app = manifest.find('.//Application');
- if(app) {
-
- var appId = app['attrib']['Id'];
-
- if (appId != pkgName) {
- app['attrib']['Id'] = pkgName;
- }
-
- var visualElems = manifest.find('.//VisualElements') || manifest.find('.//m2:VisualElements');
-
- if(visualElems) {
- var displayName = visualElems['attrib']['DisplayName'];
- if(displayName != name) {
- visualElems['attrib']['DisplayName'] = name;
- }
- }
- else {
- throw new Error('update_from_config expected a valid package.appxmanifest' +
- ' with a <VisualElements> node');
- }
- }
- else {
- throw new Error('update_from_config expected a valid package.appxmanifest' +
- ' with a <Application> node');
- }
-
- // Update properties
- var properties = manifest.find('.//Properties');
- if (properties && properties.find) {
- var displayNameElement = properties.find('.//DisplayName');
- if (displayNameElement && displayNameElement.text != name) {
- displayNameElement.text = name;
- }
-
- var publisherNameElement = properties.find('.//PublisherDisplayName');
- if (publisherNameElement && publisherNameElement.text != author) {
- publisherNameElement.text = author;
- }
- }
-
- // sort Capability elements as per CB-5350 Windows8 build fails due to invalid 'Capabilities' definition
- // to sort elements we remove them and then add again in the appropriate order
- var capabilitiesRoot = manifest.find('.//Capabilities'),
- capabilities = capabilitiesRoot._children || [];
-
- capabilities.forEach(function(elem){
- capabilitiesRoot.remove(0, elem);
- });
- capabilities.sort(function(a, b) {
- return (a.tag > b.tag)? 1: -1;
- });
- capabilities.forEach(function(elem){
- capabilitiesRoot.append(elem);
- });
-
- //Write out manifest
- fs.writeFileSync(this.manifestPath, manifest.write({indent: 4}), 'utf-8');
-
- // Update icons
- var icons = config.getIcons('windows8');
- var platformRoot = this.projDir;
- var appRoot = util.isCordova(platformRoot);
-
- // Icons, that should be added to platform
- var platformIcons = [
- {dest: 'images/logo.png', width: 150, height: 150},
- {dest: 'images/smalllogo.png', width: 30, height: 30},
- {dest: 'images/storelogo.png', width: 50, height: 50},
- ];
-
- platformIcons.forEach(function (item) {
- var icon = icons.getBySize(item.width, item.height) || icons.getDefault();
- if (icon){
- var src = path.join(appRoot, icon.src),
- dest = path.join(platformRoot, item.dest);
- events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
- shell.cp('-f', src, dest);
- }
- });
-
- // Update splashscreen
- // Image size for Windows 8 should be 620 x 300 px
- // See http://msdn.microsoft.com/en-us/library/windows/apps/hh465338.aspx for reference
- var splash = config.getSplashScreens('windows8').getBySize(620, 300);
- if (splash){
- var src = path.join(appRoot, splash.src),
- dest = path.join(platformRoot, 'images/splashscreen.png');
- events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
- shell.cp('-f', src, dest);
- }
- },
-
- // Returns the platform-specific www directory.
- www_dir:function() {
- return path.join(this.projDir, 'www');
- },
- config_xml:function() {
- return path.join(this.projDir,'config.xml');
- },
- // copy files from merges directory to actual www dir
- copy_merges:function(merges_sub_path) {
- var merges_path = path.join(util.appDir(util.isCordova(this.projDir)), 'merges', merges_sub_path);
- if (fs.existsSync(merges_path)) {
- var overrides = path.join(merges_path, '*');
- shell.cp('-rf', overrides, this.www_dir());
- }
- },
-
- // Used for creating platform_www in projects created by older versions.
- cordovajs_path:function(libDir) {
- var jsPath = path.join(libDir, 'template', 'www', 'cordova.js');
- return path.resolve(jsPath);
- },
-
- // Replace the www dir with contents of platform_www and app www and updates the csproj file.
- update_www:function() {
- var projectRoot = util.isCordova(this.projDir);
- var app_www = util.projectWww(projectRoot);
- var platform_www = path.join(this.projDir, 'platform_www');
-
- // Clear the www dir
- shell.rm('-rf', this.www_dir());
- shell.mkdir(this.www_dir());
- // Copy over all app www assets
- shell.cp('-rf', path.join(app_www, '*'), this.www_dir());
-
- // Copy all files from merges directory.
- this.copy_merges('windows8');
-
- // Copy over stock platform www assets (cordova.js)
- shell.cp('-rf', path.join(platform_www, '*'), this.www_dir());
- },
-
- // Returns an array of all the files in the given directory with relative paths
- // - name : the name of the top level directory (i.e all files will start with this in their path)
- // - dir : the directory whos contents will be listed under 'name' directory
- folder_contents:function(name, dir) {
- var results = [];
- var folder_dir = fs.readdirSync(dir);
- for(var item in folder_dir) {
- var stat = fs.statSync(path.join(dir, folder_dir[item]));
- // Add all subfolder item paths if it's not a .svn dir.
- if( stat.isDirectory() && (folder_dir[item] !== '.svn') ) {
- var sub_dir = this.folder_contents(path.join(name, folder_dir[item]), path.join(dir, folder_dir[item]));
- for(var sub_item in sub_dir) {
- results.push(sub_dir[sub_item]);
- }
- } else if(stat.isFile()) {
- results.push(path.join(name, folder_dir[item]));
- }
- // else { it is a FIFO, or a Socket, Symbolic Link or something ... }
- }
- return results;
- },
-
- // updates the jsproj file to explicitly list all www content.
- update_jsproj:function() {
- var projFile = new jsproj(this.projFilePath);
- // remove any previous references to the www files
- projFile.removeSourceFile(/^(\$\(MSBuildThisFileDirectory\))?www\\/i);
-
- // now add all www references back in from the root www folder
- var www_files = this.folder_contents('www', this.www_dir());
- for(var file in www_files) {
- projFile.addSourceFile(www_files[file]);
- }
- // save file
- projFile.write();
- },
-
- // calls the nessesary functions to update the windows8 project
- update_project:function(cfg) {
- // console.log("Updating windows8 project...");
-
- try {
- this.update_from_config(cfg);
- } catch(e) {
- return Q.reject(e);
- }
-
- var that = this;
- var projectRoot = util.isCordova(process.cwd());
-
- var hooks = new hooker(projectRoot);
- return hooks.fire('pre_package', { wwwPath:this.www_dir(), platforms: ['windows8'] })
- .then(function() {
- // overrides (merges) are handled in update_www()
- that.update_jsproj();
- that.add_bom();
- util.deleteSvnFolders(that.www_dir());
- });
- },
-
- // Adjust version number as per CB-5337 Windows8 build fails due to invalid app version
- fixConfigVersion: function (version) {
- if(version && version.match(/\.\d/g)) {
- var numVersionComponents = version.match(/\.\d/g).length + 1;
- while (numVersionComponents++ < 4) {
- version += '.0';
- }
- }
- return version;
- },
-
- // CB-5421 Add BOM to all html, js, css files to ensure app can pass Windows Store Certification
- add_bom: function () {
- var www = this.www_dir();
- var files = shell.ls('-R', www);
-
- files.forEach(function (file) {
- if (!file.match(/\.(js|html|css|json)/)) {
- return;
- }
-
- var filePath = path.join(www, file);
- var content = fs.readFileSync(filePath);
-
- if (content[0] !== 0xEF && content[1] !== 0xBE && content[2] !== 0xBB) {
- fs.writeFileSync(filePath, '\ufeff' + content);
- }
- });
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/cordova/platform.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platform.js b/cordova-lib/src/cordova/platform.js
index be10f92..a8ed4e3 100644
--- a/cordova-lib/src/cordova/platform.js
+++ b/cordova-lib/src/cordova/platform.js
@@ -169,13 +169,6 @@ function update(hooks, projectRoot, targets, opts) {
cordova_util.binname + ' platform list`.';
return Q.reject(new CordovaError(msg));
}
- // CB-6976 Windows Universal Apps. Special case to upgrade from windows8 to windows platform
- if (plat == 'windows8' && !fs.existsSync(path.join(projectRoot, 'platforms', 'windows'))) {
- var platformPathWindows = path.join(projectRoot, 'platforms', 'windows');
- fs.renameSync(platformPath, platformPathWindows);
- plat = 'windows';
- platformPath = platformPathWindows;
- }
// First, lazy_load the latest version.
return hooks.fire('before_platform_update', opts)
@@ -354,11 +347,6 @@ function platform(command, targets, opts) {
switch(command) {
case 'add':
- // CB-6976 Windows Universal Apps. windows8 is now alias for windows
- var idxWindows8 = targets.indexOf('windows8');
- if (idxWindows8 >=0) {
- targets[idxWindows8] = 'windows';
- }
return add(hooks, projectRoot, targets, opts);
case 'rm':
case 'remove':
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/cordova/platforms.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/platforms.js b/cordova-lib/src/cordova/platforms.js
index 9fcfac7..5ada624 100644
--- a/cordova-lib/src/cordova/platforms.js
+++ b/cordova-lib/src/cordova/platforms.js
@@ -69,17 +69,10 @@ module.exports = {
},
'windows8':{
hostos : ['win32'],
- parser: './metadata/windows_parser',
+ parser: './metadata/windows8_parser',
url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-windows.git',
- version: 'master',
- subdirectory: 'windows'
- },
- 'windows':{
- hostos : ['win32'],
- parser: './metadata/windows_parser',
- url : 'https://git-wip-us.apache.org/repos/asf?p=cordova-windows.git',
- version: 'master',
- subdirectory: 'windows'
+ version: '3.5.0',
+ subdirectory: 'windows8'
}
};
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/cordova/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/prepare.js b/cordova-lib/src/cordova/prepare.js
index 0615c97..be48c51 100644
--- a/cordova-lib/src/cordova/prepare.js
+++ b/cordova-lib/src/cordova/prepare.js
@@ -111,13 +111,6 @@ exports = module.exports = function prepare(options) {
// Update platform config.xml based on top level config.xml
var platform_cfg = new ConfigParser(parser.config_xml());
exports._mergeXml(cfg.doc.getroot(), platform_cfg.doc.getroot(), platform, true);
-
- // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
- // we allow using windows8 tag for new windows platform
- if (platform == 'windows') {
- exports._mergeXml(cfg.doc.getroot(), platform_cfg.doc.getroot(), 'windows8', true);
- }
-
platform_cfg.write();
return parser.update_project(cfg);
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/plugman/install.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/install.js b/cordova-lib/src/plugman/install.js
index e17f941..8e6205f 100644
--- a/cordova-lib/src/plugman/install.js
+++ b/cordova-lib/src/plugman/install.js
@@ -510,11 +510,6 @@ function handleInstall(actions, pluginInfo, platform, project_dir, plugins_dir,
var handler = platform_modules[platform];
var platformTag = pluginInfo._et.find('./platform[@name="'+platform+'"]');
- // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
- // we allow using windows8 tag for new windows platform
- if (platform == 'windows' && !platformTag) {
- platformTag = pluginInfo._et.find('platform[@name="' + 'windows8' + '"]');
- }
if ( pluginInfo.hasPlatformSection(platform) ) {
var sourceFiles = platformTag.findall('./source-file'),
headerFiles = platformTag.findall('./header-file'),
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/plugman/platforms.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms.js b/cordova-lib/src/plugman/platforms.js
index e7cd427..4ebdc49 100644
--- a/cordova-lib/src/plugman/platforms.js
+++ b/cordova-lib/src/plugman/platforms.js
@@ -27,8 +27,7 @@ module.exports = {
'ios': require('./platforms/ios'),
'blackberry10': require('./platforms/blackberry10'),
'wp8': require('./platforms/wp8'),
- 'windows8' : require('./platforms/windows'),
- 'windows' : require('./platforms/windows'),
+ 'windows8' : require('./platforms/windows8'),
'firefoxos': require('./platforms/firefoxos'),
'ubuntu': require('./platforms/ubuntu'),
'tizen': require('./platforms/tizen')
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/plugman/platforms/windows.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/windows.js b/cordova-lib/src/plugman/platforms/windows.js
deleted file mode 100644
index 803a3c8..0000000
--- a/cordova-lib/src/plugman/platforms/windows.js
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *
- * Copyright 2013 Jesse MacFadyen
- *
- * Licensed 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.
- *
-*/
-
-/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
- indent:4, unused:vars, latedef:nofunc,
- laxcomma:true, sub:true
-*/
-
-var common = require('./common'),
- path = require('path'),
- fs = require('fs'),
- glob = require('glob'),
- jsproj = require('../../util/windows/jsproj'),
- events = require('../../events'),
- xml_helpers = require('../../util/xml-helpers');
-
-module.exports = {
- platformName: 'windows',
- InvalidProjectPathError: 'does not appear to be a Windows 8 or Unified Windows Store project (no .projitems|jsproj file)',
- www_dir:function(project_dir) {
- return path.join(project_dir, 'www');
- },
- package_name:function(project_dir) {
- // CB-6976 Windows Universal Apps. To make platform backward compatible
- // with old template we look for package.appxmanifest file as well.
- var manifestPath = fs.existsSync(path.join(project_dir, 'package.store.appxmanifest')) ?
- path.join(project_dir, 'package.store.appxmanifest') :
- path.join(project_dir, 'package.appxmanifest');
-
- var manifest = xml_helpers.parseElementtreeSync(manifestPath);
- return manifest.find('Properties/DisplayName').text;
- },
- parseProjectFile:function(project_dir) {
- var project_files = glob.sync('*.projitems', { cwd:project_dir });
- if (project_files.length === 0) {
- // Windows8.1: for smooth transition and to prevent
- // plugin handling failures we search for old *.jsproj also.
- project_files = glob.sync('*.jsproj', { cwd:project_dir });
- if (project_files.length === 0) {
- throw new Error(this.InvalidProjectPathError);
- }
- }
- return new jsproj(path.join(project_dir, project_files[0]));
- },
- 'source-file': {
- install:function(source_el, plugin_dir, project_dir, plugin_id, project_file) {
- var targetDir = source_el.attrib['target-dir'] || '';
- var dest = path.join('www', 'plugins', plugin_id, targetDir, path.basename(source_el.attrib['src']));
-
- common.copyNewFile(plugin_dir, source_el.attrib['src'], project_dir, dest);
- // add reference to this file to jsproj.
- project_file.addSourceFile(dest);
- },
- uninstall:function(source_el, project_dir, plugin_id, project_file) {
- var dest = path.join('www', 'plugins', plugin_id,
- source_el.attrib['target-dir'] ? source_el.attrib['target-dir'] : '',
- path.basename(source_el.attrib['src']));
- common.removeFile(project_dir, dest);
- // remove reference to this file from csproj.
- project_file.removeSourceFile(dest);
- }
- },
- 'header-file': {
- install:function(source_el, plugin_dir, project_dir, plugin_id) {
- events.emit('verbose', 'header-fileinstall is not supported for Windows 8');
- },
- uninstall:function(source_el, project_dir, plugin_id) {
- events.emit('verbose', 'header-file.uninstall is not supported for Windows 8');
- }
- },
- 'resource-file':{
- install:function(el, plugin_dir, project_dir, plugin_id, project_file) {
- events.emit('verbose', 'resource-file is not supported for Windows 8');
- },
- uninstall:function(el, project_dir, plugin_id, project_file) {
- }
- },
- 'lib-file': {
- install:function(el, plugin_dir, project_dir, plugin_id, project_file) {
- var inc = el.attrib['Include'];
- project_file.addSDKRef(inc);
- },
- uninstall:function(el, project_dir, plugin_id, project_file) {
- events.emit('verbose', 'windows8 lib-file uninstall :: ' + plugin_id);
- var inc = el.attrib['Include'];
- project_file.removeSDKRef(inc);
- }
- },
- 'framework': {
- install:function(el, plugin_dir, project_dir, plugin_id, project_file) {
- events.emit('verbose', 'windows8 framework install :: ' + plugin_id);
-
- var src = el.attrib['src'];
- var dest = src; // if !isCustom, we will just add a reference to the file in place
- // technically it is not possible to get here without isCustom == true -jm
- // var isCustom = el.attrib.custom == 'true';
- var type = el.attrib['type'];
-
- if(type == 'projectReference') {
- project_file.addProjectReference(path.join(plugin_dir,src));
- }
- else {
- // if(isCustom) {}
- dest = path.join('plugins', plugin_id, path.basename(src));
- common.copyFile(plugin_dir, src, project_dir, dest);
- project_file.addReference(dest, src);
- }
-
- },
- uninstall:function(el, project_dir, plugin_id, project_file) {
- events.emit('verbose', 'windows8 framework uninstall :: ' + plugin_id );
-
- var src = el.attrib['src'];
- // technically it is not possible to get here without isCustom == true -jm
- // var isCustom = el.attrib.custom == 'true';
- var type = el.attrib['type'];
- // unfortunately we have to generate the plugin_dir path because it is not passed to uninstall
- var plugin_dir = path.join(project_dir, 'cordova/plugins', plugin_id,src);
-
- if(type == 'projectReference') {
- project_file.removeProjectReference(plugin_dir);
- }
- else {
- // if(isCustom) { }
- var targetPath = path.join('plugins', plugin_id);
- common.removeFile(project_dir, targetPath);
- project_file.removeReference(src);
- }
- }
- }
-};
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/plugman/platforms/windows8.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/windows8.js b/cordova-lib/src/plugman/platforms/windows8.js
new file mode 100644
index 0000000..29b433c
--- /dev/null
+++ b/cordova-lib/src/plugman/platforms/windows8.js
@@ -0,0 +1,136 @@
+/*
+ *
+ * Copyright 2013 Jesse MacFadyen
+ *
+ * Licensed 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.
+ *
+*/
+
+/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
+ indent:4, unused:vars, latedef:nofunc,
+ laxcomma:true, sub:true
+*/
+
+var common = require('./common'),
+ path = require('path'),
+ glob = require('glob'),
+ jsproj = require('../../util/windows/jsproj'),
+ events = require('../../events'),
+ xml_helpers = require('../../util/xml-helpers');
+
+module.exports = {
+ platformName: 'windows8',
+ InvalidProjectPathError: 'does not appear to be a Windows Store JS project (no .jsproj file)',
+ www_dir: function(project_dir) {
+ return path.join(project_dir, 'www');
+ },
+ package_name: function(project_dir) {
+ var manifest = xml_helpers.parseElementtreeSync(path.join(project_dir, 'package.appxmanifest'));
+ return manifest.find('Properties/DisplayName').text;
+ },
+ parseProjectFile: function(project_dir) {
+ var project_files = glob.sync('*.jsproj', { cwd:project_dir });
+ if (project_files.length === 0) {
+ throw new Error(this.InvalidProjectPathError);
+ }
+ return new jsproj(path.join(project_dir, project_files[0]));
+ },
+ 'source-file': {
+ install:function(source_el, plugin_dir, project_dir, plugin_id, project_file) {
+ var targetDir = source_el.attrib['target-dir'] || '';
+ var dest = path.join('www', 'plugins', plugin_id, targetDir, path.basename(source_el.attrib['src']));
+
+ common.copyNewFile(plugin_dir, source_el.attrib['src'], project_dir, dest);
+ // add reference to this file to jsproj.
+ project_file.addSourceFile(dest);
+ },
+ uninstall:function(source_el, project_dir, plugin_id, project_file) {
+ var dest = path.join('www', 'plugins', plugin_id,
+ source_el.attrib['target-dir'] ? source_el.attrib['target-dir'] : '',
+ path.basename(source_el.attrib['src']));
+ common.removeFile(project_dir, dest);
+ // remove reference to this file from csproj.
+ project_file.removeSourceFile(dest);
+ }
+ },
+ 'header-file': {
+ install:function(source_el, plugin_dir, project_dir, plugin_id) {
+ events.emit('verbose', 'header-fileinstall is not supported for Windows 8');
+ },
+ uninstall:function(source_el, project_dir, plugin_id) {
+ events.emit('verbose', 'header-file.uninstall is not supported for Windows 8');
+ }
+ },
+ 'resource-file':{
+ install:function(el, plugin_dir, project_dir, plugin_id, project_file) {
+ events.emit('verbose', 'resource-file is not supported for Windows 8');
+ },
+ uninstall:function(el, project_dir, plugin_id, project_file) {
+ }
+ },
+ 'lib-file': {
+ install:function(el, plugin_dir, project_dir, plugin_id, project_file) {
+ var inc = el.attrib['Include'];
+ project_file.addSDKRef(inc);
+ },
+ uninstall:function(el, project_dir, plugin_id, project_file) {
+ events.emit('verbose', 'windows8 lib-file uninstall :: ' + plugin_id);
+ var inc = el.attrib['Include'];
+ project_file.removeSDKRef(inc);
+ }
+ },
+ 'framework': {
+ install:function(el, plugin_dir, project_dir, plugin_id, project_file) {
+ events.emit('verbose', 'windows8 framework install :: ' + plugin_id);
+
+ var src = el.attrib['src'];
+ var dest = src; // if !isCustom, we will just add a reference to the file in place
+ // technically it is not possible to get here without isCustom == true -jm
+ // var isCustom = el.attrib.custom == 'true';
+ var type = el.attrib['type'];
+
+ if(type == 'projectReference') {
+ project_file.addProjectReference(path.join(plugin_dir,src));
+ }
+ else {
+ // if(isCustom) {}
+ dest = path.join('plugins', plugin_id, path.basename(src));
+ common.copyFile(plugin_dir, src, project_dir, dest);
+ project_file.addReference(dest,src);
+ }
+
+ },
+ uninstall:function(el, project_dir, plugin_id, project_file) {
+ events.emit('verbose', 'windows8 framework uninstall :: ' + plugin_id );
+
+ var src = el.attrib['src'];
+ // technically it is not possible to get here without isCustom == true -jm
+ // var isCustom = el.attrib.custom == 'true';
+ var type = el.attrib['type'];
+ // unfortunately we have to generate the plugin_dir path because it is not passed to uninstall
+ var plugin_dir = path.join(project_dir, 'cordova/plugins', plugin_id,src);
+
+ if(type == 'projectReference') {
+ project_file.removeProjectReference(plugin_dir);
+ }
+ else {
+ // if(isCustom) { }
+ var targetPath = path.join('plugins', plugin_id);
+ common.removeFile(project_dir, targetPath);
+ project_file.removeReference(src);
+ }
+ }
+
+ }
+};
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/plugman/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/prepare.js b/cordova-lib/src/plugman/prepare.js
index 961141e..374e2b5 100644
--- a/cordova-lib/src/plugman/prepare.js
+++ b/cordova-lib/src/plugman/prepare.js
@@ -27,7 +27,7 @@ var platform_modules = require('./platforms'),
config_changes = require('./util/config-changes'),
xml_helpers = require('../util/xml-helpers'),
wp8 = require('./platforms/wp8'),
- windows = require('./platforms/windows'),
+ windows8 = require('./platforms/windows8'),
common = require('./platforms/common'),
fs = require('fs'),
shell = require('shelljs'),
@@ -76,11 +76,11 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_
// for windows phone and windows8 platforms we need to add all www resources to the .csproj(.jsproj) file
// first we need to remove them all to prevent duplicates
var projFile;
- if (platform == 'wp8' || platform == 'windows8' || platform == 'windows') {
+ if (platform == 'wp8' || platform == 'windows8') {
projFile = (platform == 'wp8') ? wp8.parseProjectFile(project_dir) :
- windows.parseProjectFile(project_dir);
+ windows8.parseProjectFile(project_dir);
// remove reference to cordova_plugins.js and all files inside plugins folder
- projFile.removeSourceFile(/^(\$\(MSBuildThisFileDirectory\))?www\\(cordova_plugins.js|plugins\\)/i);
+ projFile.removeSourceFile(new RegExp("^www\\\\(cordova_plugins.js|plugins\\\\)", "i"));
}
platform_json = config_changes.get_platform_json(plugins_dir, platform);
@@ -112,11 +112,6 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_
var jsModules = xml.findall('./js-module');
var assets = xml.findall('asset');
var platformTag = xml.find(util.format('./platform[@name="%s"]', platform));
- // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
- // we allow using windows8 tag for new windows platform
- if (platform == 'windows' && !platformTag) {
- platformTag = xml.find('platform[@name="' + 'windows8' + '"]');
- }
if (platformTag) {
assets = assets.concat(platformTag.findall('./asset'));
@@ -196,7 +191,7 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_
events.emit('verbose', 'Writing out cordova_plugins.js...');
fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.js'), final_contents, 'utf-8');
- if(platform == 'wp8' || platform == 'windows8' || platform == 'windows') {
+ if(platform == 'wp8' || platform == 'windows8') {
projFile.addSourceFile(path.join('www', 'cordova_plugins.js'));
projFile.write();
}
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/plugman/uninstall.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/uninstall.js b/cordova-lib/src/plugman/uninstall.js
index c145da2..4723099 100644
--- a/cordova-lib/src/plugman/uninstall.js
+++ b/cordova-lib/src/plugman/uninstall.js
@@ -247,11 +247,6 @@ function handleUninstall(actions, platform, plugin_id, plugin_et, project_dir, w
var platform_modules = require('./platforms');
var handler = platform_modules[platform];
var platformTag = plugin_et.find('./platform[@name="'+platform+'"]');
- // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
- // we allow using windows8 tag for new windows platform
- if (platform == 'windows' && !platformTag) {
- platformTag = plugin_et.find('platform[@name="' + 'windows8' + '"]');
- }
www_dir = www_dir || handler.www_dir(project_dir);
events.emit('log', 'Uninstalling ' + plugin_id + ' from ' + platform);
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/plugman/util/config-changes.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/config-changes.js b/cordova-lib/src/plugman/util/config-changes.js
index c314b23..4acead9 100644
--- a/cordova-lib/src/plugman/util/config-changes.js
+++ b/cordova-lib/src/plugman/util/config-changes.js
@@ -192,16 +192,6 @@ function remove_plugin_changes(plugin_name, plugin_id, is_top_level) {
);
continue;
}
- // CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
- if (self.platform == 'windows' && file == 'package.appxmanifest' &&
- !fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
- // New windows template separate manifest files for Windows8, Windows8.1 and WP8.1
- var substs = ['package.phone.appxmanifest', 'package.store.appxmanifest', 'package.store80.appxmanifest'];
- for (var subst in substs) {
- events.emit('verbose', 'Applying munge to ' + substs[subst]);
- self.apply_file_munge(substs[subst], munge.files[file], true);
- }
- }
self.apply_file_munge(file, munge.files[file], /* remove = */ true);
}
@@ -252,15 +242,6 @@ function add_plugin_changes(plugin_id, plugin_vars, is_top_level, should_increme
);
continue;
}
- // CB-6976 Windows Universal Apps. Compatibility fix for existing plugins.
- if (self.platform == 'windows' && file == 'package.appxmanifest' &&
- !fs.existsSync(path.join(self.project_dir, 'package.appxmanifest'))) {
- var substs = ['package.phone.appxmanifest', 'package.store.appxmanifest', 'package.store80.appxmanifest'];
- for (var subst in substs) {
- events.emit('verbose', 'Applying munge to ' + substs[subst]);
- self.apply_file_munge(substs[subst], munge.files[file]);
- }
- }
self.apply_file_munge(file, munge.files[file]);
}
@@ -318,12 +299,6 @@ function generate_plugin_config_munge(plugin_dir, vars) {
var plugin_xml = plugin_config.data;
var platformTag = plugin_xml.find('platform[@name="' + self.platform + '"]');
- // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass api failures
- // we allow using windows8 tag for new windows platform
- if (self.platform == 'windows' && !platformTag) {
- platformTag = plugin_xml.find('platform[@name="' + 'windows8' + '"]');
- }
-
var changes = [];
// add platform-agnostic config changes
changes = changes.concat(plugin_xml.findall('config-file'));
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17c7465f/cordova-lib/src/util/windows/jsproj.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/util/windows/jsproj.js b/cordova-lib/src/util/windows/jsproj.js
index 538e44b..6cac1cf 100644
--- a/cordova-lib/src/util/windows/jsproj.js
+++ b/cordova-lib/src/util/windows/jsproj.js
@@ -41,14 +41,9 @@ var WinCplusplusProjectTypeGUID = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"; //
function jsproj(location) {
- if (!location) {
- throw new Error('Project file location can\'t be null or empty' );
- }
events.emit('verbose','creating jsproj from project at : ' + location);
this.location = location;
this.xml = xml_helpers.parseElementtreeSync(location);
- // Detect universal Windows app project template
- this.isUniversalWindowsApp = location.match(/\.(projitems|shproj)$/i);
return this;
}
@@ -82,8 +77,6 @@ jsproj.prototype = {
events.emit('verbose','addReference::' + relPath);
- relPath = this.isUniversalWindowsApp ? '$(MSBuildThisFileDirectory)' + relPath : relPath;
-
var item = new et.Element('ItemGroup');
var extName = path.extname(relPath);
@@ -110,8 +103,6 @@ jsproj.prototype = {
removeReference:function(relPath) {
events.emit('verbose','removeReference::' + relPath);
- relPath = this.isUniversalWindowsApp ? '$(MSBuildThisFileDirectory)' + relPath : relPath;
-
var extName = path.extname(relPath);
var includeText = path.basename(relPath,extName);
// <ItemGroup>
@@ -126,8 +117,6 @@ jsproj.prototype = {
addSourceFile:function(relative_path) {
relative_path = relative_path.split('/').join('\\');
- relative_path = this.isUniversalWindowsApp ? '$(MSBuildThisFileDirectory)' + relative_path : relative_path;
-
// make ItemGroup to hold file.
var item = new et.Element('ItemGroup');
@@ -140,10 +129,10 @@ jsproj.prototype = {
removeSourceFile: function(relative_path) {
var isRegexp = relative_path instanceof RegExp;
+
if (!isRegexp) {
// path.normalize(relative_path);// ??
relative_path = relative_path.split('/').join('\\');
- relative_path = this.isUniversalWindowsApp ? '$(MSBuildThisFileDirectory)' + relative_path : relative_path;
}
var root = this.xml.getroot();
@@ -159,7 +148,7 @@ jsproj.prototype = {
// nothing to remove, skip..
if (filesToRemove.length < 1) return;
- filesToRemove.forEach(function(file) {
+ filesToRemove.forEach(function(file){
// remove file reference
group.remove(0, file);
});
[2/2] git commit: Remove universal windows support from RELEASENOTES
Posted by ka...@apache.org.
Remove universal windows support from RELEASENOTES
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/4732ff01
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/4732ff01
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/4732ff01
Branch: refs/heads/rb_0.21.6
Commit: 4732ff01028a5f46f91e0cd0458ea863326b759f
Parents: 17c7465
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Fri Jun 27 10:57:23 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri Jun 27 10:57:23 2014 -0400
----------------------------------------------------------------------
cordova-lib/RELEASENOTES.md | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/4732ff01/cordova-lib/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/cordova-lib/RELEASENOTES.md b/cordova-lib/RELEASENOTES.md
index 7dc6914..778ee03 100644
--- a/cordova-lib/RELEASENOTES.md
+++ b/cordova-lib/RELEASENOTES.md
@@ -23,7 +23,6 @@
### 0.21.4 (Jun 23, 2014)
* CB-3571, CB-2606: support for splashscreens
-* CB-6976 Add support for Windows Universal apps (Windows 8.1 and WP 8.1)
* Use Plugininfo module to determine plugin id and version
* Fix plugin check error, when plugin dependency with specific version is given
* CB-6709 Do not create merges/ folder when adding a platform