Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# 4.0.0-beta1 (May 22, 2020)
- Support for incremental annotation processing as an Aggregating processor (#972)
- Removed Litho support
- A new annotation processor argument `logEpoxyTimings` can be set to get a detailed breakdown of how long the processors took and where they spent their time (off by default)
- Another new argument `enableParallelEpoxyProcessing` can be set to true to have the annotation processor process annotations and generate files in parallel (via coroutines).

You can enable these processor options in your build.gradle file like so:
```
project.android.buildTypes.all { buildType ->
buildType.javaCompileOptions.annotationProcessorOptions.arguments =
[
logEpoxyTimings : "true",
enableParallelEpoxyProcessing : "true"
]
}
```

Parallel processing can greatly speed up processing time (moreso than the incremental support), but given the nature of parallel processing it is still incubating.
Please report any issues or crashes that you notice.
(We are currently using parallel mode in our large project at Airbnb with no problems.)

# 3.11.0 (May 20, 2020)
- Introduce partial impression visibility states (#973)
- Fix sticky header crash (#976)
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Epoxy

Epoxy is an Android library for building complex screens in a RecyclerView. Models are automatically generated from custom views, databinding layouts, or [Litho](https://fblitho.com/) components via annotation processing. These models are then used in an EpoxyController to declare what items to show in the RecyclerView.
Epoxy is an Android library for building complex screens in a RecyclerView. Models are automatically generated from custom views or databinding layouts via annotation processing. These models are then used in an EpoxyController to declare what items to show in the RecyclerView.

This abstracts the boilerplate of view holders, diffing items and binding payload changes, item types, item ids, span counts, and more, in order to simplify building screens with multiple view types. Additionally, Epoxy adds support for saving view state and automatic diffing of item changes.

Expand Down Expand Up @@ -275,8 +275,6 @@ If you still have questions, feel free to create a new issue.
## Min SDK
We support a minimum SDK of 14. However, Epoxy is based on the v7 support libraries so it should work with lower versions if you care to override the min sdk level in the manifest.

If you are using the [optional Litho integration](https://github.com/airbnb/epoxy/wiki/Litho-Support) then the min SDK is 15 due to Litho's SDK requirement.

## Contributing
Pull requests are welcome! We'd love help improving this library. Feel free to browse through open issues to look for things that need work. If you have a feature request or bug, please open a new issue so we can track it.

Expand Down
22 changes: 11 additions & 11 deletions blessedDeps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ rootProject.ext.JAVA_TARGET_VERSION = JavaVersion.VERSION_1_7
rootProject.ext.TARGET_SDK_VERSION = 28
rootProject.ext.COMPILE_SDK_VERSION = 28
rootProject.ext.MIN_SDK_VERSION = 14
rootProject.ext.MIN_SDK_VERSION_LITHO = 15

rootProject.ext.ANDROIDX_ANNOTATION = "1.0.0"
rootProject.ext.ANDROIDX_RECYCLERVIEW = "1.0.0"
Expand All @@ -33,27 +32,30 @@ rootProject.ext.ANDROID_DATA_BINDING = "1.3.1"
rootProject.ext.ANDROID_ARCH_TESTING = "1.1.1"
rootProject.ext.ANDROID_TEST_RUNNER = "1.0.2"
rootProject.ext.SQUARE_JAVAPOET_VERSION = "1.11.1"
rootProject.ext.SQUARE_KOTLINPOET_VERSION = "1.0.1"
rootProject.ext.KOTLIN_COROUTINES_VERSION = "1.2.1"
rootProject.ext.SQUARE_KOTLINPOET_VERSION = "1.5.0"
rootProject.ext.KOTLIN_COROUTINES_VERSION = "1.3.7"
rootProject.ext.GLIDE_VERSION = "4.9.0"

rootProject.ext.ASSERTJ_VERSION = "1.7.1"
rootProject.ext.GOOGLE_TESTING_COMPILE_VERSION = "0.15"
rootProject.ext.GOOGLE_TESTING_COMPILE_VERSION = "0.18"
rootProject.ext.JUNIT_VERSION = "4.12"
rootProject.ext.MOCKITO_VERSION = "2.21.0"
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.INCAP_VERSION = "0.2"
rootProject.ext.KOTLIN_METADATA_VERSION = "1.4.0"

rootProject.ext.deps = [
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION",
kotlinCoroutines : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$KOTLIN_COROUTINES_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",
Expand All @@ -78,12 +80,10 @@ rootProject.ext.deps = [
mockito_inline : "org.mockito:mockito-inline:$MOCKITO_VERSION",
robolectric : "org.robolectric:robolectric:$ROBOLECTRIC_VERSION",
lottie : "com.airbnb.android:lottie:$LOTTIE_VERSION",
lithoProcessor : "com.facebook.litho:litho-processor:$LITHO_VERSION",
lithoSoloader : "com.facebook.soloader:soloader:$SO_LOADER_VERSION",
lithoCore : "com.facebook.litho:litho-core:$LITHO_VERSION",
lithoWidget : "com.facebook.litho:litho-widget:$LITHO_VERSION",
lithoAnnotations : "com.facebook.litho:litho-annotations:$LITHO_VERSION",
paris : "com.airbnb.android:paris:$PARIS_VERSION",
parisProcessor : "com.airbnb.android:paris-processor:$PARIS_VERSION",
glide : "com.github.bumptech.glide:glide:$GLIDE_VERSION"
glide : "com.github.bumptech.glide:glide:$GLIDE_VERSION",
kotlinMetadata : "me.eugeniomarletti.kotlin.metadata:kotlin-metadata:$KOTLIN_METADATA_VERSION",
incapRuntime : "net.ltgt.gradle.incap:incap:$INCAP_VERSION",
incapProcessor : "net.ltgt.gradle.incap:incap-processor:$INCAP_VERSION",
]
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ buildscript {
repositories {
google()
jcenter()
// For gradle-maven-publish-plugin snapshot
maven { url "https://oss.sonatype.org/service/local/repositories/snapshots/content/" }
}
dependencies {
classpath "com.android.tools.build:gradle:$ANDROID_PLUGIN_VERSION"
Expand Down
7 changes: 7 additions & 0 deletions epoxy-adapter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ android {
androidExtensions {
experimental = true
}

buildTypes.all { buildType ->
buildType.javaCompileOptions.annotationProcessorOptions.arguments =
[
logEpoxyTimings: "true"
]
}
}

configurations.all { strategy ->
Expand Down
1 change: 0 additions & 1 deletion epoxy-litho/.gitignore

This file was deleted.

39 changes: 0 additions & 39 deletions epoxy-litho/build.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions epoxy-litho/gradle.properties

This file was deleted.

25 changes: 0 additions & 25 deletions epoxy-litho/proguard-rules.pro

This file was deleted.

8 changes: 0 additions & 8 deletions epoxy-litho/src/main/AndroidManifest.xml

This file was deleted.

90 changes: 0 additions & 90 deletions epoxy-litho/src/main/java/com/airbnb/epoxy/EpoxyLithoModel.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.airbnb.epoxy

import com.airbnb.epoxy.processor.ControllerProcessor
import com.airbnb.epoxy.processor.DataBindingProcessor
import com.airbnb.epoxy.processor.EpoxyProcessor
import com.airbnb.epoxy.processor.ModelViewProcessor
import com.airbnb.paris.processor.ParisProcessor
import com.google.common.truth.Truth.assert_
import com.google.testing.compile.JavaFileObjects
Expand All @@ -21,19 +25,24 @@ internal object ProcessorTestUtils {

val generatedModel = JavaFileObjects.forResource(generatedFile.patchResource())

val processors = mutableListOf<Processor>().apply {
add(EpoxyProcessor())
if (useParis) add(ParisProcessor())
}

assert_().about(javaSources())
.that(helperObjects + listOf(model))
.processedWith(processors)
.processedWith(processors(useParis))
.compilesWithoutError()
.and()
.generatesSources(generatedModel)
}

fun processors(useParis: Boolean = false): MutableList<Processor> {
return mutableListOf<Processor>().apply {
add(EpoxyProcessor())
add(ControllerProcessor())
add(DataBindingProcessor())
add(ModelViewProcessor())
if (useParis) add(ParisProcessor())
}
}

// See epoxy-processortest/src/test/java/com/airbnb/epoxy/GuavaPatch.kt
private fun String.patchResource() =
File("build/intermediates/sourceFolderJavaResources/debug/$this").toURI().toURL()
Expand Down
15 changes: 14 additions & 1 deletion epoxy-processor/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
import org.gradle.internal.jvm.Jvm

apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.kotlin.kapt'
apply plugin: "com.vanniktech.maven.publish"

mavenPublish {
// must use legacy mode until we update to AGP 3.6.x
useLegacyMode = true
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

configurations.all { strategy ->
strategy.resolutionStrategy.force rootProject.deps.assertj, rootProject.deps.googleTestingCompile
}
Expand All @@ -18,6 +28,7 @@ dependencies {
implementation deps.squareKotlinPoet
implementation deps.androidAnnotations
implementation "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.1.0"
implementation rootProject.deps.kotlinCoroutines

/** Provides the sun javac tools for looking up the R class trees. */
compileOnly files(Jvm.current().getToolsJar())
Expand All @@ -26,6 +37,8 @@ dependencies {
compileOnly rootProject.deps.androidRuntime

implementation project(':epoxy-annotations')
compileOnly deps.incapRuntime
kapt deps.incapProcessor

testImplementation rootProject.deps.junit
}
Expand Down
Loading