Skip to content

Commit

Permalink
Merge branch 'release/v2.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
codinguser committed Apr 4, 2017
2 parents 5a644f0 + 3192638 commit 07dc956
Show file tree
Hide file tree
Showing 137 changed files with 4,607 additions and 1,470 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
language: android
jdk: oraclejdk7
jdk: oraclejdk8
android:
components:
- platform-tools
- tools
- build-tools-23.0.3
- tools #not a typo. Needed for SDK update
- build-tools-24.0.3

# The SDK version used to compile your project
- android-23
- android-24

# Additional components
- extra-android-support
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-23
- addon-google_apis-google-24

# Specify at least one system image,
# if you need to run emulator(s) during your tests
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
Change Log
===============================================================================
Version 2.1.5 *(2017-04-04)*
----------------------------
* Fixed: Widget button for placeholder accounts tries to create transactions
* Fixed: App crashes when screen orientation changes while viewing reports (#633)
* Fixed: OFX exporter creates file even when there are no transactions to export
* Fixed: Constant app crashes after creating accounts with BYN currency (#663)
* Fixed: Choosing manual account creation during setup closes wizard but doesn't open accounts view (#644)
* Improved: Upgrade to Dropbox API v2 (v1 will be deprecated soon) (#552)
* Improved: Use FileProvider for sharing files with other applications (#568)
* Improved: Tell user when there are no transactions to export
* Improved: Added option to hide account balance in widget (#600)
* Improved: List transfer accounts starting with favorites first (#622)
* Improved: Management of preferences for widgets and support for multibook widgets
* Improved: Updated translations and added generic default account files for broad locales (e.g. de, fr, pt)


Version 2.1.4 *(2017-01-30)*
----------------------------
* Fixed: Bugs in execution of some scheduled actions (#604, #609)
Expand Down
125 changes: 68 additions & 57 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import org.apache.tools.ant.taskdefs.condition.Os

import java.text.SimpleDateFormat

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'android-apt'

def versionMajor = 2
def versionMinor = 1
def versionPatch = 4
def versionBuild = 2
def versionPatch = 5
def versionBuild = 4

def buildTime() {
def df = new SimpleDateFormat("yyyyMMdd HH:mm 'UTC'")
Expand All @@ -22,8 +21,8 @@ def gitSha() {


android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
compileSdkVersion 24
buildToolsVersion '24.0.3'
defaultConfig {
applicationId "org.gnucash.android"
testApplicationId 'org.gnucash.android.test'
Expand All @@ -36,15 +35,7 @@ android {
buildConfigField "boolean", "CAN_REQUEST_RATING", "false"
buildConfigField "String", "BUILD_TIME", "\"${buildTime()}\""

if (project.hasProperty("RELEASE_DROPBOX_APP_KEY")){
resValue "string", "dropbox_app_key", RELEASE_DROPBOX_APP_KEY
resValue "string", "dropbox_app_secret", RELEASE_DROPBOX_APP_SECRET
resValue "string", "manifest_dropbox_app_key", "db-${RELEASE_DROPBOX_APP_KEY}"
} else {
resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
}
multiDexEnabled true
testInstrumentationRunner "org.gnucash.android.test.ui.util.GnucashAndroidTestRunner"

}
Expand Down Expand Up @@ -109,17 +100,41 @@ android {
resValue "string", "app_name", "GnuCash-devel"
versionName "${versionMajor}.${versionMinor}.${versionPatch}-dev${versionBuild}_r${gitSha()}"
resValue "string", "app_version_name", "${versionName}"

resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
}

beta {
resValue "string", "app_name", "GnuCash - beta"
versionName "${versionMajor}.${versionMinor}.${versionPatch}-beta${versionBuild}"
resValue "string", "app_version_name", "${versionName}"

if (project.hasProperty("RELEASE_DROPBOX_APP_KEY")){
resValue "string", "dropbox_app_key", RELEASE_DROPBOX_APP_KEY
resValue "string", "dropbox_app_secret", RELEASE_DROPBOX_APP_SECRET
resValue "string", "manifest_dropbox_app_key", "db-${RELEASE_DROPBOX_APP_KEY}"
} else {
resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
}
}

production {
resValue "string", "app_name", "GnuCash"
buildConfigField "boolean", "CAN_REQUEST_RATING", "true"

if (project.hasProperty("RELEASE_DROPBOX_APP_KEY")){
resValue "string", "dropbox_app_key", RELEASE_DROPBOX_APP_KEY
resValue "string", "dropbox_app_secret", RELEASE_DROPBOX_APP_SECRET
resValue "string", "manifest_dropbox_app_key", "db-${RELEASE_DROPBOX_APP_KEY}"
} else {
resValue "string", "dropbox_app_key", "dhjh8ke9wf05948"
resValue "string", "dropbox_app_secret", "h2t9fphj3nr4wkw"
resValue "string", "manifest_dropbox_app_key", "db-dhjh8ke9wf05948"
}
}

}
Expand Down Expand Up @@ -147,46 +162,35 @@ def initCrashlyticsPropertiesIfNeeded() {
}
}

def adb = Os.isFamily(Os.FAMILY_WINDOWS) ? "..\\scripts\\adb_all.bat" : "../scripts/adb_all.sh"
//def adb = android.getAdbExe().toString()

afterEvaluate {
apply plugin: 'spoon'
spoon {
debug = true
grantAllPermissions = true
}
initCrashlyticsPropertiesIfNeeded()
}

task grantTestPermissionsDevel(type: Exec, dependsOn: 'installDevelopmentDebug') { // or install{productFlavour}{buildType}
if (Os.isFamily(Os.FAMILY_WINDOWS)){
commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.SET_ANIMATION_SCALE"
// commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.WRITE_EXTERNAL_STORAGE"
} else {
commandLine "$adb shell pm grant $android.productFlavors.development.applicationId android.permission.SET_ANIMATION_SCALE".split(' ')
// commandLine "$adb shell pm grant $android.productFlavors.development.applicationId android.permission.WRITE_EXTERNAL_STORAGE".split(' ')
}
}
android.productFlavors.all { flavour ->
def applicationId = flavour.applicationId
def adb = android.getAdbExe().toString()

task grantTestPermissionsProduction(type: Exec, dependsOn: 'installProductionDebug'){
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.SET_ANIMATION_SCALE"
commandLine "cmd", "/c", "$adb", "shell pm grant $android.productFlavors.development.applicationId android.permission.WRITE_EXTERNAL_STORAGE"
} else {
commandLine "$adb shell pm grant $android.defaultConfig.applicationId android.permission.SET_ANIMATION_SCALE".split(' ')
commandLine "$adb shell pm grant $android.defaultConfig.applicationId android.permission.WRITE_EXTERNAL_STORAGE".split(' ')
}
def grantPermissionsTask = tasks.create("grant${flavour.name.capitalize()}Permissions") << {
"${adb} shell pm grant ${applicationId} android.permission.WRITE_EXTERNAL_STORAGE".execute()
"${adb} shell pm grant ${applicationId} android.permission.SET_ANIMATION_SCALE".execute()
}
grantPermissionsTask.description = "Grants permissions for Marshmallow"

// When launching individual tests from Android Studio, it seems that only the assemble tasks
// get called directly, not the install* versions
tasks.each { task ->
if (task.name.startsWith('assembleDevelopmentDebugAndroidTest')){
task.dependsOn grantTestPermissionsDevel
} else if (task.name.startsWith('assembleBetaDebugAndroidTest')){
task.dependsOn grantTestPermissionsProduction
} else if (task.name.startsWith('assembleProductionDebugAndroidTest')){
task.dependsOn grantTestPermissionsProduction
tasks.whenTaskAdded { theTask ->
def assemblePattern = ~"assemble${flavour.name.capitalize()}DebugAndroidTest"
if (assemblePattern.matcher(theTask.name).matches()) {
theTask.dependsOn grantPermissionsTask.name
}
}
}

def androidSupportVersion = "23.3.0"

def androidSupportVersion = "24.2.1"
def androidEspressoVersion = "2.2.2"
def androidSupportTestVersion = "0.5"

Expand All @@ -205,21 +209,25 @@ dependencies {
'com.android.support:cardview-v7:' + androidSupportVersion,
'com.android.support:preference-v7:' + androidSupportVersion,
'com.android.support:recyclerview-v7:' + androidSupportVersion,
'com.viewpagerindicator:library:2.4.1@aar',
'com.code-troopers.betterpickers:library:2.5.5',
'com.code-troopers.betterpickers:library:3.0.1',
'org.jraf:android-switch-backport:2.0.1@aar',
'com.github.PhilJay:MPAndroidChart:v2.1.3',
'joda-time:joda-time:2.7',
'com.google.android.gms:play-services-drive:8.3.0',
'com.jakewharton:butterknife:7.0.1',
'io.github.kobakei:ratethisapp:1.0.3',
'joda-time:joda-time:2.9.4',
'com.google.android.gms:play-services-drive:9.6.1',
'io.github.kobakei:ratethisapp:1.1.0',
'com.squareup:android-times-square:1.6.5@aar',
'com.github.techfreak:wizardpager:1.0.3',
'net.objecthunter:exp4j:0.4.5',
'org.apache.jackrabbit:jackrabbit-webdav:2.11.1'
'net.objecthunter:exp4j:0.4.7',
'org.apache.jackrabbit:jackrabbit-webdav:2.13.3',
'com.dropbox.core:dropbox-core-sdk:2.1.2',
'com.facebook.stetho:stetho:1.4.1',
'com.android.support:multidex:1.0.1'
)

compile ('com.uservoice:uservoice-android-sdk:1.2.+') {
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'

compile ('com.uservoice:uservoice-android-sdk:1.2.5') {
exclude module: 'commons-logging'
exclude module: 'httpcore'
exclude module: 'httpclient'
Expand All @@ -229,13 +237,14 @@ dependencies {
transitive = true;
}

compile 'com.facebook.stetho:stetho:1.3.1'

testCompile('org.robolectric:robolectric:3.1',
testCompile('org.robolectric:robolectric:3.1.2',
'junit:junit:4.12',
'joda-time:joda-time:2.7',
'joda-time:joda-time:2.9.4',
'org.assertj:assertj-core:1.7.1'
)
testCompile 'org.robolectric:shadows-multidex:3.0'

androidTestCompile ('com.android.support:support-annotations:' + androidSupportVersion,
'com.android.support.test:runner:' + androidSupportTestVersion,
'com.android.support.test:rules:' + androidSupportTestVersion,
Expand All @@ -252,4 +261,6 @@ dependencies {
androidTestCompile('com.squareup.assertj:assertj-android:1.1.1'){
exclude group: 'com.android.support', module:'support-annotations'
}

androidTestCompile 'com.squareup.spoon:spoon-client:1.6.4'
}
Binary file removed app/libs/dropbox-sync-sdk-android.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
}

-keep class org.gnucash.android.** {*;}
-keep class com.dropbox.** {*;}
-keep class com.dropbox.** {*;}
-keep class android.support.v7.widget.SearchView { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public void editingAccountShouldNotDeleteTransactions(){
Account account = new Account("Transfer Account");
account.setCommodity(Commodity.getInstance(ACCOUNTS_CURRENCY.getCurrencyCode()));
Transaction transaction = new Transaction("Simple transaction");
transaction.setCurrencyCode(ACCOUNTS_CURRENCY.getCurrencyCode());
transaction.setCommodity(ACCOUNTS_CURRENCY);
Split split = new Split(new Money(BigDecimal.TEN, ACCOUNTS_CURRENCY), account.getUID());
transaction.addSplit(split);
transaction.addSplit(split.createPair(SIMPLE_ACCOUNT_UID));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.junit.runners.MethodSorters;

import java.io.File;
import java.util.Currency;
import java.util.List;

import static android.support.test.espresso.Espresso.onView;
Expand Down Expand Up @@ -133,7 +132,8 @@ public void setUp() throws Exception {
Split split = new Split(new Money("8.99", currencyCode), account.getUID());
split.setMemo("Hawaii is the best!");
transaction.addSplit(split);
transaction.addSplit(split.createPair(mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Currency.getInstance(currencyCode))));
transaction.addSplit(split.createPair(
mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Commodity.DEFAULT_COMMODITY)));
account.addTransaction(transaction);

mAccountsDbAdapter.addRecord(account, DatabaseAdapter.UpdateMethod.insert);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import java.util.Currency;

import static android.support.test.InstrumentationRegistry.getInstrumentation;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.clearText;
Expand Down Expand Up @@ -132,7 +130,7 @@ public void setUp() throws Exception {
Split split = new Split(new Money("11.11", currencyCode), account.getUID());
transaction.addSplit(split);
transaction.addSplit(split.createPair(
mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Currency.getInstance(currencyCode))));
mAccountsDbAdapter.getOrCreateImbalanceAccountUID(Commodity.DEFAULT_COMMODITY)));
account.addTransaction(transaction);

mAccountsDbAdapter.addRecord(account, DatabaseAdapter.UpdateMethod.insert);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ public void testAddTransaction(){
onView(withId(R.id.fab_create_transaction)).perform(click());

onView(withId(R.id.input_transaction_name)).perform(typeText("Lunch"));
Espresso.closeSoftKeyboard();
onView(withId(R.id.input_transaction_amount)).perform(typeText("899"));
Espresso.closeSoftKeyboard();
onView(withId(R.id.input_transaction_type))
.check(matches(allOf(isDisplayed(), withText(R.string.label_receive))))
.perform(click())
Expand Down Expand Up @@ -409,7 +411,7 @@ public void testSplitEditor(){

onView(withId(R.id.input_transaction_name)).perform(typeText("Autobalance"));
onView(withId(R.id.input_transaction_amount)).perform(typeText("499"));

Espresso.closeSoftKeyboard();
onView(withId(R.id.btn_split_editor)).perform(click());

onView(withId(R.id.split_list_layout)).check(matches(allOf(isDisplayed(), hasDescendant(withId(R.id.input_split_amount)))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.IBinder;
import android.support.multidex.MultiDex;
import android.support.test.runner.AndroidJUnitRunner;
import android.util.Log;

Expand Down
16 changes: 9 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@
android:theme="@style/Theme.GnucashTheme" />
<activity android:name=".ui.settings.PreferenceActivity"
android:theme="@style/Theme.GnucashTheme" />
<activity android:name="com.dropbox.sync.android.DbxAuthActivity" />
<activity
android:name="com.dropbox.client2.android.AuthActivity"
android:name="com.dropbox.core.android.AuthActivity"
android:launchMode="singleTask"
android:configChanges="orientation|keyboard">
<intent-filter>
Expand All @@ -120,11 +119,6 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service
android:name="com.dropbox.sync.android.DbxSyncService"
android:enabled="true"
android:exported="false"
android:label="Dropbox Sync" />
<service android:name=".service.ScheduledActionService"
android:exported="false"
android:label="GnuCash Android Scheduler Execution Service"/>
Expand Down Expand Up @@ -161,6 +155,14 @@
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<provider
android:authorities="${applicationId}.fileprovider"
android:name="android.support.v4.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
</application>

</manifest>
Loading

0 comments on commit 07dc956

Please sign in to comment.