forked from mixpanel/mixpanel-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
105 lines (93 loc) · 3.11 KB
/
build.gradle
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
apply plugin: 'android-library'
apply plugin: 'maven'
apply plugin: 'signing'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
android {
compileSdkVersion 18
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 18
testPackageName "com.mixpanel.android"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
}
def isReleaseVersion() {
return !version.endsWith("SNAPSHOT");
}
configurations {
archives {
extendsFrom configurations.default
}
}
if (isReleaseVersion()) {
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
}
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
pom.project {
name project.name
packaging 'aar'
description 'An Android library for Mixpanel Analytics \n' +
'http://mixpanel.com/android-analytics/'
url 'https://github.com/mixpanel/mixpanel-android'
scm {
url 'http://github.com/mixpanel/mixpanel-android'
connection 'scm:git:http://github.com/mixpanel/mixpanel-android'
developerConnection 'scm:git:[email protected]:mixpanel/mixpanel-android.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/license/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'jbwyme'
name 'Josh Wymer'
email '[email protected]'
}
developer {
id 'joeatwork'
name 'Joe Bowers'
email '[email protected]'
}
}
}
if (isReleaseVersion()) {
/**
* In order to do nexus deploys, you'll need to setup a gradle.properties file in $HOME/.gradle
* with the following properties. You'll need the mixpanel.key file and then import it using GnuPG
* which will provide you with the keyId and the secring.gpg file
* signing.keyId=
* signing.password=
* signing.secretKeyRingFile=
*
* sonatypeRepo=https://oss.sonatype.org/service/local/staging/deploy/maven2/
* sonatypeUsername=
* sonatypePassword=
*/
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
} else {
repository(url:'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath)
}
}
}