Files
compose-multiplatform/gradle-plugins
Igor Demin bf958eb510 Improve DSL for setting a custom Compose Plugin (#2527)
* Improve DSL for setting a custom Compose Plugin

Fixes https://github.com/JetBrains/compose-jb/issues/2459

Readme: https://github.com/JetBrains/compose-jb/pull/2526

1. Add `dependencies: Dependencies` extension that is accessible in `compose { }` block
2. Add `Dependencies.compiler` property that can return versions of Compose compiler used by the plugin:
```
compose {
    kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.7.20"))
    //kotlinCompilerPlugin.set(dependencies.compiler.auto) // determined by applied version of Kotlin. It is a default.
}
```

3. Add ability to set arguments for Compose Compiler. Now we can write:
```
compose {
    kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.7.20"))
    kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.7.21")
}
```

4. Remove checks for different targets

We had a separate check for JS, when we released 1.2.0. It doesn't support Kotlin 1.7.20 at that moment.

It is hard to refactor this feature in the new code, so I removed it. It is not needed now and it had an ugly code. When we will need it again, we'll write it again.

5. Remove the `compose.tests.androidx.compiler.version` property from gradle.properties and remove `defaultAndroidxCompilerEnvironment`

Because they are used only in one test, and it seems there is no reason to use it in another place in the future

* Discussions
2022-12-13 07:27:33 +01:00
..
2020-10-29 20:40:27 +03:00

JetBrains Compose gradle plugin for easy configuration

Environment variables:

  • COMPOSE_GRADLE_PLUGIN_VERSION - version of plugin
  • COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION - version of JetBrains Compose used by the plugin