npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-eha-cordova-build

v3.1.0

Published

Builds Sense Apps via Cordova

Downloads

19

Readme

grunt-eha-cordova-build

Build Status

Usage

Set Up:

  1. Install this module: npm install --save-dev grunt-eha-cordova-build

  2. Install cordova-android platform. This is done locally, so each app can chose different versions shuold they want to. npm install --save-dev cordova-android

  3. Generate the config.template.xml file: grunt ehaCordovaTemplate Modify config.template.xml after your needs. this file should be checked in in your version control.

  4. In your gruntfile, add

  grunt.loadNpmTasks('eha-cordova-build');

  grunt.config.init({
    ehaCordovaBuild: {
      options: {
        appdir: 'build-test',
        package: 'com.ehealthafrica.{%= country %}.buildtest',
        appname: 'Build Test',
        // Adapt this to what your apps build system is
        buildCmd: 'grunt build:{%=type%}:{%=country%}:{%=rebuild%}'
      }
    }
  });

Note that you need to use different delimiters, to get past the grunt initial expansion. See more info about the 'buildCmd' below

  1. Add a cordovaPlugins key in package.json, example
  "cordovaPlugins": {
    "cordova-plugin-crosswalk-webview": "^1.2.0",
    "cordova-plugin-dialogs": "^1.1.0",
    "cordova-plugin-google-analytics": "^0.7.1",
    "cordova-plugin-network-information": "^1.0.0",
    "cordova-plugin-vibration": "^1.1.0",
    "cordova-plugin-whitelist": "^1.0.0",
    "device-information": "https://github.com/vliesaputra/DeviceInformationPlugin",
    "phonegap-sms": "https://github.com/aharris88/phonegap-sms-plugin.git",
    "local-notifications": "https://github.com/sapk/cordova-plugin-local-notifications.git"
  },
  1. build with grunt ehaCordovaBuild:snapshot:country

Cordova Plugins

Cordova plugins are installed via a 'cordovaPlugins' key in package.json. See example above.

App Version

The app version is read from package.json

The 'buildCmd'

The 'buildCmd' property could be any bash command, that produces a 'dist' directory in your root folder. The simplest possible would be cp -r app dist. As long as it produces this directory, it can also be grunt commands, or whatever you want to use.

Travis Build

This module does not provide you with a travis build script. However, here's an example:

set -e

info() { echo "$0: $1"; }
error() { info "$1"; exit 1; }
build() { info "Performing $1 build"; }
skip() { info "${1}. Skipping build."; exit 0; }

[[ "$TRAVIS_PULL_REQUEST" == "false" ]] || {
  skip "This build was triggered by a pull request"
}

if [[ "$TRAVIS_TAG" ]]; then
  BUILD_STAGE="release"
elif [[ "$TRAVIS_BRANCH" == "develop" ]]; then
  BUILD_STAGE="snapshot"
elif [[ "$TRAVIS_BRANCH" == "staging" ]]; then
  BUILD_STAGE="staging"
else
  skip "Unsupported branch $TRAVIS_BRANCH and/or untagged commit"
fi

# Only build sl right now
grunt ehaCordovaBuild:$BUILD_STAGE:sl

# throw away app directory, we just want the APKs
rm -Rf build/biometrics

Note that the deletion of the bottom needs to be the same as the 'appdir' grunt option for ehaCordovaBuild