Tweak support maven repo generated on build server.

This is to better work with the SDK release process.

Change-Id: Ib5d7aa906a12b10fa9dcaf24c42350ca01609afd
diff --git a/build.gradle b/build.gradle
index 177350c..539f1a1 100644
--- a/build.gradle
+++ b/build.gradle
@@ -13,6 +13,7 @@
 ext.extraVersion = 9
 ext.supportRepoOut = ''
 ext.buildToolsVersion = '19.0.3'
+ext.buildNumber = Integer.toString(ext.extraVersion)
 
 /*
  * With the build server you are given two env variables.
@@ -24,6 +25,9 @@
 if (System.env.DIST_DIR != null && System.env.OUT_DIR != null) {
     buildDir = new File(System.env.OUT_DIR + '/gradle/frameworks/support/build').getCanonicalFile()
     project.ext.distDir = new File(System.env.DIST_DIR).getCanonicalFile()
+
+    // the build server does not pass the build number so we infer it from the last folder of the dist path.
+    ext.buildNumber = project.ext.distDir.getName()
 } else {
     buildDir = file('../../out/host/gradle/frameworks/support/build')
     project.ext.distDir = file('../../out/dist')
@@ -46,7 +50,7 @@
     from project.ext.supportRepoOut
     destinationDir project.ext.distDir
     into 'm2repository'
-    baseName = String.format("android_m2repository_r%02d", project.ext.extraVersion)
+    baseName = String.format("sdk-repo-linux-m2repository-%s", project.ext.buildNumber)
 }
 createArchive.dependsOn createRepository