Gulp Plugin for Adobe PhoneGap Build
This Gulp plugin was designed to automate the process of uploading application files to the now-defunct build.phonegap.com service and triggering cloud builds. While the package itself is available on npm at version 0.1.5, the core service it integrates with, Adobe PhoneGap Build, was officially discontinued by Adobe on October 1, 2020. This renders the plugin non-functional for its original purpose. The project was in 'BETA' and under 'active development' at the time of its last update, forking from `grunt-phonegap-build` to provide similar functionality for Gulp users. Its key differentiators were its direct integration with Gulp streams and the ability to configure various PhoneGap Build parameters like app ID, user credentials, target platforms, and signing keys directly within a `gulpfile.js`.
Common errors
-
Error: read ECONNRESET
cause Network connection issues, server-side closure, or the PhoneGap Build service being unavailable.fixThis error, particularly after October 2020, likely indicates that the `build.phonegap.com` service is no longer operational. The plugin cannot recover from this, and the underlying service is permanently offline. -
Error: access denied
cause Incorrect authentication credentials (user, password, or token) or the PhoneGap Build service denying access due to its shutdown.fixPrior to the shutdown, verify `user` and `appId` configurations. After October 2020, this error confirms the service is defunct, and the plugin is no longer usable.
Warnings
- breaking The Adobe PhoneGap Build cloud service, which this Gulp plugin integrates with, was officially discontinued on October 1, 2020. Consequently, `gulp-phonegap-build` is entirely non-functional as its target API no longer exists. There is no direct replacement service under the PhoneGap brand.
- gotcha Even when the service was active, omitting the `platforms` array in the configuration would prevent builds from being triggered due to an undocumented quirk in the PhoneGap API. This was a common source of confusion.
- gotcha When sourcing files for upload using `gulp.src`, the `{dot: true}` option was crucial to include hidden configuration files (e.g., `.pgbomit`) that PhoneGap Build might have relied upon. Forgetting this option could lead to unexpected build failures or misconfigurations on the PhoneGap Build server.
Install
-
npm install gulp-phonegap-build -
yarn add gulp-phonegap-build -
pnpm add gulp-phonegap-build
Imports
- phonegapBuild
import phonegapBuild from 'gulp-phonegap-build';
const phonegapBuild = require('gulp-phonegap-build');
Quickstart
var gulp = require('gulp');
var phonegapBuild = require('gulp-phonegap-build');
// NOTE: This plugin is non-functional as the Adobe PhoneGap Build service was discontinued on Oct 1, 2020.
// The example below demonstrates its intended usage for historical context.
gulp.task('phonegap-build-example', function () {
gulp.src('dist/**/*', {dot: true}) // {dot: true} is important to include files like .pgbomit
.pipe(phonegapBuild({
"isRepository": false, // Set to true if using a GitHub repository
"appId": "9876", // Replace with your actual PhoneGap Build App ID
"user": {
"token": "ABCD123409876XYZ" // Replace with your PhoneGap Build authentication token
},
"platforms": ['ios', 'android'], // Required to trigger builds due to API quirk
"download": {
"ios": 'dist/ios.ipa',
"android": 'dist/android.apk'
}
}))
.on('error', function(err) {
console.error('PhoneGap Build task failed:', err.message);
});
});
gulp.task('default', ['phonegap-build-example']);