Coder Social home page Coder Social logo

composedesktopappusingprereleasecomposecompiler's Introduction

Using Compose Compiler to support different versions of Kotlin

For the purposes of testing, development, or just living on the edge... some people want to use versions of Kotlin that are not yet officially supported by the Compose Compiler. For this purpose, we publish some branches the Compose Compiler that follow various versions of the Kotlin Compiler.

It is worth noting that these builds of the Compose Compiler typically undergo less testing than the final builds published on Gmaven, so adopt at your own risk.

Compatibility table

To see a table of Kotlin versions and their matching Compose Compiler versions, check out the compatibility table on androidx.dev: https://androidx.dev/storage/compose-compiler/repository

Project Configuration

This repository contains an example Compose project using pre-release builds of both the Kotlin and the Compose Compiler, while pointing to stable versions of the Compose UI libraries.

Specifically, there are two things to point out:

  • settings.gradle:9 upgrade the compose gardle plugin which includes bug fixes:

       id("org.jetbrains.compose").version("1.2.0-beta02-dev798")
    
  • gradle.properties:3 sets the desired version of Kotlin:

       kotlin.version=1.7.20
    
  • app/build.gradle:12 adds the compose compiler pre-release repository:

    maven("https://androidx.dev/storage/compose-compiler/repository/")
    
  • app/build.gradle:29 swaps the jetbrains ComposeCompiler build with the google ComposeCompiler:

    // Use the Google-built Compose Compiler pre-release
    allprojects {
      configurations.all {
        resolutionStrategy.dependencySubstitution {
          substitute(module("org.jetbrains.compose.compiler:compiler")).apply {
            using(module("androidx.compose.compiler:compiler:1.4.0-dev-k1.7.20-RC-a143c065804"))
          }
        }
      }
    }
    
  • app/build.gradle:40 disables the compatibility version check:

    // Suppress version compatibility check, sicne this pre-release was built for Kotlin 1.7.20-RC
    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
     kotlinOptions {
       freeCompilerArgs += listOf(
         "-P",
         "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
       )
     }
    }
    

Compose Desktop Application

  • ./gradlew run - run application
  • ./gradlew package - package native distribution into build/compose/binaries

composedesktopappusingprereleasecomposecompiler's People

Contributors

jimgoog avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.