Skip to content

Instantly share code, notes, and snippets.

@benwestrate
Last active August 29, 2015 14:18
Show Gist options
  • Save benwestrate/a597f3a93033160cb898 to your computer and use it in GitHub Desktop.
Save benwestrate/a597f3a93033160cb898 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var phonegapBuild = require('gulp-phonegap-build');
gulp.task( 'dist' , function(){
gulp.src('www/**/*')
.pipe(gulp.dest("./dist"));
gulp.src('config.xml')
.pipe(gulp.dest("./dist"));
});
gulp.task('phonegap-build', ['dist'], function () {
gulp.src('dist/**/*')
.pipe(phonegapBuild({
"appId": "",
"user": {
"token": ""
}
}));
});
gulp.task('default', function() {
console.log( "Please specify a task" );
});
{
"name": "phone-gap-build-util",
"version": "1.0.0",
"description": "",
"main": "gulp.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"gulp": "^3.8.10",
"gulp-phonegap-build": "^0.1.3"
}
}
@benwestrate
Copy link
Author

How to use this tool

npm install -g gulp
  • Download this gist. Click the download gist button to the right.
  • Copy the gulpfile.js and the package.json into your phonegap application folder. They should be at the same level as your www folder.
  • In your terminal navigate to your app folder and install the dependencies
npm install
gulp.task('phonegap-build', ['dist'], function () {
    gulp.src('dist/**/*')
        .pipe(phonegapBuild({
          "appId": "YOUR APP ID GOES HERE",
          "user": {
            "token": "YOUR TOKEN GOES HERE"
          }
        }));
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment