-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
102 lines (86 loc) · 3.04 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
apply plugin: 'com.android.application'
apply from: "$rootDir/android-common-task.gradle"
def versionMajor = 1
def versionMinor = 0
def versionPatch = 1
def versionBuild = 0 // bump for dogfood builds, public betas, etc.
archivesBaseName = "demo"
dependencies {
compile "com.android.support:support-v4:${supportPackageVersion}"
compile project(':library:ActionBarSherlock:library')
compile project(':library:UnifiedPreference:library')
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}" + getGitHash()
applicationId = 'com.corner23.android.demo'
}
project.ext.appStartupClassName = 'com.corner23.android.demo.MainActivity'
productFlavors {
rock
amazonFree {
applicationId = 'com.corner23.android.demo.amazon.free'
}
amazonPaid {
applicationId = 'com.corner23.android.demo.amazon.paid'
}
playFree {
applicationId = 'com.corner23.android.demo.play.free'
}
playPaid {
applicationId = 'com.corner23.android.demo.play.paid'
}
}
signingConfigs {
release
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-SNAPSHOT"
}
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFile 'proguard-android.txt'
}
}
// setup your extra resources here, if not defined the default debug and
// release sourceSets will be used
project.ext.amazonPaid = [
debugManifest: 'src/amazonPaidDebug/AndroidManifest.xml',
releaseManifest: 'src/amazonPaidRelease/AndroidManifest.xml',
debugRes: ['src/amazonPaidDebug/res'],
releaseRes: ['src/amazonPaidRelease/res']
]
project.ext.amazonFree = [
debugManifest: 'src/amazonFreeDebug/AndroidManifest.xml',
releaseManifest: 'src/amazonFreeRelease/AndroidManifest.xml',
debugRes: ['src/amazonFreeDebug/res'],
releaseRes: ['src/amazonFreeRelease/res']
]
}
clean.doLast {
project.delete "$rootProject.projectDir/out"
}
def env = System.getProperties()
if (env['com.android.studio.gradle.project.path'] != null) {
project.ext.buildFromAndroidStudio = true
}
if (project.hasProperty('keyAlias') &&
project.hasProperty('storeFile') &&
project.hasProperty('storePassword') &&
project.hasProperty('keyPassword')) {
android.signingConfigs.release.keyAlias = keyAlias
android.signingConfigs.release.storeFile = file(storeFile)
android.signingConfigs.release.storePassword = storePassword
android.signingConfigs.release.keyPassword = keyPassword
} else {
android.buildTypes.release.signingConfig = null
}