-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbuild.gradle
More file actions
185 lines (158 loc) · 6.3 KB
/
Copy pathbuild.gradle
File metadata and controls
185 lines (158 loc) · 6.3 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
apply plugin: 'com.android.library'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:4.1.1"
}
}
allprojects {
repositories {
maven { url "https://dl.google.com/dl/android/maven2/" }
maven { url "http://dl.bintray.com/jasonrogena/kujaku" }
}
}
apply plugin: 'realm-android'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
version '0.2.6-11-3'
project.version = this.version
task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
}
artifacts {
archives sourceJar
}
publishing {
publications {
Production(MavenPublication) {
artifact("$buildDir/outputs/aar/library-release.aar")
artifact(sourceJar)
groupId 'io.ona.kujaku'
artifactId 'library'
version this.version
//The publication doesn't know about our dependencies, so we have to manually add them to the pom
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.compile.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
bintray {
// Get Bintray credential from environment variable
user = System.getenv('BINTRAY_USER') // Get bintray User
key = System.getenv('BINTRAY_KEY') // Get bintray Secret Key
configurations = ['archives']
pkg {
repo = 'kujaku'
name = project.name
userOrg = 'jasonrogena'
licenses = ['Apache-2.0']
desc = 'Kujaku library'
websiteUrl = "https://github.com/jasonrogena"
publish = true
vcsUrl = "https://github.com/onaio/kujaku.git"
version {
name = this.version
desc = "Kujaku library version ${this.version}"
released = new Date()
vcsTag = this.version
}
}
publications = ['Production']
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName this.version
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (project.rootProject.file("local.properties").exists()) {
Properties properties = new Properties()
properties.load(project.rootProject.file("local.properties").newDataInputStream())
if (properties != null &&
properties.containsKey("mapbox.sdk.token")) {
buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", properties["mapbox.sdk.token"]
} else {
println("One of the required config variables is not set in your local.properties");
buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\""
}
} else {
println("local.properties does not exist");
buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\""
}
}
debug {
if (project.rootProject.file("local.properties").exists()) {
Properties properties = new Properties()
properties.load(project.rootProject.file("local.properties").newDataInputStream())
if (properties != null &&
properties.containsKey("mapbox.sdk.token")) {
buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", properties["mapbox.sdk.token"]
} else {
println("One of the required config variables is not set in your local.properties");
buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\""
}
} else {
println("local.properties does not exist");
buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\""
}
}
}
lintOptions {
abortOnError false
}
}
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:support-v4:26.1.0'
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.2.0-beta.3@aar') {
transitive = true;
exclude group: 'com.android.support', module: 'support-v4'
}
compile('io.ona.kujaku:utils:0.2.6-43-1') {
transitive = true;
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-sdk'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.cocoahero.android:geojson:1.0.1@jar'
compile 'com.android.volley:volley:1.0.0'
compile 'com.snatik:storage:2.1.0'
compile group: 'joda-time', name: 'joda-time', version: '2.9.9'
// Info Window dependencies
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.5.1'
testCompile 'org.robolectric:shadows-support-v4:3.4-rc2'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile "org.powermock:powermock-module-junit4:1.6.2"
testCompile "org.powermock:powermock-module-junit4-rule:1.6.2"
testCompile "org.powermock:powermock-api-mockito:1.6.2"
testCompile "org.powermock:powermock-classloading-xstream:1.6.2"
androidTestCompile 'org.mockito:mockito-android:2.7.22'
}