-
Notifications
You must be signed in to change notification settings - Fork 153
/
build.gradle
74 lines (60 loc) · 2.66 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
apply plugin: 'com.android.library'
//File name for out put jar created
def jarFileName
dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
implementation 'com.android.support:support-annotations:22.2.0'
implementation 'com.crashlytics.sdk.android:answers-shim:0.0.6'
// --- optional dependencies -----
//Please note that the Branch SDK does not require any of the below optional dependencies to operate. This dependency is listed here so there will not be build errors,
// but the library is *not* added to your app unless you do so yourself. Please check the code in gradle-mvn-push script to see how this works
implementation 'com.google.firebase:firebase-appindexing:10.0.1'
implementation 'com.android.installreferrer:installreferrer:1.0'
}
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 15
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionName project.VERSION_NAME
versionCode Integer.parseInt(project.VERSION_CODE)
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['resources']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
androidTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
lintOptions {
abortOnError false
}
}
//------------- Jar Generation code. ---------------//
//Run makeJar to create a jar file for SDK to the route directory
task clearJar(type: Delete) {
delete 'build/libs/'+ jarFileName
}
task makeJar(type: Copy) {
from('build/intermediates/intermediate-jars/release/')
into('../')
include('classes.jar')
rename ('classes.jar', 'Branch-'+project.VERSION_NAME+'.jar')
}
makeJar.dependsOn(clearJar, build)
apply from: 'https://raw.githubusercontent.com/BranchMetrics/GradleToMavenOptionalDependencies/master/gradle-maven-push.gradle'