This repository has been archived by the owner on Oct 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
133 lines (114 loc) · 3.78 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
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
// build requirements
buildscript {
// build dependency repositories
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
// build dependencies
dependencies {
classpath 'com.android.tools.build:gradle:2.1.+' // android build tools
classpath 'io.fabric.tools:gradle:1.19.+'
}
}
// build plugins
apply from: 'git.gradle'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
// only import signing if available
if (file('signing.gradle').exists()) {
apply from: 'signing.gradle'
}
// application dependency repositories
repositories {
jcenter()
maven { url 'https://bitbucket.org/snapable/mvn-repo/raw/master/releases' } // analytics v3
maven { url 'https://bitbucket.org/snapable/mvn-repo/raw/master/snapshots' } // analytics v3
maven { url 'https://maven.fabric.io/public' }
}
// application dependencies
dependencies {
// libs folder
compile fileTree(dir: 'libs', include: ['*.jar'])
// internal projects
compile project(':snapable-java')
// support libraries
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
// project dependencies
compile 'com.jakewharton:disklrucache:2.0.2'
// ui
compile 'com.jakewharton:butterknife:6.1.0'
// analytics
compile('com.crashlytics.sdk.android:crashlytics:2.4.+@aar') {
transitive = true
}
compile 'com.google.android:analytics:3.01'
// logs
compile 'com.jakewharton.timber:timber:3.1.0'
// testing
// testCompile 'junit:junit:4.12'
// androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
// androidTestCompile 'com.android.support.test:runner:0.5'
// androidTestCompile 'com.android.support:support-annotations:23.4.0'
}
// android helpers
def getVersionCode = { ->
return gitCommitCount()
}
def getVersionName = { ->
def versionTag = gitTag() ?: ''
if (gitCurrentBranch() != 'master' || versionTag.length() < 1) {
return gitHash() + gitDirty()
} else {
return versionTag
}
}
// android build settings
android {
compileSdkVersion 21
buildToolsVersion "23.0.3"
defaultConfig {
applicationId 'ca.hasbrown.snapable'
versionCode = getVersionCode()
versionName = getVersionName()
minSdkVersion 15
targetSdkVersion 21
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
lintConfig file('lint.xml')
disable 'InvalidPackage'
}
// build types
buildTypes {
debug {
applicationIdSuffix '.debug'
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
buildConfigField 'boolean', 'API_DEV', 'true'
buildConfigField 'String', 'API_BASE_URL', '"https://api.snapable.com/private_v1/"'
buildConfigField 'String', 'API_KEY', '"removed"'
buildConfigField 'String', 'API_SECRET', '"removed"'
}
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
buildConfigField 'boolean', 'API_DEV', 'false'
buildConfigField 'String', 'API_BASE_URL', '"https://api.snapable.com/private_v1/"'
buildConfigField 'String', 'API_KEY', '"removed"'
buildConfigField 'String', 'API_SECRET', '"removed"'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}