aboutsummaryrefslogtreecommitdiffstats
path: root/android/build.gradle
blob: 33b644358fbfd69d3b12378b04bc0ad2c0714bb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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/test/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'
            }

            licenses {
                license {
                    name 'GPLv3'
                    url 'https://www.gnu.org/licenses/gpl-3.0.txt'
                    distribution 'repo'
                }
            }

            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"
        }
    }
}