Skip to content

Releases: airbnb/paris

2.0.2

04 Apr 23:54
d8b5edb
Compare
Choose a tag to compare

Updates kotlin, ksp, and the xprocessing library.

Notably, the androidx.room:room-compiler-processing library (aka xprocessing) has been updated to 2.6.0-alpha01. This version is incompatible with previous versions due to a breaking API change. All annotation processors using this library must be on the same version. Other annotation processors such as Epoxy and Paris also use xprocessing and if you use them you need to use a version of them that also uses xprocessing 2.6.0-alpha01

2.0.0

29 Sep 03:28
8893584
Compare
Choose a tag to compare

Paris now supports Kotlin Symbol Processing for faster builds! https://github.com/google/ksp

Breaking changes needed to support KSP:

  • ParisConfig annotation can no longer be used on package elements, only on class or interfaces
  • R class references used in annotations cannot be star imported
  • Added aggregateStyleablesOnClassPath parameter to @ParisConfig. This must now be set to true to have the module generate a Paris class using only classpath dependencies if there are no Styleables in the module sources.

Note: Due to a bug in KSP (google/ksp#630) it is recommended to disable KSP incremental compilation until the bug is fixed in KSP, otherwise you may encounter spurious build failures.

Additionally, if you are using R2 generation via the butterknife gradle plugin you must configure KSP to be aware of those generated sources.
This can be done either via the experiment KSP setting allowSourcesFromOtherPlugins

// build.gradle.kts
ksp {
    allowSourceFromOtherPlugins=true
}

Or by manually registering R2 sources as an input to KSP

// In a gradle plugin or build.gradle.kts
project.afterEvaluate {
   setUpR2TaskDependency()
}

fun Project.setUpR2TaskDependency() {
    requireAndroidVariants().forEach { variant ->
        val r2Task = runCatching { project.tasks.named("generate${variant.name.capitalize()}R2") }.getOrNull()
        if (r2Task != null) {
            project.tasks.named("ksp${variant.name.capitalize()}Kotlin").dependsOn(r2Task)

            project.extensions.configure(KotlinAndroidProjectExtension::class.java) {
                sourceSets.getByName(variant.name)
                    .kotlin
                    .srcDir("build/generated/source/r2/${variant.name}")
            }
        }
    }
}

/**
 * Return the Android variants for this module, or error if this is not a module with a known Android plugin.
 */
fun Project.requireAndroidVariants(): DomainObjectSet<out BaseVariant> {
    return androidVariants() ?: error("no known android extension found for ${project.name}")
}

/**
 * Return the Android variants for this module, or null if this is not a module with a known Android plugin.
 */
fun Project.androidVariants(): DomainObjectSet<out BaseVariant>? {
    return when (val androidExtension = this.extensions.findByName("android")) {
        is LibraryExtension -> {
            androidExtension.libraryVariants
        }
        is AppExtension -> {
            androidExtension.applicationVariants
        }
        else -> null
    }
}

1.7.3

13 Apr 19:02
4b0002b
Compare
Choose a tag to compare

1.7.3 (April 13, 2021)

  • Fix generated code consistency in module class (#154)

v1.7.2

11 Nov 22:27
Compare
Choose a tag to compare
  • Fixed ArrayOutOfBoundsException on certain devices when ImageView scaleType is set.

1.7.1

28 Jul 16:26
07da209
Compare
Choose a tag to compare
  • Change ParisConfig annotation to be applicable to class or interface types. New recommendation is to use it on an interface instead of a package to avoid a bug with spurious incremental annotation failure.

  • Fixed annotation processor bugs with Kotlin 1.4. Project should now be compatible with Kotlin 1.4.x - previous Paris versions would crash at compile time.

1.6.0

21 Jul 23:02
a8fa220
Compare
Choose a tag to compare

Adding support for importantForAccessibility attribute (#138)

1.5.0

09 Jul 23:37
e674604
Compare
Choose a tag to compare

Support for incremental annotation processing

v1.4.0

14 Feb 19:35
Compare
Choose a tag to compare
  • Added support for namespaced resources.

v1.3.1

16 Dec 20:42
Compare
Choose a tag to compare
  • Fixed precedence of android:textAppearance attribute.
  • Fixed theme attributes not being applied through programmatic styles.

v.1.3.0

16 Jul 21:31
Compare
Choose a tag to compare
  • New attribute support:
    • View: android:layout_weight
    • TextView
      • android:line_height
      • android:text_appearance
  • Now using Kotlin nullable types in generated extension functions, rather than @Nullable.