Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 1 contributing.md #896

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5357d0e
Merge remote-tracking branch 'codinguser/master' into develop
pnemonic78 Jun 22, 2017
c234c0d
Merge remote-tracking branch 'codinguser/develop' into develop
pnemonic78 Jun 22, 2017
60d31e3
Merge remote-tracking branch 'codinguser/master' into hotfix/patches
pnemonic78 Oct 2, 2017
dfe8c99
Merge remote-tracking branch 'codinguser/develop' into develop
pnemonic78 Oct 2, 2017
ad9877d
IRR defined double currency.
pnemonic78 Oct 2, 2017
c375478
copy currencies from GnuCash desktop.
pnemonic78 Oct 2, 2017
3dac05d
Currencies XML was modified, so re-populate the commodities database …
pnemonic78 Oct 3, 2017
7a6ff6a
Merge remote-tracking branch 'codinguser/develop' into develop
pnemonic78 May 29, 2018
5f620e3
Merge branch 'develop' into bug-731
pnemonic78 May 29, 2018
9f293d7
Fix issue #790 - text margins for RTL text in transaction details scr…
pnemonic78 Jun 11, 2018
a35d233
Merge pull request #791 from pnemonic78/bug_790a
codinguser Jun 12, 2018
7301bd3
Merge branch 'master' into develop
codinguser Jun 15, 2018
8bc6468
Update gradle wrapper to 4.4 and plugin to 3.1.4
Sep 13, 2018
c546904
Add privacy policy
codinguser Sep 20, 2018
21fc3cf
fixed add button disappearing after rotaion
Feb 14, 2019
08a56cd
Merge pull request #812 from RajatChandel/develop
codinguser Mar 1, 2019
f69a609
Fixes crash when exporting CSV to 3rd party applications
codinguser Mar 1, 2019
15af632
Initial release of croatian accounts
milotype Mar 1, 2019
ef99555
Fixes slow CSV exports
Pikrass Oct 5, 2019
a037f43
Cache account names when exporting transactions to CSV
Pikrass Oct 5, 2019
bbabd3b
Merge pull request #739 from pnemonic78/bug-731
codinguser Nov 9, 2019
9eac7f2
Merge pull request #799 from GianpaMX/develop
codinguser Nov 9, 2019
0d7b396
Merge pull request #826 from milotype/milotype-patch-1
codinguser Nov 9, 2019
9b1851a
Merge pull request #845 from Pikrass/fix-csv-export
codinguser Nov 9, 2019
2a62ab8
Upgrades compileSdk, targetSdk, buildTools and gradle versions
codinguser Nov 9, 2019
448caae
Fixes UI (integration) tests
codinguser Nov 9, 2019
87e2b1d
Upgrade version of robolectric to fix execution of unit tests
codinguser Nov 9, 2019
d2cfae3
Add Book name as subtitle in Accounts Activity
AnilPraharaj Feb 14, 2019
0c7e4e3
Update Java source compatibility to Java 8
codinguser Nov 9, 2019
9fa40d4
Update version for 2.4.1 release
codinguser Nov 9, 2019
b401372
Update translations from CrowdIn
codinguser Nov 10, 2019
4fac627
Update CHANGELOG for v2.4.1 release
codinguser Nov 10, 2019
a9fcb9f
Update version and CHANGELOG for v2.4.1-beta2 release
codinguser Nov 21, 2019
8631c7f
Fixes crash when exporting after upgrading to v2.4.1-beta1 from v2.4.0
codinguser Nov 27, 2019
32ee927
Upgrade version for v2.4.1-beta3 release
codinguser Nov 28, 2019
85704b4
Upgrade version for v2.4.1 final release
codinguser Nov 30, 2019
0dd722c
Update CONTRIBUTING.md
JeanGarf Jan 5, 2020
3b5ef73
Add info about Windows
JeanGarf Jun 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GnuCash Android is built by people like you! Please [join us](https://github.com
## Code Contributions
* Contributions are submitted, reviewed, and accepted using Github pull requests. [Read this article](https://help.github.com/articles/using-pull-requests) for some details. We use the _Fork and Pull_ model, as described there.
* You can maintain your stable installation of GnuCash and test with another installation.
The two instances of GnuCash Android will live side-by-side on your device and not affect each other. You can install the development version by executing `gradle installDD` inside the root project directory
The two instances of GnuCash Android will live side-by-side on your device and not affect each other. You can install the development version by executing `gradlew installDevelopmentDebug` inside the root project directory
* The latest changes are in the `develop` branch.
* Always rebase develop before working on a fix or issuing a pull request
* The master branch contains only stable releases.
Expand All @@ -23,7 +23,7 @@ The two instances of GnuCash Android will live side-by-side on your device and n
* Make a new branch for every feature you're working on.
* Try to make clean commits that are easily readable (including descriptive commit messages!)
* Test before you push make sure all test pass on your machine.
* Unit tests can be run with `gradle test`
* Unit tests can be run with `gradle test` or (`gradlew test` on Windows)
* UI tests can be run with `gradle spoonDD`. This will run the tests on all connected devices/emulators.
* Make small pull requests that are easy to review but which also add value.

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ out/
/captures

gradle.properties
crowdin.properties

#Crashlytics

Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ android:
- platform-tools
- tools
- tools #not a typo. Needed for SDK update
- build-tools-27.0.3
- build-tools-29.0.0

# The SDK version used to compile your project
- android-27
- android-29

# Additional components
- extra-android-support
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-26
- addon-google_apis-google-29

# Specify at least one system image,
# if you need to run emulator(s) during your tests
#- sys-img-armeabi-v7a-android-23

# XXX: Temporary workaround. Remove once fixed
before_install:
- yes | sdkmanager "platforms;android-27"
- yes | sdkmanager "platforms;android-29"

# Emulator Management: Create, Start and Wait
# Re-enable this when we figure out how to reliably build on Travis
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Change Log
===============================================================================
Version 2.4.1 *(2019-11-30)*
----------------------------
* Fixes #809: Crash when exporting CSV
* Fixes #811: Add button in schedule action disappears after rotation
* Fixes #790: Missing transaction description margin
* Fixes crash if during database upgrade triggered by scheduled action
* Improve performance of CSV export
* Improved: Add book name to accounts listing view
* Improved: Update translations

Version 2.4.0 *(2018-06-15)*
----------------------------
* Feature #665: Adds CSV export format
Expand Down
27 changes: 14 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ apply plugin: 'io.fabric'

def versionMajor = 2
def versionMinor = 4
def versionPatch = 0
def versionBuild = 3
def versionPatch = 1
def versionBuild = 4

static def buildTime() {
def df = new SimpleDateFormat("yyyyMMdd HH:mm 'UTC'")
Expand All @@ -20,13 +20,13 @@ static def gitSha() {


android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.0'
defaultConfig {
applicationId "org.gnucash.android"
testApplicationId 'org.gnucash.android.test'
minSdkVersion 19
targetSdkVersion 27
targetSdkVersion 29
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
resValue "string", "app_version_name", "${versionName}"
Expand Down Expand Up @@ -142,11 +142,12 @@ android {

compileOptions { //we want switch with strings during xml parsing
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

testOptions {
animationsDisabled true
unitTests {
includeAndroidResources = true
}
Expand Down Expand Up @@ -179,7 +180,7 @@ afterEvaluate {
}


def androidSupportVersion = "27.0.2"
def androidSupportVersion = "28.0.0"
def androidEspressoVersion = "3.0.0"
def androidSupportTestVersion = "1.0.0"

Expand Down Expand Up @@ -223,19 +224,19 @@ dependencies {
exclude module: 'httpclient'
}

implementation('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true;
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
transitive = true
}


testImplementation 'org.robolectric:robolectric:3.5.1'
testImplementation 'org.robolectric:robolectric:4.3.1'

testImplementation(
'junit:junit:4.12',
'joda-time:joda-time:2.9.4',
'org.assertj:assertj-core:1.7.1'
'org.assertj:assertj-core:3.14.0'
)
testImplementation 'org.robolectric:shadows-multidex:3.0'
testImplementation 'org.robolectric:shadows-multidex:4.3.1'

androidTestImplementation (
'com.android.support:support-annotations:' + androidSupportVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.gnucash.android.test.ui;

import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences.Editor;
import android.database.SQLException;
Expand All @@ -32,8 +31,6 @@
import android.util.Log;
import android.view.View;

import com.kobakei.ratethisapp.RateThisApp;

import org.gnucash.android.R;
import org.gnucash.android.app.GnuCashApplication;
import org.gnucash.android.db.DatabaseHelper;
Expand All @@ -51,6 +48,7 @@
import org.gnucash.android.model.Transaction;
import org.gnucash.android.receivers.AccountCreator;
import org.gnucash.android.test.ui.util.DisableAnimationsRule;
import org.gnucash.android.test.ui.util.GnucashAndroidTestRunner;
import org.gnucash.android.ui.account.AccountsActivity;
import org.gnucash.android.ui.account.AccountsListFragment;
import org.hamcrest.Description;
Expand Down Expand Up @@ -131,7 +129,7 @@ public AccountsActivityTest() {

@BeforeClass
public static void prepTest(){
preventFirstRunDialogs(GnuCashApplication.getAppContext());
GnucashAndroidTestRunner.preventFirstRunDialogs(GnuCashApplication.getAppContext());

String activeBookUID = BooksDbAdapter.getInstance().getActiveBookUID();
mDbHelper = new DatabaseHelper(GnuCashApplication.getAppContext(), activeBookUID);
Expand Down Expand Up @@ -163,26 +161,6 @@ public void setUp() throws Exception {
}


/**
* Prevents the first-run dialogs (Whats new, Create accounts etc) from being displayed when testing
* @param context Application context
*/
public static void preventFirstRunDialogs(Context context) {
AccountsActivity.rateAppConfig = new RateThisApp.Config(10000, 10000);
Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();

//do not show first run dialog
editor.putBoolean(context.getString(R.string.key_first_run), false);
editor.putInt(AccountsActivity.LAST_OPEN_TAB_INDEX, AccountsActivity.INDEX_TOP_LEVEL_ACCOUNTS_FRAGMENT);

//do not show "What's new" dialog
String minorVersion = context.getString(R.string.app_minor_version);
int currentMinor = Integer.parseInt(minorVersion);
editor.putInt(context.getString(R.string.key_previous_minor_version), currentMinor);
editor.commit();
}


public void testDisplayAccountsList(){
AccountsActivity.createDefaultAccounts("EUR", mAccountsActivity);
mAccountsActivity.recreate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.gnucash.android.model.Account;
import org.gnucash.android.model.Commodity;
import org.gnucash.android.test.ui.util.DisableAnimationsRule;
import org.gnucash.android.test.ui.util.GnucashAndroidTestRunner;
import org.gnucash.android.ui.common.UxArgument;
import org.gnucash.android.ui.transaction.TransactionsActivity;
import org.junit.After;
Expand Down Expand Up @@ -105,7 +106,7 @@ public static void prepTestCase(){
mTransactionsDbAdapter = TransactionsDbAdapter.getInstance();
mAccountsDbAdapter = AccountsDbAdapter.getInstance();

AccountsActivityTest.preventFirstRunDialogs(GnuCashApplication.getAppContext());
GnucashAndroidTestRunner.preventFirstRunDialogs(GnuCashApplication.getAppContext());
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,13 @@
package org.gnucash.android.test.ui;

import android.Manifest;
import android.app.AlertDialog;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.Build;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.Espresso;
import android.support.test.espresso.contrib.DrawerActions;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.rule.ActivityTestRule;
import android.support.test.rule.GrantPermissionRule;
import android.support.test.runner.AndroidJUnit4;
import android.support.v7.preference.PreferenceManager;
import android.test.ActivityInstrumentationTestCase2;
import android.util.Log;
import android.widget.CompoundButton;

import org.gnucash.android.R;
import org.gnucash.android.app.GnuCashApplication;
Expand All @@ -42,52 +32,38 @@
import org.gnucash.android.db.adapter.BooksDbAdapter;
import org.gnucash.android.db.adapter.CommoditiesDbAdapter;
import org.gnucash.android.db.adapter.DatabaseAdapter;
import org.gnucash.android.db.adapter.ScheduledActionDbAdapter;
import org.gnucash.android.db.adapter.SplitsDbAdapter;
import org.gnucash.android.db.adapter.TransactionsDbAdapter;
import org.gnucash.android.export.ExportFormat;
import org.gnucash.android.export.Exporter;
import org.gnucash.android.model.Account;
import org.gnucash.android.model.Commodity;
import org.gnucash.android.model.Money;
import org.gnucash.android.model.PeriodType;
import org.gnucash.android.model.ScheduledAction;
import org.gnucash.android.model.Split;
import org.gnucash.android.model.Transaction;
import org.gnucash.android.test.ui.util.GnucashAndroidTestRunner;
import org.gnucash.android.ui.account.AccountsActivity;
import org.gnucash.android.ui.settings.PreferenceActivity;
import org.gnucash.android.util.BookUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

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

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.swipeUp;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.RootMatchers.withDecorView;
import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
import static android.support.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;

@RunWith(AndroidJUnit4.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ExportTransactionsTest extends
ActivityInstrumentationTestCase2<AccountsActivity> {
public class ExportTransactionsTest {

private DatabaseHelper mDbHelper;
private SQLiteDatabase mDb;
Expand All @@ -99,20 +75,23 @@ public class ExportTransactionsTest extends

@Rule public GrantPermissionRule animationPermissionsRule = GrantPermissionRule.grant(Manifest.permission.SET_ANIMATION_SCALE);

@Rule
public ActivityTestRule<AccountsActivity> mActivityRule = new ActivityTestRule<>(AccountsActivity.class);

public ExportTransactionsTest() {
super(AccountsActivity.class);
}

@Override
@BeforeClass
public static void setupClass(){
GnucashAndroidTestRunner.preventFirstRunDialogs(GnuCashApplication.getAppContext());
}

@Before
public void setUp() throws Exception {
super.setUp();
injectInstrumentation(InstrumentationRegistry.getInstrumentation());
AccountsActivityTest.preventFirstRunDialogs(getInstrumentation().getTargetContext());
mAcccountsActivity = getActivity();
public void setUp() {
mAcccountsActivity = mActivityRule.getActivity();

String activeBookUID = BooksDbAdapter.getInstance().getActiveBookUID();
mDbHelper = new DatabaseHelper(getActivity(), activeBookUID);
mDbHelper = new DatabaseHelper(mAcccountsActivity.getApplicationContext(), activeBookUID);
try {
mDb = mDbHelper.getWritableDatabase();
} catch (SQLException e) {
Expand Down Expand Up @@ -164,16 +143,14 @@ public void testCreateBackup(){
*/
private void assertToastDisplayed(int toastString) {
onView(withText(toastString))
.inRoot(withDecorView(not(is(getActivity().getWindow().getDecorView()))))
.inRoot(withDecorView(not(is(mAcccountsActivity.getWindow().getDecorView()))))
.check(matches(isDisplayed()));
}

//todo: add testing of export flag to unit test
//todo: add test of ignore exported transactions to unit tests
@Override
@After public void tearDown() throws Exception {
@After public void tearDown(){
mDbHelper.close();
mDb.close();
super.tearDown();
}
}
Loading