PhoneGap Build September Update

brett
PhoneGap
Published in
2 min readSep 14, 2018

Some new features have been added this month to PhoneGap Build and the PhoneGap Build CLI / API. The theme of this update is basically us ignoring stuff, making your apps smaller and your development process faster.

.pgbignore

PhoneGap Build now supports a new file “.pgbignore”. This file supports all features of the familiar .gitignore file but it is only used to signify what files in your app should be deleted before your app is compiled and packaged. This is similar to .pgbomit but allows greater flexibility than just deletion of an entire directory.

PGB-CLI v1.1.0 and PGB-API v1.1.1

1. Ignore Flags

The cli and api can now ignore directories in your app when uploading your app from a directory. Depending on your app structure and pipeline this can reduce the uploaded zip size and hopefully speed up uploads.

Let’s throw up some commands:

> pgb new . --ignore node_modules,platforms
> pgb new . --ignore node_modules --ignore platforms

These commands are the same and specify i want to upload the current directory to PhoneGapBuild but without the node_modules and platforms directories (relative to the app’s root directory). The ignore flag can be specified multiple times and supports the glob format similar to .gitignore glob support.

Ignore flags are supported on pgb new and pgb update commands when specifying a directory.

Some more examples:

# don't upload any file in the root directory that
# is not a html, htm or js file.
> pgb new /path/to/app --ignore '*,!*.html?,!*.js'# don't upload the tmp directory and any log files> pgb new /path/to/app --ignore 'tmp/' --ignore '**/*.log'

In addition to the build flags these can also be specified in a file called .pgbrc located in the root of your app. This file should be in JSON format and an example is below:

{ "ignore": [ "node_modules", "platforms", "test" ] }

Other cli flags can also be specified in this file:

{ 
"ignore": [ "node_modules", "platforms", "test" ],
"ios-key": 12,
"share": true
}

2. Build

Just a minor update but pgb build command now supports a list of platforms:

> pgb build 12 ios windows # build only ios, windows
> pgb build 12 ios,windows # build only ios, windows
> pgb build 12 # build all platforms

Was There an August Update?

If you missed our August update, it is here. But in a nutshell:

  • we now support a GitHub app integration which gives you granular access on which apps we can access
  • downloaded app filenames now include app id and incremental build number
  • build badges are now available for your README

If you find a bug or have a feature request tell me about it here.

Follow me on twitter @brettrudd

--

--