-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle
115 lines (98 loc) · 3.2 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
import java.util.regex.Pattern
project.ext {
versionCode = '063'
versionName = '0.6.3'
archivesBaseName = project.name + '-' + project.versionName
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
}
}
task update { // Task to update version in accessory filter
def accessoryFile = file('res/xml/accessory_filter.xml')
def accessoryText = accessoryFile.getText()
println 'Updating accessory filter version to: ' + project.versionName
def version = Pattern.compile('\"Balanduino\" version=\"(.*?)\"').matcher(accessoryText)
accessoryText = version.replaceAll('\"Balanduino\" version=\"' + project.versionName + '\"')
accessoryFile.write(accessoryText)
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
targetSdkVersion 22
versionName = project.versionName
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
productFlavors {
basic {
minSdkVersion 10
versionCode = Integer.parseInt('1000' + project.versionCode)
}
usb {
minSdkVersion 12
versionCode = Integer.parseInt('1200' + project.versionCode)
}
}
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
basic {
java.srcDirs = ['flavors/basic/src']
res.srcDirs = ['flavors/basic/res']
}
usb {
manifest.srcFile 'flavors/usb/AndroidManifest.xml'
java.srcDirs = ['flavors/usb/src']
res.srcDirs = ['flavors/usb/res']
}
}
}
repositories {
jcenter()
maven { url 'libs' }
}
dependencies {
compile 'com.android.support:support-v4:22.0.0'
compile 'com.jjoe64:graphview:3.1.4'
compile 'com.viewpagerindicator:viewpagerindicator:2.4.1'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
usbCompile 'com.physicaloid:physicaloid:1.0' // Only supported on API level above 12
}
// These values are all set in my global gradle.properties file
if (project.hasProperty('storeFile') && project.hasProperty('storePassword') && project.hasProperty('keyAlias') && project.hasProperty('keyPassword')) {
android.signingConfigs.release.storeFile = file(storeFile)
android.signingConfigs.release.storePassword = storePassword
android.signingConfigs.release.keyAlias = keyAlias
android.signingConfigs.release.keyPassword = keyPassword
} else {
android.buildTypes.release.signingConfig = null
}
// Releasing:
// 1. Update versionName and versionCode
// 2. Run './gradlew clean build'
// 3. Move APK to releases directory
// 4. Upload to Github and create tag
// * Upload APK to release tab on Github as well
// 5. Upload to Google Play Store
// * Also take new screenshots if necessary
// 6. Update ADK version in Balanduino firmware