Skip to content

Commit

Permalink
Added note on including --gradleArg=--no-daemon when building for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Aug 17, 2015
1 parent 8990b67 commit 5e00ae3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tutorial-gulp/gulp-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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"); });
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -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"]
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions tutorial-team-build/TFS2015.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -133,7 +133,7 @@ You are now all set! You can configure either of these build definitions further

<a name="vso"></a>
## 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](<media/vso-workaround.png>)

Expand Down

0 comments on commit 5e00ae3

Please sign in to comment.