Skip to content

Commit

Permalink
Update dependencies, implements #797 (#799)
Browse files Browse the repository at this point in the history
* update jems to 1.22
* update contentpal to 0.5
* update lib-recur to 0.11.2
* update color-picker to 1.3
* update bolts to 0.1
* fix dependency scopes
* update `Diff` usage to account for correct Comparator logic
* replace some classes with their upstream counterparts
  • Loading branch information
dmfs authored Jun 5, 2019
1 parent e0c2547 commit cce6120
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 505 deletions.
13 changes: 7 additions & 6 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def jems_version = '1.18'
def contentpal_version = 'a7fbc62eef' // a7fbc62eef -> 2018-08-19
def jems_version = '1.22'
def contentpal_version = '0.5'
def androidx_test_runner_version = '1.1.1'

ext.deps = [
Expand All @@ -12,19 +12,20 @@ ext.deps = [
// dmfs
jems : "org.dmfs:jems:$jems_version",
datetime : 'org.dmfs:rfc5545-datetime:0.2.4',
lib_recur : 'org.dmfs:lib-recur:0.10.1',
lib_recur : 'org.dmfs:lib-recur:0.11.2',
xml_magic : 'org.dmfs:android-xml-magic:0.1.1',
color_picker : 'com.github.dmfs.color-picker:colorpicker:1.1',
color_picker : 'com.github.dmfs:color-picker:1.3',
android_carrot : 'com.github.dmfs.androidcarrot:androidcarrot:13edc04',
bolts_color : 'com.github.dmfs.bolts:color-bolts:2b1b95d', // 2b1b95d -> 2017-12-12
bolts_color : 'com.github.dmfs.Bolts:color-bolts:0.1',
contentpal : "com.github.dmfs.contentpal:contentpal:$contentpal_version",
retention_magic : 'com.github.dmfs:retention-magic:1.3',

// 3rd party
codeka_carrot : 'au.com.codeka:carrot:2.4.0',

// Testing
junit : 'junit:junit:4.12',
hamcrest : 'org.hamcrest:hamcrest-all:1.3',
hamcrest : 'org.hamcrest:hamcrest-library:1.3',
mockito : 'org.mockito:mockito-core:2.27.0',
robolectric : 'org.robolectric:robolectric:3.5.1',
support_test_runner: "androidx.test:runner:$androidx_test_runner_version",
Expand Down
3 changes: 1 addition & 2 deletions opentasks-provider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ android {
}

dependencies {
api project(':opentasks-contract')

implementation project(':opentasks-contract')
implementation deps.datetime
implementation deps.lib_recur
implementation deps.jems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;

import org.dmfs.jems.iterable.decorators.Chunked;
import org.dmfs.ngrams.NGramGenerator;
import org.dmfs.provider.tasks.TaskDatabaseHelper.Tables;
import org.dmfs.provider.tasks.model.TaskAdapter;
import org.dmfs.provider.tasks.utils.Chunked;
import org.dmfs.tasks.contract.TaskContract;
import org.dmfs.tasks.contract.TaskContract.Properties;
import org.dmfs.tasks.contract.TaskContract.TaskColumns;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

import org.dmfs.jems.iterable.composite.Diff;
import org.dmfs.jems.iterable.decorators.Mapped;
import org.dmfs.jems.optional.Optional;
import org.dmfs.jems.optional.elementary.NullSafe;
import org.dmfs.jems.pair.Pair;
import org.dmfs.jems.single.Single;
import org.dmfs.jems.single.combined.Backed;
import org.dmfs.optional.Optional;
import org.dmfs.provider.tasks.TaskDatabaseHelper;
import org.dmfs.provider.tasks.model.TaskAdapter;
import org.dmfs.provider.tasks.model.adapters.BooleanFieldAdapter;
Expand Down Expand Up @@ -187,10 +187,8 @@ private void updateInstances(SQLiteDatabase db, TaskAdapter taskAdapter, long id
(newInstanceValues, cursorRow) ->
{
existingInstances.moveToPosition(cursorRow);
return (int) (existingInstances.getLong(startIdx) -
new Backed<>(
new NullSafe<>(newInstanceValues.getAsLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME)),
0L).value());
return (int) (new Backed<>(new NullSafe<>(newInstanceValues.getAsLong(TaskContract.Instances.INSTANCE_ORIGINAL_TIME)), 0L).value()
- existingInstances.getLong(startIdx));
});

// sync the instances table with the new instances
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions opentasks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ dependencies {
implementation deps.jems
implementation deps.datetime
implementation deps.bolts_color
implementation deps.retention_magic

testImplementation deps.junit
testImplementation deps.robolectric
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
import org.dmfs.android.contentpal.RowDataSnapshot;
import org.dmfs.android.contentpal.RowSnapshot;
import org.dmfs.android.contentpal.predicates.AccountEq;
import org.dmfs.android.contentpal.predicates.AnyOf;
import org.dmfs.android.contentpal.predicates.EqArg;
import org.dmfs.android.contentpal.predicates.Not;
import org.dmfs.android.contentpal.projections.MultiProjection;
import org.dmfs.android.contentpal.rowsets.QueryRowSet;
import org.dmfs.iterables.elementary.Seq;
import org.dmfs.jems.iterable.composite.Joined;
import org.dmfs.jems.iterable.decorators.Mapped;
import org.dmfs.opentaskspal.predicates.AnyOf;
import org.dmfs.opentaskspal.views.TaskListsView;
import org.dmfs.provider.tasks.AuthorityUtil;
import org.dmfs.tasks.contract.TaskContract;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

import org.dmfs.android.contentpal.RowData;
import org.dmfs.android.contentpal.RowDataSnapshot;
import org.dmfs.android.contentpal.operations.Update;
import org.dmfs.android.contentpal.references.RowUriReference;
import org.dmfs.android.contentpal.transactions.BaseTransaction;
import org.dmfs.iterables.elementary.Seq;
import org.dmfs.jems.function.Function;
import org.dmfs.tasks.contract.TaskContract;
import org.dmfs.tasks.utils.Update;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,33 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationCompat.Builder;
import androidx.core.app.NotificationManagerCompat;

import org.dmfs.android.contentpal.Projection;
import org.dmfs.android.contentpal.predicates.AnyOf;
import org.dmfs.android.contentpal.predicates.EqArg;
import org.dmfs.android.contentpal.predicates.In;
import org.dmfs.android.contentpal.projections.Composite;
import org.dmfs.android.contentpal.rowsets.QueryRowSet;
import org.dmfs.android.contentpal.views.Sorted;
import org.dmfs.jems.iterable.composite.Diff;
import org.dmfs.jems.iterable.decorators.Mapped;
import org.dmfs.jems.optional.Optional;
import org.dmfs.jems.pair.Pair;
import org.dmfs.opentaskspal.readdata.Id;
import org.dmfs.opentaskspal.readdata.TaskPin;
import org.dmfs.opentaskspal.readdata.TaskVersion;
import org.dmfs.opentaskspal.views.TasksView;
import org.dmfs.optional.Optional;
import org.dmfs.tasks.JobIds;
import org.dmfs.tasks.R;
import org.dmfs.tasks.actions.utils.NotificationPrefs;
import org.dmfs.tasks.contract.TaskContract.Tasks;
import org.dmfs.tasks.notification.state.PrefState;
import org.dmfs.tasks.notification.state.RowState;
import org.dmfs.tasks.notification.state.TaskNotificationState;
import org.dmfs.tasks.utils.In;

import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;
import androidx.core.app.NotificationManagerCompat;


/**
Expand Down Expand Up @@ -120,7 +119,7 @@ protected void onHandleWork(@NonNull Intent intent)
new EqArg(Tasks.PINNED, 1),
new In(Tasks._ID, new Mapped<>(p -> ContentUris.parseId(p.task()), currentNotifications))))),
// NOTE due to a bug in diff, the logic is currently reversed
(o, o2) -> (int) (ContentUris.parseId(o2.task()) - ContentUris.parseId(o.task()))))
(o, o2) -> (int) (ContentUris.parseId(o.task()) - ContentUris.parseId(o2.task()))))
{
if (!diff.left().isPresent())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
package org.dmfs.tasks.share;

import androidx.annotation.Nullable;
import android.text.format.Time;

import org.dmfs.iterators.Function;
import org.dmfs.tasks.R;
import org.dmfs.tasks.model.ContentSet;
import org.dmfs.tasks.model.Model;
Expand All @@ -31,8 +28,6 @@
/**
* {@link Bindings} for accessing values from a task.
* See the <code>switch-case</code> for the supported properties.
* <p>
* Uses a {@link Function} of {@link Time} to {@link String} received in the constructor to format the times.
*
* @author Gabor Keszthelyi
*/
Expand Down
Loading

0 comments on commit cce6120

Please sign in to comment.