Skip to content

fluxo-kt/fluxo-kmp-conf

Repository files navigation

Fluxo-KMP-Conf

Gradle Plugin Portal JitPack Build Common Changelog

Convenience Gradle plugin for reliable configuration of Kotlin & KMP projects.

  • Completely lazy on-demand project configuration framework with many nice-to-have things out-of-the-box.
  • Automatically configures hierarchical source sets, proveds convenience DSL for them.
  • You can control, which targets are enabled by passing properties at build time. With no errors in modules with all targets disabled!
  • Ready for Android, JS, KMP, KMM, JVM or IDEA plugin modules.
  • Allows configuring verification tasks (Detekt, Lint, BinaryCompatibilityValidator with JS support!).
    • Provides merged Sarif reports for the whole project.
    • Provides baseline configuration tasks.
  • Convenience console tests report at the end of the build along with merged XML report for the whole project.
  • Allows using ProGuard and/or R8 as an optimizer for JVM targets.
  • Enables passing of build targets via command line to control what gets configured (great for CI).

Initially made for the Fluxo state management framework and other libraries, then published for general use.

Targeted for Gradle 8+ and Kotlin 1.9+. Built with:
Kotlin Gradle Android Gradle Plugin

How to use

Gradle Plugin Portal

// in the `build.gradle.kts` of the target module
plugins {
  kotlin("multiplatform") version "1.9.23"
  id("io.github.fluxo-kt.fluxo-kmp-conf") version "0.8.1" // <-- add here
}
How to use snapshots from JitPack repository

JitPack

// in the `build.gradle.kts` of the target module
plugins {
  kotlin("multiplatform") version "1.9.23"
  id("io.github.fluxo-kt.fluxo-kmp-conf") // <-- add here, no version needed for jitpack usage
}
// in the `settings.gradle.kts` of the project
pluginManagement {
  repositories {
    gradlePluginPortal()
    maven("https://jitpack.io") // <-- add jitpack repo
  }
  resolutionStrategy.eachPlugin {
    if (requested.id.toString() == "io.github.fluxo-kt.fluxo-kmp-conf")
      useModule("com.github.fluxo-kt.fluxo-kmp-conf:fluxo-kmp-conf:3002cb3137") // <-- specify version or commit
  }
}

Hierarchical KMP project structure

Fluxo-KMP-Conf automatically configures KMP projects with a hierarchical source-set structure based on the module configuration.

 common
   |-- commonJvm
   |     |-- jvm
   |     '-- android
   '-- nonJvm
         |-- commonJs
         |  |-- js
         |  '-- commonWasm (unstable, may be not available)
         |      |-- wasmJs
         |      '-- wasmWasi (experimental)
         '-- native
               |-- nix (unix-like systems)
               |     |-- apple
               |     |     |-- ios
               |     |     |     |-- iosArm64
               |     |     |     |-- iosX64
               |     |     |     '-- iosSimulatorArm64
               |     |     |-- macos
               |     |     |     |-- macosArm64
               |     |     |     '-- macosX64
               |     |     |-- tvos
               |     |     |     |-- tvosArm64
               |     |     |     |-- tvosX64
               |     |     |     '-- tvosSimulatorArm64
               |     |     '-- watchos
               |     |           |-- watchosArm32
               |     |           |-- watchosArm64
               |     |           |-- watchosDeviceArm64 (tier 3)
               |     |           |-- watchosX64
               |     |           '-- watchosSimulatorArm64
               |     |-- linux
               |     |     |-- linuxArm32Hfp (deprecated)
               |     |     |-- linuxArm64
               |     |     '-- linuxX64
               |     '-- androidNative (tier 3, can has limited set of POSIX APIs)
               |          |-- androidNativeArm32
               |          |-- androidNativeArm64
               |          |-- androidNativeX64
               |          '-- androidNativeX86
               '-- mingw (Windows with limited set of POSIX APIs)
                     |-- mingwX64

Build and development notes

  • REQUIRES ENABLED GIT SYMLINKS for the project to work correctly!
    • On Windows, see this doc for more info.
  • See CONTRIBUTING.md for more info on how to contribute.

Heavily inspired by

Versioning

Uses SemVer for versioning.

License

License

This project is licensed under the Apache License, Version 2.0 — see the license file for details.