Rework build.gradle to use old maven plugin

Upgrade android build tools to 0.6.x

Modify logic for publishing to MavenLocal:

1. When an environment variable BUILD_NUMBER is set, we assume the build
is running on Jenkins and configure uploadArtifacts to publish release
builds to Sonatype/MavenCentral and discard snapshot builds.
local maven cache.

2. When BUILD_NUMBER is set, configure uploadArtifacts to publish
files to Maven local cache.
Setup publishing to Sonatype OSS in build.gradle
WIP