Some demonstrate for gradle.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
art
sample-flat-aar
sample-split-aar
README.md

README.md

GRADLE SAMPLE

Some demonstrate for using gradle.

I. Publish Multiple Modules

In this demonstrate we just want to publish two module(A contains B) to the Nexus.

1. Flat AAR

This way is through the adwiv/android-flat-aar.

The final architecutre in maven Nexus would be as follows:

The demonstrate is in the sample-flat-aar, as you can see, in this way our local project can split two modules: 'api' and 'impl' and 'impl' module dependent 'api' module, when we publish 'impl' to the Nexus, the flat-aar script will assemble all stuff in the 'api' into the 'impl' aar directly.

Sample Checkout

  • Build 'api': On the 'api/' folder and execute gradle clean build publishToMavenLocal, then checkout the result stuff on the ~/.m2/repository/cn/dreamtobe/flataar/sample/flataar-sample-api.
  • Build 'impl': On the 'impl/' folder and execute gradle publishToMavenLocal, then checkout the result stuff on the ~/.m2/repository/cn/dreamtobe/flataar/sample/flataar-sample-impl.

Attention

In this sample we decalre all common variable params in the project gradle.properties. and declare the each module special artifact id in the build.gradle of each module.

Script File

2. Official Way

This way is through the 35.2.5. Publishing multiple modules.

The demonstrate is in the sample-official-way, in this way, our local project just has one module: 'library', but when we publish it to the Nexus, we can split it to two part: 'api' and 'impl'.

Sample Checkout

Just execute gradle clean build publishToMavenLocal. Check out result stuff on the following folders:

  • ~/.m2/repository/cn/dreamtobe/splitaar/sample/splitaar-sample-api
  • ~/.m2/repository/cn/dreamtobe/splitaar/sample/splitaar-sample-impl

Script File


LICENSE

© 2016, Jacksgong(blog.dreamtobe.cn). Licensed under the Creative Commons Attribution-NonCommercial 3.0 license (This license lets others remix, tweak, and build upon a work non-commercially, and although their new works must also acknowledge the original author and be non-commercial, they don’t have to license their derivative works on the same terms). http://creativecommons.org/licenses/by-nc/3.0/