Skip to content

Commit

Permalink
3.8.0 release and tools update (#828)
Browse files Browse the repository at this point in the history
* Update to agp 3.5.0

* Fix test resources

* Update changelog

* Fix issues
  • Loading branch information
elihart authored Sep 16, 2019
1 parent 5d151cc commit bbdc2dc
Show file tree
Hide file tree
Showing 55 changed files with 197 additions and 450 deletions.
13 changes: 0 additions & 13 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 3.8.0 (Sept 16, 2019)
- Add support for Kotlin delegation via annotated interface properties #812
- Fix checked change crash and improve debug errors #806
- Remove extra space in Kotlin extensions #777
- Update project to AGP 3.5, Kotlin 1.3.50, Gradle 5.6

# 3.7.0 (July 1, 2019)
- **New** Add a method to request visibility check externally (https://github.com/airbnb/epoxy/pull/775)

Expand Down
5 changes: 4 additions & 1 deletion blessedDeps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,21 @@ rootProject.ext.ASSERTJ_VERSION = "1.7.1"
rootProject.ext.GOOGLE_TESTING_COMPILE_VERSION = "0.15"
rootProject.ext.JUNIT_VERSION = "4.12"
rootProject.ext.MOCKITO_VERSION = "2.21.0"
rootProject.ext.ROBOLECTRIC_VERSION = "3.8"
rootProject.ext.ROBOLECTRIC_VERSION = "4.3"

rootProject.ext.LOTTIE_VERSION = "2.8.0"
rootProject.ext.LITHO_VERSION = "0.7.0"
rootProject.ext.SO_LOADER_VERSION = "0.2.0"

rootProject.ext.AUTO_VALUE_VERSION = "1.6.2"
rootProject.ext.ANDROID_RUNTIME_VERSION = "4.1.1.4"

rootProject.ext.PARIS_VERSION = "1.2.1"

rootProject.ext.deps = [
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION",
autoValue : "com.google.auto.value:auto-value:$AUTO_VALUE_VERSION",
androidRuntime : "com.google.android:android:$ANDROID_RUNTIME_VERSION",
androidAppcompat : "androidx.appcompat:appcompat:$ANDROIDX_APPCOMPAT",
androidCardView : "androidx.cardview:cardview:$ANDROIDX_CARDVIEW",
androidDesignLibrary : "com.google.android.material:material:$ANDROIDX_MATERIAL",
Expand All @@ -63,6 +65,7 @@ rootProject.ext.deps = [
androidArchCoreTesting: "android.arch.core:core-testing:$ANDROID_ARCH_TESTING",
androidTestRunner : "com.android.support.test:runner:$ANDROID_TEST_RUNNER",
androidAnnotations : "androidx.annotation:annotation:$ANDROIDX_ANNOTATION",
androidTestCore : "androidx.test:core:1.2.0",
androidLegacy : "androidx.legacy:legacy-support-v4:$ANDROIDX_LEGACY",
versionedParcelable : "androidx.versionedparcelable:versionedparcelable:$ANDROIDX_VERSIONED_PARCELABLE",
dataBindingAdapters : "androidx.databinding:databinding-adapters:$ANDROIDX_DATABINDING_ADAPTERS",
Expand Down
11 changes: 3 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {

ext.KOTLIN_VERSION = "1.3.31"
ext.ANDROID_PLUGIN_VERSION = "3.2.1"
ext.KOTLIN_VERSION = "1.3.50"
ext.ANDROID_PLUGIN_VERSION = "3.5.0"

repositories {
google()
Expand All @@ -11,7 +11,7 @@ buildscript {
dependencies {
classpath "com.android.tools.build:gradle:$ANDROID_PLUGIN_VERSION"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
}
}

Expand Down Expand Up @@ -81,8 +81,3 @@ def getRepositoryUsername() {
def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
}

task wrapper(type: Wrapper) {
gradleVersion = '4.10.2'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
4 changes: 2 additions & 2 deletions epoxy-adapter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "com.vanniktech.maven.publish"

android {
compileSdkVersion rootProject.COMPILE_SDK_VERSION
Expand Down Expand Up @@ -31,6 +32,5 @@ dependencies {
testImplementation rootProject.deps.junit
testImplementation rootProject.deps.robolectric
testImplementation rootProject.deps.mockito
testImplementation rootProject.deps.androidTestCore
}

apply from: rootProject.file('gradle/gradle-maven-push.gradle')
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void setValue(@StringRes int stringRes, @Nullable Object[] formatArgs) {

private void handleInvalidStringRes() {
if (hasDefault) {
if (defaultStringRes > 0) {
if (defaultStringRes != 0) {
setValue(defaultStringRes);
} else {
setValue(defaultString);
Expand All @@ -85,13 +85,13 @@ public void setValue(@PluralsRes int pluralRes, int quantity, @Nullable Object[]
}

public CharSequence toString(Context context) {
if (pluralRes > 0) {
if (pluralRes != 0) {
if (formatArgs != null) {
return context.getResources().getQuantityString(pluralRes, quantity, formatArgs);
} else {
return context.getResources().getQuantityString(pluralRes, quantity);
}
} else if (stringRes > 0) {
} else if (stringRes != 0) {
if (formatArgs != null) {
return context.getResources().getString(stringRes, formatArgs);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.ArrayList;
Expand All @@ -21,8 +22,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

@Config(sdk = 21, manifest = TestRunner.MANIFEST_PATH)
@RunWith(TestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class DiffPayloadTest {

private final List<EpoxyModel<?>> models = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.Config;
import org.robolectric.RobolectricTestRunner;

import java.util.ArrayList;
import java.util.Collections;
Expand All @@ -23,8 +23,7 @@
import static com.airbnb.epoxy.ModelTestUtils.removeModelsAfterPosition;
import static junit.framework.Assert.assertEquals;

@Config(sdk = 21, manifest = TestRunner.MANIFEST_PATH)
@RunWith(TestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class DifferCorrectnessTest {
private static final boolean SHOW_LOGS = false;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.List;
Expand All @@ -16,8 +17,7 @@
* {@link EpoxyAdapter#notifyModelsChanged()}
* will properly update the model state maintained by the differ.
*/
@Config(sdk = 21, manifest = TestRunner.MANIFEST_PATH)
@RunWith(TestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class DifferNotifyTest {
private static final int INITIAL_MODEL_COUNT = 20;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.ArrayList;
Expand All @@ -22,8 +23,7 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

@Config(sdk = 21, manifest = TestRunner.MANIFEST_PATH)
@RunWith(TestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class EpoxyAdapterTest {

@Rule public ExpectedException thrown = ExpectedException.none();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.ArrayList;
Expand All @@ -20,8 +21,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

@Config(sdk = 21, manifest = TestRunner.MANIFEST_PATH)
@RunWith(TestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class EpoxyControllerTest {

List<EpoxyModel<?>> savedModels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import android.widget.FrameLayout
import android.widget.LinearLayout
import android.widget.Space
import androidx.recyclerview.widget.RecyclerView
import androidx.test.core.app.ApplicationProvider
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.ParameterizedRobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config

@Config(sdk = [21], manifest = TestRunner.MANIFEST_PATH)
@Config(sdk = [21])
@RunWith(ParameterizedRobolectricTestRunner::class)
class EpoxyModelGroupTest(val useViewStubs: Boolean) {

Expand All @@ -27,7 +27,7 @@ class EpoxyModelGroupTest(val useViewStubs: Boolean) {

@Before
fun init() {
recyclerView = RecyclerView(RuntimeEnvironment.application)
recyclerView = RecyclerView(ApplicationProvider.getApplicationContext())
topLevelHolder?.unbind()
topLevelHolder = null
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.airbnb.epoxy

import android.view.View
import androidx.test.core.app.ApplicationProvider
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RuntimeEnvironment
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config

@Config(sdk = [21], manifest = TestRunner.MANIFEST_PATH)
@RunWith(TestRunner::class)
@Config(sdk = [21])
@RunWith(RobolectricTestRunner::class)
class EpoxyRecyclerViewTest {

private class TestModel : EpoxyModel<View>() {
Expand All @@ -17,7 +18,7 @@ class EpoxyRecyclerViewTest {

@Test
fun withModels() {
val epoxyRecyclerView = EpoxyRecyclerView(RuntimeEnvironment.application)
val epoxyRecyclerView = EpoxyRecyclerView(ApplicationProvider.getApplicationContext())

var modelsToBuild = 1
epoxyRecyclerView.withModels {
Expand Down Expand Up @@ -48,7 +49,7 @@ class EpoxyRecyclerViewTest {

@Test
fun buildModelsWith() {
val epoxyRecyclerView = EpoxyRecyclerView(RuntimeEnvironment.application)
val epoxyRecyclerView = EpoxyRecyclerView(ApplicationProvider.getApplicationContext())

var modelsToBuild = 1
epoxyRecyclerView.buildModelsWith(object : EpoxyRecyclerView.ModelBuilderCallback {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.shadows.ShadowLog

Expand All @@ -28,8 +29,8 @@ private typealias TrackerTestModel = EpoxyVisibilityTrackerTest.TrackerTestModel
* - `mdpi` for density factor 1
* - `h831dp` where : 831 = 56 (ToolBar) + 775 (RecyclerView)
*/
@Config(sdk = [21], manifest = TestRunner.MANIFEST_PATH, qualifiers = "h831dp-mdpi")
@RunWith(TestRunner::class)
@Config(sdk = [21], qualifiers = "h831dp-mdpi")
@RunWith(RobolectricTestRunner::class)
class EpoxyVisibilityTrackerNestedTest {
companion object {
private const val TAG = "EpoxyVisibilityTrackerNestedTest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.shadows.ShadowLog

Expand All @@ -33,8 +34,8 @@ import org.robolectric.shadows.ShadowLog
* - `mdpi` for density factor 1
* - `h831dp` where : 831 = 56 (ToolBar) + 775 (RecyclerView)
*/
@Config(sdk = [21], manifest = TestRunner.MANIFEST_PATH, qualifiers = "h831dp-mdpi")
@RunWith(TestRunner::class)
@Config(sdk = [21], qualifiers = "h831dp-mdpi")
@RunWith(RobolectricTestRunner::class)
class EpoxyVisibilityTrackerTest {

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import java.util.ArrayList;
Expand All @@ -17,8 +18,7 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

@Config(sdk = 21, manifest = TestRunner.MANIFEST_PATH)
@RunWith(TestRunner.class)
@RunWith(RobolectricTestRunner.class)
public class ModelListTest {

private final ModelList.ModelListObserver observer = mock(ModelList.ModelListObserver.class);
Expand Down
26 changes: 0 additions & 26 deletions epoxy-adapter/src/test/java/com/airbnb/epoxy/TestRunner.java

This file was deleted.

Loading

0 comments on commit bbdc2dc

Please sign in to comment.