wordpress-mobile/WordPress-Android — pull request #1593 by beaucollins (2014-07-07 18:54:44+00:00)
Title: Gradle plugin for setting up WordPress libraries

First pass at making local WordPress library development a simple affair.

Adds a custom Gradle plugin in the root `build.gradle` file. With a small amount of configuration, the project will know how to set up local versions of the repository.

## Configuration

In `WordPress/build.gradle` configure the library in the `wordpress` block

```groovy
wordpress {
utils {
repo "WordPress-Android-Utils"
subproject "WordPressUtils"
artifact "org.wordpress:utils:1.0.+"
}
}
```

This will need a corresponding include in `settings.gradle`:

```groovy
include ':libs:utils:WordPressUtils'
```

Building the project with this configured `./gradlew assembleVanillaDebug` will by default just add the artifact from the `wordpress` config block to `debug` and `release` builds. If the plugin finds the corresponding repository checked out, it will use the artifact for release builds and the local source for debug builds.

## Cloning Libraries

If you want to develop the source locally, you can run the `devSetup` task: `./gradlew devSetup`

This wil create a `libs` directory and clone each project in the `wordpress` block using the provided configuration. It will do its best to figure out which repository to use.

1. A string with no slash ("/") is assumed to be in the WordPress-Mobile organization on github
2. A string with a single slash ("/") is assumed to be a Github repo
3. Otherwise provide a full git repo url.