0.2.0 • Published 7 years ago

grunt-cordova-api v0.2.0

Weekly downloads
2
License
-
Repository
github
Last release
7 years ago

grunt-cordova-api

A grunt task for running cordova commands.

Getting Started

This plugin requires Grunt >=0.4.5 and Cordova >=3.0.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-cordova-api --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-cordova-api');

The "cordova" task

Overview

In your project's Gruntfile, add a section named cordova to the data object passed into grunt.initConfig().

grunt.initConfig({
  cordova: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
});

Options

options.src

Type: String Default value: process.cwd()

Location of the cordova app root directory. (See directory structure)

options.cmd

Type: String

Cordova command. (See command list)

options.platforms

Type: Array

Cordova platforms.

options.opts

Type: Object

Cordova options. (See options)

Usage Examples

// all path options are relative to options.src
cordova: {
    options: {
        src: 'app/target',
    },
    prepare: {
        options: {
            cmd: 'prepare',
        },
    },
    build: {
        options: {
            cmd: 'build',
            platforms: ['ios', 'android'],
            opts: {
                debug: true,
                release: false,
                device: true,
            },
        },
    },
}

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

Github releases