diff options
author | Moxie Marlinspike <moxie@thoughtcrime.org> | 2015-01-08 13:48:49 -0800 |
---|---|---|
committer | Moxie Marlinspike <moxie@thoughtcrime.org> | 2015-01-08 14:09:01 -0800 |
commit | 6445ea5f13850f42c3952bd06a2369317683ed88 (patch) | |
tree | f2bb37c8cf4710ff6a6a37a3e7e702c5a21ca504 /android/build.gradle | |
parent | a4d8f7f6a4c4e9e89db35f299e558dceee2362a1 (diff) |
Break project up into Java and Android build/test.
Diffstat (limited to 'android/build.gradle')
-rw-r--r-- | android/build.gradle | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 00000000..482532e3 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,96 @@ +buildscript { + repositories { + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:1.0.0' + } +} + +apply plugin: 'com.android.library' +apply plugin: 'maven' +apply plugin: 'signing' + +archivesBaseName = "axolotl-android" +version = version_number +group = group_info + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + + sourceSets { + androidTest { + java.srcDirs = ['src/androidTest/java', project(':tests').file('src/main/java')] + } + } + + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${archivesBaseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } +} + +repositories { + mavenCentral() + mavenLocal() +} + +dependencies { + compile "org.whispersystems:curve25519-android:${curve25519_version}" + compile (project(':java')) { + exclude group: 'org.whispersystems', module: 'curve25519-java' + } +} + +signing { + required { has("release") && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives +} + +uploadArchives { + configuration = configurations.archives + repositories.mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: sonatypeRepo) { + authentication(userName: whisperSonatypeUsername, password: whisperSonatypePassword) + } + + pom.project { + name 'axolotl-android' + packaging 'aar' + description 'Axolotl library for Android' + url 'https://github.com/WhisperSystems/libaxolotl-android' + + scm { + url 'scm:git@github.com:WhisperSystems/libaxolotl-android.git' + connection 'scm:git@github.com:WhisperSystems/libaxolotl-android.git' + developerConnection 'scm:git@github.com:WhisperSystems/libaxolotl-android.git' + } + + developers { + developer { + name 'Moxie Marlinspike' + } + } + } + } +} + +task installArchives(type: Upload) { + description "Installs the artifacts to the local Maven repository." + configuration = configurations['archives'] + repositories { + mavenDeployer { + repository url: "file://${System.properties['user.home']}/.m2/repository" + } + } +} + |