forked from SandroMachado/android-jitpack-library-example
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
54 lines (48 loc) · 1.51 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
apply plugin: 'com.android.library'
apply plugin: 'android-maven'
android {
compileSdkVersion 19
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// multiple flavours. produces the following artifacts: -productionRelease.aar, -sandboxRelease.aar, -productionDebug.aar, -sandboxDebug.aar
productFlavors {
production {
buildConfigField 'String', 'ENV', '"PRODUCTION"'
}
sandbox {
buildConfigField 'String', 'ENV', '"SANDBOX"'
}
}
// default build flavour
defaultPublishConfig "productionRelease"
// true to publish all flavour artifacts
publishNonDefault true
}
// Publish default flavour as main artifact, otherwise the maven pom is not generated
if( android.productFlavors.size() > 0 ) {
android.libraryVariants.all { variant ->
if( android.publishNonDefault && variant.name == android.defaultPublishConfig ) {
def bundleTask = tasks["bundle${name.capitalize()}"]
artifacts {
archives(bundleTask.archivePath) {
classifier null
builtBy bundleTask
}
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}