aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.gradle46
-rw-r--r--common/build.gradle55
-rw-r--r--ddms/.gitignore1
-rw-r--r--ddms/libs/ddmlib/build.gradle77
-rw-r--r--device_validator/dvlib/build.gradle55
-rw-r--r--layoutlib_api/build.gradle55
-rw-r--r--manifmerger/build.gradle60
-rw-r--r--release.gradle5
-rw-r--r--release.md6
-rw-r--r--sdkmanager/libs/sdklib/build.gradle59
-rw-r--r--settings.gradle9
11 files changed, 397 insertions, 31 deletions
diff --git a/build.gradle b/build.gradle
index 858b4d0..982e93a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,18 +1,46 @@
-allprojects {
+project.buildDir = 'gradle_build'
+
+subprojects {
+ apply plugin: 'java'
apply plugin: 'maven'
+ apply plugin: 'signing'
repositories {
mavenCentral()
}
- version = '21.0-SNAPSHOT'
+ group = 'com.android.tools'
+
+ project.ext {
+ baseVersion = '21.0'
+ }
+
+ // custom tasks for creating source/javadoc jars
+ task sourcesJar(type: Jar, dependsOn:classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+ }
- uploadArchives {
- repositories {
- mavenDeployer {
- repository(url: uri("$rootDir/../out/host/repo"))
- }
- }
- }
+ task javadocJar(type: Jar, dependsOn:javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+ }
+
+ // add javadoc/source jar tasks as artifacts
+ artifacts {
+ archives jar
+
+ archives sourcesJar
+ archives javadocJar
+ }
+
+ task publishLocal(type: Upload) {
+ configuration = configurations.archives
+ repositories {
+ mavenDeployer {
+ repository(url: uri("$rootDir/../out/host/repo"))
+ }
+ }
+ }
}
diff --git a/common/build.gradle b/common/build.gradle
index 2b043fd..258f5e0 100644
--- a/common/build.gradle
+++ b/common/build.gradle
@@ -1,12 +1,18 @@
-apply plugin: 'java'
-
dependencies {
compile 'com.google.guava:guava:13.0.1'
testCompile 'junit:junit:3.8.1'
}
-group = 'com.android.tools'
+def getVersion() {
+ if (project.has("release")) {
+ return project.ext.baseVersion
+ }
+
+ return project.ext.baseVersion + '-SNAPSHOT'
+}
+
+version = getVersion()
archivesBaseName = 'common'
sourceSets {
@@ -27,3 +33,46 @@ sourceSets {
}
}
}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment ->
+ if (!project.has("release")) {
+ throw new StopExecutionException("uploadArchives must be called with the release.gradle init script")
+ }
+
+ signing.signPom(deployment)
+ }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ name 'Android Tools common library'
+ description 'common library used by other Android tools libraries.'
+ url 'http://tools.android.com'
+ inceptionYear '2007'
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "https://android.googlesource.com/platform/sdk"
+ connection "git://android.googlesource.com/platform/sdk.git"
+ }
+ developers {
+ developer {
+ name 'The Android Open Source Project'
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/ddms/.gitignore b/ddms/.gitignore
index 6d833a0..1ef345b 100644
--- a/ddms/.gitignore
+++ b/ddms/.gitignore
@@ -1,4 +1,5 @@
app/bin
libs/ddmlib/bin
+libs/ddmlib/build
libs/ddmuilib/bin
diff --git a/ddms/libs/ddmlib/build.gradle b/ddms/libs/ddmlib/build.gradle
new file mode 100644
index 0000000..d765588
--- /dev/null
+++ b/ddms/libs/ddmlib/build.gradle
@@ -0,0 +1,77 @@
+dependencies {
+ testCompile 'org.easymock:easymock:3.1'
+ testCompile 'junit:junit:3.8.1'
+}
+
+def getVersion() {
+ if (project.has("release")) {
+ return project.ext.baseVersion
+ }
+
+ return project.ext.baseVersion + '-SNAPSHOT'
+}
+
+version = getVersion()
+archivesBaseName = 'ddmlib'
+
+sourceSets {
+ main {
+ java {
+ srcDir 'src'
+ }
+ resources {
+ srcDir 'src'
+ }
+ }
+ test {
+ java {
+ srcDir 'tests/src'
+ }
+ resources {
+ srcDir 'tests/src'
+ }
+ }
+}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment ->
+ if (!project.has("release")) {
+ throw new StopExecutionException("uploadArchives must be called with the release.gradle init script")
+ }
+
+ signing.signPom(deployment)
+ }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ name 'Android Tools ddmlib'
+ description 'Library providing APIs to talk to Android devices'
+ url 'http://tools.android.com'
+ inceptionYear '2007'
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "https://android.googlesource.com/platform/sdk"
+ connection "git://android.googlesource.com/platform/sdk.git"
+ }
+ developers {
+ developer {
+ name 'The Android Open Source Project'
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/device_validator/dvlib/build.gradle b/device_validator/dvlib/build.gradle
index 36e0910..0681e75 100644
--- a/device_validator/dvlib/build.gradle
+++ b/device_validator/dvlib/build.gradle
@@ -1,10 +1,16 @@
-apply plugin: 'java'
-
dependencies {
testCompile 'junit:junit:3.8.1'
}
-group = 'com.android.tools'
+def getVersion() {
+ if (project.has("release")) {
+ return project.ext.baseVersion
+ }
+
+ return project.ext.baseVersion + '-SNAPSHOT'
+}
+
+version = getVersion()
archivesBaseName = 'dvlib'
sourceSets {
@@ -25,3 +31,46 @@ sourceSets {
}
}
}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment ->
+ if (!project.has("release")) {
+ throw new StopExecutionException("uploadArchives must be called with the release.gradle init script")
+ }
+
+ signing.signPom(deployment)
+ }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ name 'Android Tools dvlib'
+ description 'A Library to manage the Android device database XML files.'
+ url 'http://tools.android.com'
+ inceptionYear '2007'
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "https://android.googlesource.com/platform/sdk"
+ connection "git://android.googlesource.com/platform/sdk.git"
+ }
+ developers {
+ developer {
+ name 'The Android Open Source Project'
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/layoutlib_api/build.gradle b/layoutlib_api/build.gradle
index 5534fdb..24e1a65 100644
--- a/layoutlib_api/build.gradle
+++ b/layoutlib_api/build.gradle
@@ -1,5 +1,3 @@
-apply plugin: 'java'
-
dependencies {
compile project(':common')
compile 'kxml2:kxml2:2.3.0'
@@ -7,7 +5,15 @@ dependencies {
testCompile 'junit:junit:3.8.1'
}
-group = 'com.android.tools'
+def getVersion() {
+ if (project.has("release")) {
+ return project.ext.baseVersion
+ }
+
+ return project.ext.baseVersion + '-SNAPSHOT'
+}
+
+version = getVersion()
archivesBaseName = 'layoutlib_api'
sourceSets {
@@ -28,3 +34,46 @@ sourceSets {
}
}
}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment ->
+ if (!project.has("release")) {
+ throw new StopExecutionException("uploadArchives must be called with the release.gradle init script")
+ }
+
+ signing.signPom(deployment)
+ }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ name 'Android Tools layoutlib_api'
+ description 'Library to use the rendering library for Android layouts: layoutlib'
+ url 'http://tools.android.com'
+ inceptionYear '2007'
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "https://android.googlesource.com/platform/sdk"
+ connection "git://android.googlesource.com/platform/sdk.git"
+ }
+ developers {
+ developer {
+ name 'The Android Open Source Project'
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/manifmerger/build.gradle b/manifmerger/build.gradle
index c5f2aeb..57c930b 100644
--- a/manifmerger/build.gradle
+++ b/manifmerger/build.gradle
@@ -1,16 +1,21 @@
-apply plugin: 'java'
-
dependencies {
compile project(':common')
- compile project(':sdkmanager:libs:sdklib')
+ compile project(':sdklib')
compile 'kxml2:kxml2:2.3.0'
-// not sure why the following line works in sdklib but not here...
-// testCompile project(':sdkmanager:libs:sdklib').sourceSets.test.output
+ testCompile project(':sdklib').sourceSets.test.output
testCompile 'junit:junit:3.8.1'
}
-group = 'com.android.tools'
+def getVersion() {
+ if (project.has("release")) {
+ return project.ext.baseVersion
+ }
+
+ return project.ext.baseVersion + '-SNAPSHOT'
+}
+
+version = getVersion()
archivesBaseName = 'manifest-merger'
sourceSets {
@@ -31,3 +36,46 @@ sourceSets {
}
}
}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment ->
+ if (!project.has("release")) {
+ throw new StopExecutionException("uploadArchives must be called with the release.gradle init script")
+ }
+
+ signing.signPom(deployment)
+ }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ name 'Android Tools Manifest Merger library'
+ description 'A Library to merge Android manifests.'
+ url 'http://tools.android.com'
+ inceptionYear '2007'
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "https://android.googlesource.com/platform/sdk"
+ connection "git://android.googlesource.com/platform/sdk.git"
+ }
+ developers {
+ developer {
+ name 'The Android Open Source Project'
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/release.gradle b/release.gradle
new file mode 100644
index 0000000..97da7d6
--- /dev/null
+++ b/release.gradle
@@ -0,0 +1,5 @@
+allprojects {
+ project.ext {
+ release = "true"
+ }
+} \ No newline at end of file
diff --git a/release.md b/release.md
new file mode 100644
index 0000000..8752d27
--- /dev/null
+++ b/release.md
@@ -0,0 +1,6 @@
+## Building a release version
+
+By default builds use the -SNAPSHOT version.
+To run a release build that remove the SNAPSHOT qualifier, run:
+
+gradle --init-script release.gradle <tasks> \ No newline at end of file
diff --git a/sdkmanager/libs/sdklib/build.gradle b/sdkmanager/libs/sdklib/build.gradle
index 3e200ae..ce03920 100644
--- a/sdkmanager/libs/sdklib/build.gradle
+++ b/sdkmanager/libs/sdklib/build.gradle
@@ -1,19 +1,25 @@
-apply plugin: 'java'
-
dependencies {
compile project(':layoutlib_api')
- compile project(':device_validator:dvlib')
+ compile project(':dvlib')
compile 'org.apache.commons:commons-compress:1.0'
compile 'org.apache.httpcomponents:httpclient:4.1.1'
compile 'org.apache.httpcomponents:httpmime:4.1'
compile 'org.apache.commons:commons-compress:1.0'
- testCompile project(':device_validator:dvlib').sourceSets.test.output
+ testCompile project(':dvlib').sourceSets.test.output
testCompile 'junit:junit:3.8.1'
}
-group = 'com.android.tools'
+def getVersion() {
+ if (project.has("release")) {
+ return project.ext.baseVersion
+ }
+
+ return project.ext.baseVersion + '-SNAPSHOT'
+}
+
+version = getVersion()
archivesBaseName = 'sdklib'
sourceSets {
@@ -34,3 +40,46 @@ sourceSets {
}
}
}
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment ->
+ if (!project.has("release")) {
+ throw new StopExecutionException("uploadArchives must be called with the release.gradle init script")
+ }
+
+ signing.signPom(deployment)
+ }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ name 'Android Tools sdklib'
+ description 'A library to parse and download the Android SDK.'
+ url 'http://tools.android.com'
+ inceptionYear '2007'
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ scm {
+ url "https://android.googlesource.com/platform/sdk"
+ connection "git://android.googlesource.com/platform/sdk.git"
+ }
+ developers {
+ developer {
+ name 'The Android Open Source Project'
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/settings.gradle b/settings.gradle
index 1a49ab9..4af1084 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,5 +1,10 @@
include 'common'
include 'layoutlib_api'
-include 'device_validator:dvlib'
-include 'sdkmanager:libs:sdklib'
+include 'dvlib'
+include 'sdklib'
+include 'ddmlib'
include 'manifmerger'
+
+project(':dvlib').projectDir = new File('device_validator/dvlib')
+project(':sdklib').projectDir = new File('sdkmanager/libs/sdklib')
+project(':ddmlib').projectDir = new File('ddms/libs/ddmlib') \ No newline at end of file