Skip to content

Commit

Permalink
Be more conservative on updates and fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evant committed Apr 3, 2021
1 parent dbc1705 commit d49644d
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 44 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
}

Expand Down
10 changes: 5 additions & 5 deletions bindingcollectionadapter-ktx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
androidTest {
Expand All @@ -25,14 +25,14 @@ android {
}
}
}
dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
}

dependencies {
api project(':bindingcollectionadapter')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

apply from: '../publish.gradle'
Expand Down
13 changes: 6 additions & 7 deletions bindingcollectionadapter-paging/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
androidTest {
Expand All @@ -25,24 +25,23 @@ android {
}
}
}
dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
}

dependencies {
implementation project(':bindingcollectionadapter-recyclerview')
implementation 'androidx.paging:paging-runtime:2.1.2'
implementation 'androidx.paging:paging-runtime:2.0.0'

testImplementation 'junit:junit:4.13'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.6.2'
testImplementation 'org.mockito:mockito-core:3.3.0'

androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'com.squareup.assertj:assertj-android:1.1.0'
androidTestImplementation 'androidx.core:core:1.3.2'
}

apply from: '../publish.gradle'
13 changes: 6 additions & 7 deletions bindingcollectionadapter-recyclerview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
androidTest {
Expand All @@ -24,24 +24,23 @@ android {
}
}
}
dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
}

dependencies {
api project(':bindingcollectionadapter')
api 'androidx.recyclerview:recyclerview:1.1.0'
api 'androidx.recyclerview:recyclerview:1.0.0'

testImplementation 'junit:junit:4.13'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.6.2'
testImplementation 'org.mockito:mockito-core:3.3.0'

androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'com.squareup.assertj:assertj-android:1.1.0'
androidTestImplementation 'androidx.core:core:1.3.2'
}

apply from: '../publish.gradle'
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<manifest package="me.tatarka.bindingcollectionadapter2.recyclerview"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.tatarka.bindingcollectionadapter2.recyclerview">

<uses-sdk android:targetSdkVersion="30" />

<application>
<activity android:name="me.tatarka.bindingcollectionadapter2.recyclerview.EmptyActivity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;
import androidx.test.espresso.core.internal.deps.dagger.internal.Factory;
import androidx.test.espresso.core.internal.deps.guava.base.Joiner;

import java.util.Iterator;
Expand Down Expand Up @@ -56,7 +55,7 @@ public static class MyBindingRecyclerViewAdapter<T> extends BindingRecyclerViewA

public static <T> Iterable<T> iterable(final BindingRecyclerViewAdapter<T> adapter) {
if (adapter == null) return null;
return new IndexIterable<>(new Factory<IndexIterator<T>>() {
return new IndexIterable<>(new IndexIterable.Factory<IndexIterator<T>>() {
@Override
public IndexIterator<T> get() {
return new IndexIterator<T>() {
Expand Down Expand Up @@ -90,6 +89,10 @@ public Iterator<T> iterator() {
public String toString() {
return iterator().toString();
}

interface Factory<T> {
T get();
}
}

private static abstract class IndexIterator<T> implements Iterator<T> {
Expand Down
11 changes: 5 additions & 6 deletions bindingcollectionadapter-viewpager2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
androidTest {
Expand All @@ -24,8 +24,8 @@ android {
}
}
}
dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
}

Expand All @@ -34,15 +34,14 @@ dependencies {
api project(':bindingcollectionadapter-recyclerview')
api 'androidx.viewpager2:viewpager2:1.0.0'

testImplementation 'junit:junit:4.13'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.6.2'
testImplementation 'org.mockito:mockito-core:3.3.0'

androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'com.squareup.assertj:assertj-android:1.1.0'
androidTestImplementation 'androidx.core:core:1.3.2'
}

apply from: '../publish.gradle'
12 changes: 6 additions & 6 deletions bindingcollectionadapter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
androidTest {
Expand All @@ -24,16 +24,16 @@ android {
}
}
}
dataBinding {
enabled = true
buildFeatures {
dataBinding = true
}
}

dependencies {
implementation 'androidx.core:core:1.3.2'
implementation 'androidx.core:core:1.0.0'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'

testImplementation 'junit:junit:4.13'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.6.2'
testImplementation 'org.mockito:mockito-core:3.3.0'

Expand Down
2 changes: 2 additions & 0 deletions bindingcollectionadapter/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<manifest package="me.tatarka.bindingcollectionadapter2"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-sdk android:targetSdkVersion="30" />

<application>
<activity android:name="me.tatarka.bindingcollectionadapter2.EmptyActivity" />
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package me.tatarka.bindingcollectionadapter2;

import androidx.test.espresso.core.internal.deps.dagger.internal.Factory;
import androidx.test.espresso.core.internal.deps.guava.base.Joiner;

import java.util.Iterator;
Expand Down Expand Up @@ -80,7 +79,7 @@ public static class MyBindingViewPagerAdapter<T> extends BindingViewPagerAdapter

public static <T> Iterable<T> iterable(final BindingListViewAdapter<T> adapter) {
if (adapter == null) return null;
return new IndexIterable<>(new Factory<IndexIterator<T>>() {
return new IndexIterable<>(new IndexIterable.Factory<IndexIterator<T>>() {
@Override
public IndexIterator<T> get() {
return new IndexIterator<T>() {
Expand All @@ -100,7 +99,7 @@ T get(int index) {

public static <T> Iterable<T> iterable(final BindingViewPagerAdapter<T> adapter) {
if (adapter == null) return null;
return new IndexIterable<>(new Factory<IndexIterator<T>>() {
return new IndexIterable<>(new IndexIterable.Factory<IndexIterator<T>>() {
@Override
public IndexIterator<T> get() {
return new IndexIterator<T>() {
Expand All @@ -120,7 +119,7 @@ T get(int index) {

public static Iterable<Long> iterableIds(final BindingListViewAdapter<?> adapter) {
if (adapter == null) return null;
return new IndexIterable<>(new Factory<IndexIterator<Long>>() {
return new IndexIterable<>(new IndexIterable.Factory<IndexIterator<Long>>() {
@Override
public IndexIterator<Long> get() {
return new IndexIterator<Long>() {
Expand All @@ -140,7 +139,7 @@ Long get(int index) {

public static Iterable<Boolean> iterableIsEnabled(final BindingListViewAdapter<?> adapter) {
if (adapter == null) return null;
return new IndexIterable<>(new Factory<IndexIterator<Boolean>>() {
return new IndexIterable<>(new IndexIterable.Factory<IndexIterator<Boolean>>() {
@Override
public IndexIterator<Boolean> get() {
return new IndexIterator<Boolean>() {
Expand Down Expand Up @@ -174,6 +173,10 @@ public Iterator<T> iterator() {
public String toString() {
return iterator().toString();
}

interface Factory<T> {
T get();
}
}

private static abstract class IndexIterator<T> implements Iterator<T> {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.4.21'
ext.kotlin_version = '1.4.0'
ext.agp_version = '4.1.2'
repositories {
google()
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
group=me.tatarka.bindingcollectionadapter2
version=4.0.1
android.useAndroidX=true
android.enableJetifier=false

0 comments on commit d49644d

Please sign in to comment.