Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 2.41 KB

module.md

File metadata and controls

58 lines (44 loc) · 2.41 KB

Klutter Gradle Plugin

The main purpose of the Klutter Gradle Plugin is to connect a Flutter frontend with a Kotlin Multiplatform backend. This plugin provides a set of Gradle tasks which will generate anything from settings files to Kotlin/Dart/Groovy code needed to make Flutter and KMP work together.

Important: For using and/or creating Flutter plugins with Klutter you should use the pub plugin.

Installation

Preferred way of installing/using this plugin is by starting a new project with one of:

Tasks

The gradle plugin defines tasks for compiling the Kotlin Multiplatform module, generating Dart code and more. Some tasks are executed automatically before (compiler plugin) and after running a gradle build.

  1. klutterCompileProtoSchemas
  2. klutterCopyAarFile
  3. klutterCopyFramework
  4. klutterGenerateFlutterLib
  5. klutterGenerateProtoSchemas
  6. klutterGetDartProtoc
  7. klutterGetKradle
  8. klutterGetProtoc

Task: klutterCompileProtoSchemas

Compile protocol buffer schemas which generates boilerplate code for both Kotlin and Dart. This task does nothing when the protobuf feature is not enabled.

Task: klutterCopyAarFile

Copy the root/platform aar file to root/android folder.

Task: klutterCopyFramework

Copy the root/platform iOS Framework to root/ios folder.

Task: klutterGenerateFlutterLib

Generate the Dart library file in the root/lib folder.

Task: klutterGenerateProtoSchemas

Generate protocol buffer schemas which can be used by klutterCompileProtoSchemas. This task does nothing when the protobuf feature is not enabled.

Task: klutterGetDartProtoc

Download the dart protobuf plugin.

Task: klutterGetKradle

Download the kradle cli tool.

Task: klutterGetProtoc

Download the protoc executable tool. The distribution url can be specified in the kradle.env file:

protoc.url=https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-osx-universal_binary.zip