Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Use grunt-phonegap for phonegap (remote) builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nickygerritsen committed Nov 19, 2014
1 parent 258b9c4 commit fee3fbc
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 47 deletions.
14 changes: 14 additions & 0 deletions .cordova/config.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"lib": {
"www": {
"id": "com.phonegap.hello-world",
"version": "master",
"uri": "https://github.com/phonegap/phonegap-app-hello-world/archive/master.tar.gz",
"link": false
}
},
"phonegap": {
// Replace 123456 with your phoengap build app ID
"id": 123456
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ coverage/
webkitbuilds/
temp/
pgbuildconfig.json
.cordova/config.json
data/
build/
*.sublime*

# bower stuff, include actual files
Expand Down
51 changes: 28 additions & 23 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,30 @@ module.exports = function(grunt) {
}
},

"phonegap-build": {
debug: {
options: {
archive: "temp/app.zip",
appId: pgbuildconfig.appId,
user: pgbuildconfig.user,
download: {
// ios: 'dist/ios.ipa',
android: 'dist/android.apk'
}
}
},
release: {
options: {
archive: "temp/app.zip",
appId: pgbuildconfig.appId,
user: pgbuildconfig.user,
download: {
// ios: 'dist/ios.ipa',
android: 'dist/android.apk'
}
"phonegap": {
config: {
root: "src",
config: "src/config.xml",
html: "fgindex.html",
name: function(){
var pkg = grunt.file.readJSON('package.json');
return pkg.name;
},
debuggable: true,
releases: 'releases',
platforms: ['ios', 'android'],
plugins: [
'org.apache.cordova.file'
],
verbose: true,
releaseName: function(){
var pkg = grunt.file.readJSON('package.json');
return(pkg.name + '-' + pkg.version);
},
remote: {
username: pgbuildconfig.username,
password: pgbuildconfig.password,
platforms: ['ios', 'android']
}
}
},
Expand Down Expand Up @@ -106,12 +109,14 @@ module.exports = function(grunt) {
});

grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.loadNpmTasks('grunt-phonegap-build');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-http-server');
grunt.loadNpmTasks('grunt-phonegap');

grunt.registerTask('phonegap', ['compress', 'phonegap-build:debug']);
grunt.registerTask('phonegap', ['phonegap:login', 'phonegap:build', 'phonegap:logout']);
grunt.registerTask('phonegap:ios', ['phonegap:login', 'phonegap:build:ios', 'phonegap:logout']);
grunt.registerTask('phonegap:android', ['phonegap:login', 'phonegap:build:android', 'phonegap:logout']);
grunt.registerTask('html', ['saxon']);
grunt.registerTask('pdf', ['saxon','http-server', 'phantomJSScreenShot']);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"grunt-contrib-compress": "~0.5.2",
"grunt-karma": "^0.8.3",
"grunt-node-webkit-builder": "~0.1.3",
"grunt-phonegap-build": "0.0.8",
"grunt-phonegap": "0.15.2",
"karma": "^0.12.17",
"karma-chrome-launcher": "^0.1.4",
"karma-firefox-launcher": "^0.1.3",
Expand Down
30 changes: 9 additions & 21 deletions pgbuildconfig.example.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
/*
example phonegap build config file
copy and rename to "pgbuildconfig.json"
then run "grunt phonegap"
*/
{
"appId": "123456",
"user": {
"email": "you@yourhost.com"
}
}

/*
or use a phonegap build token
{
"appId": "123456",
"user": {
"token": "ABCD123409876XYZ"
}
}
*/
/*
example phonegap build config file
copy and rename to "pgbuildconfig.json"
then run "grunt phonegap"
*/
{
"username": "you@yourhost.com",
"password": "mysecretpassord"
}
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ Building

- for a desktop build: `grunt nodewebkit`
- for a mobile build: `grunt phonegap`
- to build only one of iOS or Android, use `grunt phonegap:ios` or `grunt phonegap:android` respectively

For the phonegap build, copy `pgbuildconfig.example.json` to `pgbuildconfig` and adjust your phonegap build credentials. You can create an account on [phonegap build](http://build.phonegap.com/)
For the phonegap build, copy `pgbuildconfig.example.json` to `pgbuildconfig.json` and adjust your phonegap build credentials. You can create an account on [phonegap build](http://build.phonegap.com/). Also, make sure you you copy .cordova/config.example.json to .cordova/config.json and insert your application ID from phonegap build into it. The first time you build the app you must comment the app ID line out, it will generate one for you. Afterwards check the Phonegap build website for the generated app ID.

For iOS, see [Building for iOS](https://github.com/FirstLegoLeague/fllscoring/wiki/Building-for-iOS)

Expand Down
6 changes: 5 additions & 1 deletion src/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
<gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />
<gap:splash gap:platform="winphone" src="res/screen/windows-phone/screen-portrait.jpg" />
<gap:plugin name="org.apache.cordova.file" version="1.3.1" />
<access origin="*" />
<content src="fgindex.html" />
<content src="index.html" />
<gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance" overwrite="true">
<false/>
</gap:config-file>
</widget>

0 comments on commit fee3fbc

Please sign in to comment.