From 5e00ae3ee457f68866f255058211eb56bc1b9c4a Mon Sep 17 00:00:00 2001 From: "clantz@microsoft.com" Date: Mon, 17 Aug 2015 13:43:32 -0700 Subject: [PATCH] Added note on including --gradleArg=--no-daemon when building for CI --- tutorial-gulp/gulp-ci.md | 10 +++++----- tutorial-team-build/TFS2015.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tutorial-gulp/gulp-ci.md b/tutorial-gulp/gulp-ci.md index 66dfa752..f9410ea7 100644 --- a/tutorial-gulp/gulp-ci.md +++ b/tutorial-gulp/gulp-ci.md @@ -18,12 +18,12 @@ var gulp = require("gulp"), gulp.task("default", function (callback) { cordova.build({ "platforms": ["android"], - "options": ["--release"] + "options": ["--release","--gradleArg=--no-daemon"] }, callback); }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Note that cordova-lib functions **are asynchronous** and so you need to include the Gulp callback function passed into your task as an argument to your last API call. +Note that cordova-lib functions **are asynchronous** and so you need to include the Gulp callback function passed into your task as an argument to your last API call. Note that "--gradleArg=--no-daemon" above should be added in for build automation scenarios since Cordova starts up a daemon process by default that can cause your build to appear to hang. To see the example above in action you will need to install some additional npm packages. Create a simple [package.json](http://go.microsoft.com/fwlink/?LinkID=533781) file with a minimum of the following in it that is in the root of your Cordova project: @@ -101,7 +101,7 @@ var gulp = require("gulp"), cordovaBuild = require("taco-team-build"); gulp.task("default", function () { - return cordovaBuild.buildProject("android", ["--release"]) + return cordovaBuild.buildProject("android", ["--release", "--gradleArg=--no-daemon"]) .then(function() { return cordovaBuild.packageProject("android"); }); }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -133,7 +133,7 @@ var gulp = require("gulp"), var winPlatforms = ["android", "windows", "wp8"], osxPlatforms = ["ios"], buildArgs = { - android: ["--release", "--device"], + android: ["--release", "--device", "--gradleArg=no-daemon"], ios: ["--release", "--device"], windows: ["--release", "--device"], wp8: ["--release", "--device"] @@ -160,7 +160,7 @@ gulp.task("package", ["build"], function () { }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You may also wish to update the script with TypeScript compilation if you are using the language in your app. See the [Gulp TypeScript tutorial](http://go.microsoft.com/fwlink/?LinkID=533769) for details. +Again, note that "--gradleArg=--no-daemon" above should be added in for build automation scenarios since Cordova starts up a daemon process by default that can cause your build to appear to hang. You may also wish to update the script with TypeScript compilation if you are using the language in your app. See the [Gulp TypeScript tutorial](http://go.microsoft.com/fwlink/?LinkID=533769) for details. ##Configuring a Team / CI Build Server If you haven't already, you'll need to set up your build server with all of the necessary native dependencies for the platforms you intend to build. See “Installing Dependencies” in the [Building Cordova Apps in a Team / Continuous Integration Environment](http://go.microsoft.com/fwlink/?LinkID=533743) tutorial for details. diff --git a/tutorial-team-build/TFS2015.md b/tutorial-team-build/TFS2015.md index 378950c3..94368a4b 100644 --- a/tutorial-team-build/TFS2015.md +++ b/tutorial-team-build/TFS2015.md @@ -3,7 +3,7 @@ The article is part of a is part of a [series of tutorials](./README.md) on building Visual Studio 2015 Tools for Apache Cordova projects in a Team / CI environment. -**Advisory: You may encoutner a "EPERM" error when executing these instructions from a "Hosted" agent in Visual Studio Online.** We are working with the VSO team to resolve a permissions issue with cache locations. Short term you can work around the issue adding a variable under the "Variables" tab of build definition called "CORDOVA_CACHE" with a value of "C:\cordova-cache" and a variable of "GRADLE_USER_HOME" with a value of "c:\gradle". This will force the tools to be re-acquired instead of using the cached versions. Note that this will not occur at all if you use your own build agents. +**Advisory: You may encoutner a "EPERM" error when executing these instructions from a "Hosted" agent in Visual Studio Online.** We are working with the VSO team to resolve a permissions issue with cache locations. Short term you can work around the issue adding a variable under the "Variables" tab of build definition called "CORDOVA_CACHE" with a value of "C:\cordova-cache" and a variable of "GRADLE_USER_HOME" with a value of "c:\gradle". This will force the tools to be re-acquired instead of using the cached versions. Note that this will not occur at all if you use your own build agents. Also ensure you have the latest [gulpfile.js](http://go.microsoft.com/fwlink/?LinkID=533736) that includes the "--gradleArg=--no-daemon" option. ##Background Tools for Apache Cordova is designed to work with a number of different team build systems since the projects it creates are standard [Apache Cordova Command Line interface](http://go.microsoft.com/fwlink/?LinkID=533773) (CLI) projects. Team Foundation Services 2015 provides a new [cross-platform agent](http://go.microsoft.com/fwlink/?LinkID=533789) and [Gulp](../tutorial-gulp) based build capabilities that enables TFS to build directly on Windows or OSX which is a critical capability Cordova based development. In addition, Gulp also enables you to easily add in a large number of "[plugins](http://go.microsoft.com/fwlink/?LinkID=533790)" to perform useful build tasks in environments that you do not control directly like Visual Studio Online. @@ -133,7 +133,7 @@ You are now all set! You can configure either of these build definitions further ## Short Term Workaround for EPERM Error with VSO Hosted Agents -You may encoutner a "EPERM" error when executing these instructions from a "Hosted" agent in Visual Studio Online. We are working with the VSO team to resolve a permissions issue with cache locations. Short term you can work around the issue adding a "Variable" to your build definition called "CORDOVA_CACHE" with a value of "C:\cordova-cache" and a variable of "GRADLE_USER_HOME" with a value of "c:\gradle". This will force the tools to be re-acquired instead of using the cached versions. Note that this will not occur at all if you use your own build agents. +You may encoutner a "EPERM" error when executing these instructions from a "Hosted" agent in Visual Studio Online. We are working with the VSO team to resolve a permissions issue with cache locations. Short term you can work around the issue adding a "Variable" to your build definition called "CORDOVA_CACHE" with a value of "C:\cordova-cache" and a variable of "GRADLE_USER_HOME" with a value of "c:\gradle". This will force the tools to be re-acquired instead of using the cached versions. Note that this will not occur at all if you use your own build agents. Also ensure you have the latest [gulpfile.js](http://go.microsoft.com/fwlink/?LinkID=533736) that includes the "--gradleArg=--no-daemon" option. ![VSO Workaround]()