11import java.text.SimpleDateFormat
22
33apply plugin : ' com.android.application'
4- apply plugin : ' crashlytics '
4+ apply plugin : ' io.fabric '
55
6- def versionMajor = 1
7- def versionMinor = 6
8- def versionPatch = 4
9- def versionBuild = 0
6+ def versionMajor = 2
7+ def versionMinor = 0
8+ def versionPatch = 0
9+ def versionBuild = 7
1010
1111def buildTime () {
12- def df = new SimpleDateFormat (" yyyyMMdd" )
12+ def df = new SimpleDateFormat (" yyyyMMdd HH:mm 'UTC' " )
1313 df. setTimeZone(TimeZone . getTimeZone(" UTC" ))
1414 return df. format(new Date ())
1515}
@@ -20,18 +20,20 @@ def gitSha() {
2020
2121
2222android {
23- compileSdkVersion 19
24- buildToolsVersion " 21.1.2 " // maintain this version until we migrate to ActionBarCompat
23+ compileSdkVersion 23
24+ buildToolsVersion " 23.0.1 "
2525 defaultConfig {
2626 applicationId " org.gnucash.android"
2727 testApplicationId ' org.gnucash.android.test'
2828 minSdkVersion 10
29- targetSdkVersion 19
29+ targetSdkVersion 23 // robolectric tests only support up to API level 21 at the moment
3030 versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
3131 versionName " ${ versionMajor} .${ versionMinor} .${ versionPatch} "
3232 resValue " string" , " app_version_name" , " ${ versionName} "
3333 resValue " string" , " app_minor_version" , " ${ versionMinor} "
34- buildConfigField " boolean" , " USE_CRASHLYTICS" , " false"
34+ buildConfigField " boolean" , " CAN_REQUEST_RATING" , " false"
35+ buildConfigField " String" , " BUILD_TIME" , " \" ${ buildTime()} \" "
36+
3537 if (project. hasProperty(" RELEASE_DROPBOX_APP_KEY" )){
3638 resValue " string" , " dropbox_app_key" , RELEASE_DROPBOX_APP_KEY
3739 resValue " string" , " dropbox_app_secret" , RELEASE_DROPBOX_APP_SECRET
@@ -108,11 +110,12 @@ android {
108110 resValue " string" , " app_name" , " GnuCash - beta"
109111 versionName " ${ versionMajor} .${ versionMinor} .${ versionPatch} -beta${ versionBuild} "
110112 resValue " string" , " app_version_name" , " ${ versionName} "
111- buildConfigField " boolean" , " USE_CRASHLYTICS" , " true"
112113 }
113114
114115 production {
115116 resValue " string" , " app_name" , " GnuCash"
117+ buildConfigField " boolean" , " CAN_REQUEST_RATING" , " true"
118+ ext. enableCrashlytics = false
116119 }
117120
118121 }
@@ -129,11 +132,18 @@ def adb = android.getAdbExe().toString()
129132
130133afterEvaluate {
131134 task grantAnimationPermissionDevel(type : Exec , dependsOn : ' installDevelopmentDebug' ) { // or install{productFlavour}{buildType}
132- commandLine " $adb shell pm grant $android . productFlavors . development . applicationId android.permission.SET_ANIMATION_SCALE" . split(' ' )
135+ commandLine " $adb " , ' devices'
136+ standardOutput = new ByteArrayOutputStream ()
137+
138+ String output = standardOutput. toString()
139+ output. eachLine {
140+ def serial = it. split(" \\ s" )[0 ]
141+ commandLine " $adb -s $serial shell pm grant $android . productFlavors . development . applicationId android.permission.SET_ANIMATION_SCALE" . split(' ' )
142+ }
133143 }
134144
135145 task grantAnimationPermissionProduction(type : Exec , dependsOn : ' installProductionDebug' ){
136- commandLine " $adb shell pm grant $android . defaultConfig . applicationId android.permission.SET_ANIMATION_SCALE" . split(' ' )
146+ commandLine " $adb -e shell pm grant $android . defaultConfig . applicationId android.permission.SET_ANIMATION_SCALE" . split(' ' )
137147 }
138148 // When launching individual tests from Android Studio, it seems that only the assemble tasks
139149 // get called directly, not the install* versions
@@ -148,29 +158,55 @@ afterEvaluate {
148158 }
149159}
150160
161+ def androidSupportVersion = " 22.2.1"
162+ def androidEspressoVersion = " 2.2"
163+ def androidSupportTestVersion = " 0.3"
151164
152165dependencies {
153166 compile fileTree(dir : ' libs' , include : [' *.jar' ])
154- compile(' com.android.support:support-v4:22.1.1' ,
155- ' com.actionbarsherlock:actionbarsherlock:4.4.0@aar' ,
167+ compile(' com.android.support:support-v4:' + androidSupportVersion,
168+ ' com.android.support:appcompat-v7:' + androidSupportVersion,
169+ ' com.android.support:design:' + androidSupportVersion,
170+ ' com.android.support:cardview-v7:' + androidSupportVersion,
171+ ' com.android.support:recyclerview-v7:' + androidSupportVersion,
156172 ' com.viewpagerindicator:library:2.4.1@aar' ,
157- ' com.doomonafireball .betterpickers:library:1.6.0 ' ,
158- ' com.commonsware.cwac:merge:1.1.+ ' ,
159- ' com.github.PhilJay:MPAndroidChart:v2.1.0 ' ,
173+ ' com.code-troopers .betterpickers:library:2.0.3 ' ,
174+ ' org.jraf:android-switch-backport:2.0.1@aar ' ,
175+ ' com.github.PhilJay:MPAndroidChart:v2.1.3 ' ,
160176 ' joda-time:joda-time:2.7' ,
177+ ' org.ocpsoft.prettytime:prettytime:3.2.7.Final' ,
161178 ' com.google.android.gms:play-services-drive:7.0.0' ,
162- ' com.crashlytics.android:crashlytics:1.+'
179+ ' com.jakewharton:butterknife:7.0.1' ,
180+ ' com.kobakei:ratethisapp:0.0.3' ,
181+ ' com.squareup:android-times-square:1.6.4@aar' ,
182+ ' com.github.techfreak:wizardpager:1.0.0' ,
183+ ' net.objecthunter:exp4j:0.4.5'
163184 )
164185
165- testCompile(' org.robolectric:robolectric:3.0-rc2' ,
186+ compile (' com.uservoice:uservoice-android-sdk:1.2.+' ) {
187+ exclude module : ' commons-logging'
188+ exclude module : ' httpcore'
189+ exclude module : ' httpclient'
190+ }
191+
192+ compile(' com.crashlytics.sdk.android:crashlytics:2.5.0@aar' ) {
193+ transitive = true ;
194+ }
195+
196+ testCompile(' org.robolectric:robolectric:3.0' ,
166197 ' junit:junit:4.12' ,
167198 ' org.assertj:assertj-core:1.7.1'
168199 )
169- androidTestCompile ' com.android.support.test:runner:0.2'
170- androidTestCompile ' com.android.support.test:rules:0.2'
171- androidTestCompile(' com.squareup.assertj:assertj-android:1.0.0' ){
200+ androidTestCompile (' com.android.support:support-annotations:' + androidSupportVersion,
201+ ' com.android.support.test:runner:' + androidSupportTestVersion,
202+ ' com.android.support.test:rules:' + androidSupportTestVersion,
203+ ' com.android.support.test.espresso:espresso-core:' + androidEspressoVersion)
204+ androidTestCompile (' com.android.support.test.espresso:espresso-contrib:' + androidEspressoVersion) {
205+ exclude group : ' com.android.support' , module : ' support-v4'
206+ exclude module : ' recyclerview-v7'
207+ }
208+
209+ androidTestCompile(' com.squareup.assertj:assertj-android:1.1.0' ){
172210 exclude group : ' com.android.support' , module :' support-annotations'
173211 }
174- androidTestCompile (' com.android.support.test.espresso:espresso-core:2.1' )
175- androidTestCompile ' com.android.support:support-annotations:22.1.1'
176- }
212+ }
0 commit comments