Skip to content

Commit

Permalink
Option to disable dsl marker generation (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
elihart authored May 13, 2021
1 parent 09430ad commit 8655128
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# 4.6.1 (May 13, 2021)
Adds "epoxyDisableDslMarker" annotation processor flag which you can use to delay migration to the model building scope DLSMarker introduced in 4.6.0 if it is a large breaking change for your project.

Note that this only applies to your project modules that you apply it to, and does not apply to the handful of models that ship with the Epoxy library (like the Carousel or `group` builder).

For example:
```groovy
project.android.buildTypes.all { buildType ->
buildType.javaCompileOptions.annotationProcessorOptions.arguments =
[
epoxyDisableDslMarker : "true",
]
}
```

# 4.6.0 (May 12, 2021)
- View Binder Support (#1175) Bind epoxy models to views outside of a RecyclerView.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ConfigManager internal constructor(
private val disableGenerateReset: Boolean
private val disableGenerateGetters: Boolean
private val disableGenerateBuilderOverloads: Boolean
val disableDslMarker: Boolean
val logTimings: Boolean
val enableCoroutines: Boolean

Expand Down Expand Up @@ -92,6 +93,12 @@ class ConfigManager internal constructor(
PROCESSOR_OPTION_DISABLE_GENERATE_BUILDER_OVERLOADS,
defaultValue = false
)

disableDslMarker = getBooleanOption(
options,
PROCESSOR_OPTION_DISABLE_DLS_MARKER,
defaultValue = false
)
}

fun processPackageEpoxyConfig(roundEnv: RoundEnvironment): List<Exception> {
Expand Down Expand Up @@ -270,6 +277,7 @@ class ConfigManager internal constructor(
}

companion object {
const val PROCESSOR_OPTION_DISABLE_DLS_MARKER = "epoxyDisableDslMarker"
const val PROCESSOR_OPTION_DISABLE_GENERATE_RESET = "epoxyDisableGenerateReset"
const val PROCESSOR_OPTION_DISABLE_GENERATE_GETTERS = "epoxyDisableGenerateGetters"
const val PROCESSOR_OPTION_DISABLE_GENERATE_BUILDER_OVERLOADS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ class ModelBuilderInterfaceWriter(
addModifiers(Modifier.PUBLIC)
addTypeVariables(modelInfo.typeVariables)
addMethods(interfaceMethods)
addAnnotation(EpoxyBuildScope::class.java)
if (!configManager.disableDslMarker) {
addAnnotation(EpoxyBuildScope::class.java)
}

if (modelInfo.memoizer.implementsModelCollector(modelInfo.superClassElement)) {
// If the model implements "ModelCollector" we want the builder too
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=4.6.0
VERSION_NAME=4.6.1
GROUP=com.airbnb.android
POM_DESCRIPTION=Epoxy is a system for composing complex screens with a ReyclerView in Android.
POM_URL=https://github.com/airbnb/epoxy
Expand Down

0 comments on commit 8655128

Please sign in to comment.