Skip to content

gregswindle/generator-android-lib

Repository files navigation

generator-android-lib

Android Bot Scaffold an Android library (.aar) with boilerplate code including CLI tasks that build, test, and deploy with quality gates, CI-services, and dependency management.

License NPM version Build Status Coverage percentage
NSP Status Dependency Status Dependency Status

Table of contents

1. Features

generator-android-lib creates a base template to start a new Android library (.aar).

2. Installation

$ npm install --global generator-android-lib

3. Usage

⚠️ This template generates files in the current directory.

Be sure to change to a new directory first if you don't want to overwrite existing files.

$ yo android-lib

That'll generate a project with all the common tools setup. This includes:

3.1. Running tests

Once the project is scaffolded, inside the project folder run:

$ ./gradlew test

3.2. Publishing your library

Once your tests are passing (ideally with Travis CI and and Coveralls green runs), you might be ready to publish your code to JCenter. We recommend you using npm version to tag release correctly.

$ # TODO: add version bump command
$ git push --follow-tags
# ATTENTION: There is no turning back here.
$ # TODO: add publish command

4. Extend this generator

First of all, make sure you're comfortable with Yeoman composability feature. Then in your own generator:

var Generator = require('yeoman-generator');

module.exports = class extends Generator({
  default() {
    this.composeWith(require.resolve('generator-android-lib/generators/app'), {
      /* provide the options you want */
    });
  }
});

4.1. Debugging

πŸ› Debug generator-android-lib

Running into problems? Read

  1. πŸ“– How to debug Yeoman generators for instructions on debugging with node-inspector and Chrome dev-tools.
  2. πŸ“– Debugging Generators (official documentation).

4.2. Options

Here's a list of our supported options:

  • boilerplate (Boolean, default true) include or not the Android Studio directories and files
  • linters (Boolean, default true) include or not checkstyle, PMD, and FindBugs
  • git (Boolean, default true) include or not the git files (.gitattributes, .gitignore).
  • license (Boolean, default true) include or not a LICENSE file.
  • travis (Boolean, default true) include or not a .travis.yml file.
  • githubAccount (String) Account name for GitHub repo location.
  • readme (String) content of the README.md file. Given this option, generator-android-lib will still generate the title (with badges) and the license section.

5. Sub-generators

If you don't need all the features provided by the main generator, you can still use a limited set of features by composing with our sub generators directly.

Remember you can see the options of each sub generators by running yo android-lib:sub --help.

  • android-lib:boilerplate
  • android-lib:linters
  • android-lib:git
  • android-lib:security installs the OWASP LAPSE+ Project
  • android-lib:readme

6. Contributors

6.1. Authors

6.2. You? Contribute to generator-vz-lib-android

We warmly welcome collaboration with the inclusive Contributor Covenant Code of Conduct.

If you want help us out with defect reports, documentation, development, or testing, please read the CONTRIBUTING document.

6.3. About generator-android-lib

This generator was inspired by:

7. License

Apache 2.0 Β© Greg Swindle and Mukesh Korat.


Greenkeeper badge