Visual Studio Team Services Extension for Cordova Streamline CI setup for your Apache Cordova, PhoneGap, Ionic, or Cordova CLI compatible app using a set of useful pre-defined build steps. Install now! |
Visual Studio Team Services (formerly Visual Studio Online) and Team Foundation Services (TFS) 2015 can be used for building and testing Cordova apps in a Continuous Integration (CI) environment thanks to a new cross-platform agent that supports OSX. This new agent enables you to use Visual Studio Team Services (VSTS) or TFS to build projects targeting Android, iOS, or Windows created using Tools for Apache Cordova or any Cordova compliant CLI like the Ionic, PhoneGap, or TACO CLI.
This extension contains a set of VS Team Services "tasks" (or "build steps") that streamline setup when building Cordova based applications in a CI environment. These tasks can be used with either VSTS or TFS 2015 on-prem servers (see below) and are intended to work with any Cordova based project including, but not limited to, those created using Tools for Apache Cordova. The tasks:
After installing the extension, upload your project to VSTS, TFS, or GitHub.
Go to your VSTS or TFS project, click on the Build tab, and create a new build definition (the "+" icon) and select the Empty template.
Click Add build step... and select Cordova Build from the Build category
Configure the build step - Check out the tool tips for handy inline documentation.
Add a Demand under the General tab of xcode to force the build to run on OSX or cmd to force it to run on Windows as appropriate
Note: Be sure you are running version 0.3.10 or higher of the cross-platform agent and the latest Windows agent as these are required for VS Team Services extension to function. The VSTS hosted agent and MacinCloud agents will already be on this version.
See the following articles on using these tasks in VSTS/TFS:
Q: Android for Cordova 6.0.0 is failing to build when specifying a keystore path. How can I resolve this issue?
A: This is a due to a Cordova bug that was resolved in Cordova 6.1.0. Use Cordova 5.4.1 or upgrade to 6.1.0+ to resolve.
Q: Android for Cordova 6.0.0 is failing to build on a Mac or Linux. How can I resolve this issue?
A: This is a due to a Cordova bug that was resolved in Cordova 6.1.0. Use Cordova 5.4.1 or upgrade to 6.1.0+ to resolve.
Q: I am seeing Windows 10 builds fail in the VSTS Hosted Pool with a "Could not load file or assembly" error when using Cordova 5.4.x. How do I resolve this problem?
A: This is a Cordova bug when 64-bit Node.js is used. Upgrade to 6.1.0+ to resolve. See the Cordova bug for details.
Q: Building for Cordova 5.1.1 is failing with an ENOENT error. How can i resolve this issue?
A: This is due to a Cordova bug very specific to 5.1.1 where it fails to create some needed folders on a first time run. You can work around this in one of a few ways.
Q: After Feb 14th, I am seeing the following error when referencing P12 file: "Command failed: /bin/sh -c /usr/bin/security find-identity -v -p codesigning ..."
A: This is due to the Apple's WWDR certificate expiring on this date and an old certificate still being present on the system. To resolve, follow the steps outlined by Apple here. In particular, be sure to see "Xcode unable to create distribution builds for App Store submissions or Enterprise apps" and be sure to remove any expired certificates as this can cause the error to occur even after you've installed updated certificates. This also affects development certs despite the title.
Q: I am using my own Mac for a cross-platform agent and have it configured to run as a daemon. Signing is failing. How can I resolve this problem?
A: Configure the agent as a launch agent (./svc.sh install agent) or run it as an interactive process (node agent/vsoagent.js) to ensure Xcode is able to access the appropriate keychains. See the secure app signing tutorial for additional details. You could also opt to use MacinCloud instead.
Install the Visual Studio Team Services Extension for Cordova
You will now find a series of Cordova related tasks in the "Build" category
Enable basic auth in your TFS instance
Install the tfx-cli and login. If you already have the tfx-cli installed, be sure it is 0.3.6 or higher.
npm install -g tfx-cli
tfx login --auth-type basic
Enter your collection URL (Ex: https://localhost:8080/tfs/DefaultCollection) and user name and password. Do not include a slash (/) at the end of the collection URL.
Download the latest release of the Cordova tasks locally and unzip
Type the following from the root of the repo from Windows:
upload
Or from a Mac:
sh upload.sh
Profit!
By downloading and running this project, you agree to the license terms of the third party application software, Microsoft products, and components to be installed.
The third party software and products are provided to you by third parties. You are responsible for reading and accepting the relevant license terms for all software that will be installed. Microsoft grants you no rights to third party software.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
The MIT License (MIT)
Copyright (c) Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.