Skip to content

Commit

Permalink
Updated to reflect TACO update, updated VSO workaround, streamlined C…
Browse files Browse the repository at this point in the history
…I tutorial landing page
  • Loading branch information
Chuxel committed Aug 1, 2015
1 parent 342afff commit 352a2b5
Show file tree
Hide file tree
Showing 13 changed files with 562 additions and 497 deletions.
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ This repository contains a set of documents and tutorials for the **Visual Studi
1. [Using Gulp to Build Cordova Projects](./tutorial-gulp/gulp-ci.md)
1. [Invoking Gulp Tasks During a Cordova Build and the VS Task Runner Explorer](./tutorial-gulp/gulp-task-runner-explorer.md)
1. [Compiling TypeScript with Gulp](./tutorial-gulp/gulp-typescript.md)
1. [Building Cordova Apps in a Team / Continuous Integration (CI) Environment](./tutorial-team-build)
1. [Getting Started Building Cordova Apps in a Team / Continuous Integration (CI) Environment](./tutorial-team-build)
1. [Getting Started with Cordova & TFS 2015 or Visual Studio Online](./tutorial-team-build/TFS2015.md)
1. [Getting Started with Cordova & TFS 2013](./tutorial-team-build/TFS2013.md)
1. [Getting Started with Cordova & Jenkins CI](./tutorial-team-build/Jenkins.md)
1. [General CI Guidence, Information, and Troubleshooting](./tutorial-team-build/General.md)
1. [Package & Publish your Cordova Applications](./tutorial-package-publish)
1. [Using TypeScript with your Cordova projects](./getting-started/tutorial-typescript.md)
1. [Build and Simulate iOS in the Cloud](http://go.microsoft.com/fwlink/?LinkID=618476) (MSDN)
Expand Down
6 changes: 2 additions & 4 deletions known-issues/known-issues-cordova5.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ In general we recommend **using Cordova 5.1.1 or above** instead of 5.0.0 as the

##Apache Cordova 5.x.x General Issues
----------
**Old versions of Cordova plugins due to Cordova plugin ID changes:** A significant change occurred with Cordova 5.0.0+ that also altered the IDs of many core Cordova plugins. The Visual Studio 2015 config.xml designer uses the old IDs (ex: org.apache.cordova.camera not cordova-plugin-camera) because Cordova 4.3.1 and below cannot access plugins using these new IDs and the default template uses 4.3.1.
**config.xml Designer Does Not Show Updated Plugin IDs with Cordova 5.0.0+:** A significant change occurred with Cordova 5.0.0+ that also altered the IDs of many core Cordova plugins. The Visual Studio 2015 config.xml designer uses the old IDs (ex: org.apache.cordova.camera not cordova-plugin-camera) with Cordova 4.3.1 and below since this version of the Cordova < 5.0.0 do not support npm.

To install updated plugins, follow [this proceedure to install a npm sourced plugin](../tips-and-workarounds/general/README.md#plugin-npm).

*Note that these updated plugins were tested on Cordova 5.0.0 or later and therefore may or may not work on earlier versions of Cordova.* We advise against updating your plugins when using older versions of Cordova unless you are attempting to solve a specific problem.
However, if you update your Cordova version to 5.0.0 or later the config.xml designer should automatically see the new IDs in the "Plugins" tab of the designer. If you do not see this behavior, update Tools for Apache Cordova since a small post-RTM update enabled this functionality. Some very early adopters may not see some of the improvments described in this document until after you update. You will get an update notification soon prompting you to update or you can click "Install Tools for Apache Cordova" from the Apache Cordova templates section when creating a new project. Be sure to remove plugins with the older IDs before updating via the "Installed" tab to avoid unexpected behaviors.

----------
**Cannot access any network resources from Android app:** The Android platform contained within Cordova 5.0.0+ does not have a "whitelist" plugin installed by default and therefore blocks network access by default. There are now two whitelist plugins that can be installed:
Expand Down
6 changes: 2 additions & 4 deletions known-issues/known-issues-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ Remove these files from source control if you are not checking in the "platforms
**Slow first build or first plugin add:** The first build or plugin add for a given version of Cordova will be slower than subsequent builds as VS must first dynamically acquire Cordova. See the Output Window for more detail on progress. Further, the first remote iOS build will exhibit the same behavior as the agent downloads Cordova on your OSX machine. If you encounter a CordovaModuleLoadError with the first iOS build for a given Cordova version you can follow [these instructions](../tips-and-workarounds/ios/README.md#npm-cache) to resolve the problem.

----------
**Old versions of Cordova plugins due to Cordova plugin ID changes:** A significant change occurred with Cordova 5.0.0+ that also altered the IDs of many core Cordova plugins. The Visual Studio 2015 config.xml designer uses the old IDs (ex: org.apache.cordova.camera not cordova-plugin-camera) because Cordova 4.3.1 and below cannot access plugins using these new IDs and the default template uses 4.3.1.
**Old versions of Cordova plugins due to Cordova plugin ID changes:** A significant change occurred with Cordova 5.0.0+ that also altered the IDs of many core Cordova plugins. The Visual Studio 2015 config.xml designer uses the old IDs (ex: org.apache.cordova.camera not cordova-plugin-camera) with Cordova 4.3.1 and below since this version of the Cordova < 5.0.0 do not support npm.

To install updated plugins, follow [this proceedure to install a npm sourced plugin](../tips-and-workarounds/general/README.md#plugin-npm).

*Note that these updated plugins were tested on Cordova 5.0.0 or later and therefore may or may not work on earlier versions of Cordova.* We advise against updating your plugins when using older versions of Cordova unless you are attempting to solve a specific problem.
If you update your Cordova version to 5.1.1 or later the config.xml designer will automatically switch to using the new IDs. If you do not see this behavior, update Tools for Apache Cordova. Some very early adopters may not see some of the improvments described in this document until after you update since a small post-RTM update enabled this functionality. You will get an update notification soon prompting you to update or you can click "Install Tools for Apache Cordova" from the Apache Cordova templates section when creating a new project. Be sure to remove plugins using older IDs from your project before adding the updated plugins with the new IDs.

----------
**Git sourced plugins will not install:** Git sourced plugins will not install properly if you have not installed the [Git command line tools](http://www.git-scm.com/downloads) and have them in your system path. During installation of the Git tools, select the "Use Git from the Windows Command Prompt" option or add the "bin" folder from the Git install location to your path and restart VS. (Usually "C:\Program Files (x86)\Git\bin").
Expand Down
6 changes: 6 additions & 0 deletions known-issues/known-issues-vs2015.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,14 @@ In some cases, when you uninstall VS2013 or a previous version (RC) of VS2015, a
----------
**iPhone 4S Simulator appears when selecting iPad or other device when using the remotebuild agent and VS 2015 RTM:** You need to install version 3.1.1 of the ios-sim node module. Run "npm install -g [email protected]" from the Terminal app in OSX to install. See [remotebuild installation instructions ](http://go.microsoft.com/fwlink/?LinkID=533745) for details.

----------
**Existing vs-mda-remote settings in Visual Studio do not work with the remotebuild agent:** You will need to generate and use a new PIN when setting up Visual Studio to connect to the remotebuild agent for the first time. If you are not using secure mode, turn secure mode on and then off again to cause VS to reinitalize. See [remotebuild installation instructions](http://go.microsoft.com/fwlink/?LinkID=533745) for details.

----------
**config.xml Designer Does Not Show Updated Plugin IDs with Cordova 5.0.0+:** A significant change occurred with Cordova 5.0.0+ that also altered the IDs of many core Cordova plugins. The Visual Studio 2015 config.xml designer uses the old IDs (ex: org.apache.cordova.camera not cordova-plugin-camera) with Cordova 4.3.1 and below since this version of the Cordova < 5.0.0 do not support npm.

However, if you update your Cordova version to 5.0.0 or later the config.xml designer should automatically see the new IDs in the "Plugins" tab of the designer. If you do not see this behavior, update Tools for Apache Cordova since a small post-RTM update enabled this functionality. You will get an update notification soon prompting you to update or you can click "Install Tools for Apache Cordova" from the Apache Cordova templates section when creating a new project. Be sure to remove plugins with the older IDs before updating via the "Installed" tab to avoid unexpected behaviors.

##Visual Studio 2015 RC
----------
**VS 2015 RC and Cordova 5.x.x / Cordova Android 4.x.x:** See [Cordova 5.x.x known issues](known-issues-cordova5.md) for details on Android related issues that are specific to Cordova 5.0.0 and up.
Expand Down
38 changes: 17 additions & 21 deletions tutorial-cordova-5/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Using Apache Cordova 5
**Note that this documentation applies to Visual Studio 2015 and does not apply to Visual Studio 2013 CTPs.**
**Note: If the default blank template in Visual Studio 2015 is does not default to 5.1.1, you should update Tools for Apache Cordova.** Some very early adopters may not see some of the improvments described in this document until after you update. You will soon see a notification in the in the notification center (flag in the upper right) prompting you to update.

Tools for Apache Cordova RTM has been tested with both Cordova 4.3.1 and Cordova 5.1.1. As the major version number increase implies, [Apache Cordova 5](http://http://go.microsoft.com/fwlink/?LinkID=617659) is a departure from 3.x and 4.x versions of Cordova in a number of very important ways. Note that there were a number of issues with Cordova 5.0.0 itself that kept us from recommending its use including an [Android security issue](http://http://go.microsoft.com/fwlink/?LinkID=617658). As a result, we strongly recommend the use of **Cordova 5.1.1** with **Visual Studio 2015 RTM** and up.

Expand All @@ -11,7 +11,7 @@ This article will summarize the changes in Cordova 5 and how you can take advant
1. [Pluggable WebViews and the Crosswalk WebView for Android](#crosswalk)
1. [Windows 10 support and improved Cordova interoperability](#win10)

New projects created using Tools for Apache Cordova will automatically use Cordova 4.3.1. However, you can also update projects to 5.1.1 by following these steps:
You can update your project to use Cordova 5.1.1 by following these steps:

1. Double click on config.xml

Expand Down Expand Up @@ -74,15 +74,13 @@ When you upgrade a project to Cordova 5.0.0+, you will want to take the followin

1. Add the whitelist plugin to your project via config.xml:

1. Right-click on config.xml and select "View Code"
1. Double click on config.xml in your project

2. Click on the "Plugins" tab

2. Add the following XML element under the &lt;widget&gt; element:
2. Select "Whitelist" and click "Add"

~~~~~~~~~~~~~~~~~~~~~~~
<vs:plugin name="cordova-plugin-whitelist" version="1.0.0" />
~~~~~~~~~~~~~~~~~~~~~~~

The next time you build in Visual Studio, VS will install this version of the whitelist plugin. You can update the version number as needed.
![Add Whitelist Plugin](<media/cordova-5-7.png>)

2. Update config.xml with the allow-intent or allow-navigation elements as needed:
1. If you have not already, right-click on config.xml and select "View Code"
Expand Down Expand Up @@ -136,13 +134,11 @@ As a result, core plugins like Camera have changed from [org.apache.cordova.came

You can find running list of [old verses new plugin IDs in this location](http://go.microsoft.com/fwlink/?LinkID=617674).

Visual Studio 2015 currently only uses the old IDs since these are required for the default version of Cordova 4.3.1. We will resolve this problem in a subseqent update by dynamically updating the list based on the Cordova version selected. However, you can add npm versions of plugins to your project fairly easily by adding an XML element to config.xml as follows:
The config.xml designer in Visual Studio will automatically use the new plugin IDs if you are targeting Cordova 5.0.0+ and use the old plugin IDs for 4.3.1 and below where npm based plugin support is not available (see below for details).

~~~~~~~~~~~~~~~~~
<vs:plugin name="cordova-plugin-camera" version="1.2.0" />
~~~~~~~~~~~~~~~~~
**If you do not see this behavior, update Tools for Apache Cordova.** Some very early adopters may not see some of the improvments described in this document until after you update. You will soon see a notification in the in the notification center (flag in the upper right) prompting you to update.

See [tips and workarounds](../tips-and-workarounds/general/README.md#plugin-npm) for additional details on add npm versions of plugins to your project.
See [tips and workarounds](../tips-and-workarounds/general/README.md#plugin-npm) for additional details on adding npm versions of plugins to your project.

###Cordova Plugin Registry
As of 7/14/2015, plugins.cordova.io now has two registry sections:
Expand Down Expand Up @@ -184,7 +180,7 @@ Simply updating to Cordova 5.0.0+ will automatically cause Gradle to be used fro

1. If you've already added release signing information into ant.properties in your project, you'll need to place this information in a new file in your project. See the [Packaging & Publishing tutorial for details](../tutorial-package-publish) for details.

2. If you encounter an unexpected build error specifically for Android, see if the error references Cordova plugin source code. If so, update it by removing the plugin using the "Installed" tab of the config.xml designer and add the latest npm based version using [the XML bassed approach](../tips-and-workarounds/general/README.md#plugin-npm) described earlier. If you cannot determine which plugin is causing the issue, you can opt to proactively upgrade all of them.
2. If you encounter an unexpected build error specifically for Android, see if the error references Cordova plugin source code. If so, update it by removing the plugin using the "Installed" tab of the config.xml designer and re-adding the plugin. If you cannot determine which plugin is causing the issue, you can opt to proactively upgrade all of them.

3. If a plugin update doesn't solve the issue, try these steps to eliminate other factors.
1. Create a fresh project and see if the problem reproduces.
Expand Down Expand Up @@ -216,14 +212,14 @@ There is now a [Cordova Crosswalk plugin](http://go.microsoft.com/fwlink/?LinkID
###Installing the Crosswalk Plugin from VS
To use the Crosswalk WebView plugin from Visual Studio, follow these steps:

1. Right-click on config.xml and select "View Code"
2. Add the following XML element under the &lt;widget&gt; element:
1. Double click on config.xml in your project

2. Click on the "Plugins" tab

~~~~~~~~~~~~~~~~~~~~~~
<vs:plugin name="cordova-plugin-crosswalk-webview" version="1.2.0" />
~~~~~~~~~~~~~~~~~~~~~~
2. Select "Crosswalk WebView" and click "Add"

![Add Crosswalk Plugin](<media/cordova-5-10.png>)
The next time you build, your app will be running in the Crosswalk WebView. Note that the first build for Android in particular will take a bit given the plugin does some dynamic acquisition.

###Tips on Using the Crosswalk
Expand Down
20 changes: 11 additions & 9 deletions tutorial-cordova-5/cordova-5-security.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#Introduction to Cordova 5 Security

**Note: If the default blank template in Visual Studio 2015 is does not default to 5.1.1, you should update Tools for Apache Cordova.** Some very early adopters may not see some of the improvments described in this document until after you update. You will soon see a notification in the in the notification center (flag in the upper right) prompting you to update.

One of the more confusing changes about [Apache Cordova 5](http://go.microsoft.com/fwlink/?LinkID=617659) is that the updated version of the Android platform (also called Cordova Android 4.x) and iOS now follow a different, but more powerful security model designed to provide developers with the tools needed to prevent cross-site scripting attacks among other issues. A critical aspect of this security model is that **absolutely no network access of any kind is allowed without the installation of a Cordova plugin**.

##Cordova Whitelists
Expand Down Expand Up @@ -58,6 +61,7 @@ VS syntax (works with any Cordova version):
<vs:plugin name="cordova-plugin-whitelist" version="1.0.0" />
~~~~~~~~~~~~~~~~~~~~~~~

Both the default Cordova CLI template and Visual Studio's blank template use this feature to install the Whitelist plugin automatically on first build.

##The W3C Content Security Policy (CSP)
A topic of frequent conversation for security focused developers on the web is the [W3C Content Security Policy (CSP)](http://go.microsoft.com/fwlink/?LinkID=617696) feature that is available in Chrome, Safari, and Internet Explorer Edge. CSP support is available natively to Cordova apps targeting iOS, Windows 10 and up, and Android 4.4 and up. However, you can get support back to Android 4.0 by using something called the Crosswalk WebView. See [Using Apache Cordova 5](./README.md#crosswalk) for information adding Crosswalk to your project.
Expand Down Expand Up @@ -107,18 +111,16 @@ You can find a [great tutorial on using the CSP in detail here](http://go.micros
##Migrating an Existing Project
When you upgrade a project to Cordova 5.0.0+ from Cordova 4.3.1 or below in Visual Studio, you will want to take the following steps to ensure your app functions as you would expect.

1. Add the whitelist plugin to your project:
1. Add the whitelist plugin to your project via config.xml:

1. Right-click on config.xml and select "View Code"
1. Double click on config.xml in your project

2. Click on the "Plugins" tab

2. Add the following XML elements under the &lt;widget&gt; element:
2. Select "Whitelist" and click "Add"

~~~~~~~~~~~~~~~~~~~~~~~
<vs:plugin name="cordova-plugin-whitelist" version="1.0.0" />
~~~~~~~~~~~~~~~~~~~~~~~

The next time you build in Visual Studio, VS will install this version of the whitelist plugin. You can update the version number as needed.

![Add Whitelist Plugin](<media/cordova-5-7.png>)
2. Update config.xml with allow-intent or allow-navigation elements as needed:

1. Right-click on config.xml and select "View Code" if you have not already
Expand Down
Loading

0 comments on commit 352a2b5

Please sign in to comment.