generator-android-lib
Scaffold an Android library (
.aar
) with boilerplate code including CLI tasks that build, test, and deploy with quality gates, CI-services, and dependency management.
generator-android-lib
creates a base template to start a new Android library (.aar
).
$ npm install --global generator-android-lib
⚠️ 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:
*.
checkstyle
for code standardsPMD
for complexity analysisFindBugs
for potential defectsgithub-changelog-generator
README.md
with Badges
Once the project is scaffolded, inside the project folder run:
$ ./gradlew test
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
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 */
});
}
});
🐛 Debug
generator-android-lib
Running into problems? Read
- 📖 How to debug Yeoman generators for instructions on debugging with
node-inspector
and Chrome dev-tools.- 📖 Debugging Generators (official documentation).
Here's a list of our supported options:
boilerplate
(Boolean, default true) include or not the Android Studio directories and fileslinters
(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.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
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.
generator-android-lib
This generator was inspired by:
cesarferreira/generator-android-library
We originally forked this, but soon decided to start over: its dependencies are so outdated, refactoring would essentially be a rewrite. :person_frowning:xvik/generator-lib-java
Great features, Android's' idiosyncrasies demand different dependencies. 👽yeoman/generator-node
generator-android-lib
basically plagiarizes generator-node
. 😜Apache 2.0 Greg Swindle and Mukesh Korat.