https://kotlinlang.org logo
Join SlackCommunities
Powered by
# bazel
  • c

    Corbin McNeely-Smith

    02/25/2020, 3:18 PM
    set the channel description: Kotlin Bazel Integration
  • c

    Corbin McNeely-Smith

    02/25/2020, 3:20 PM
    Current discussion on designing friends: https://github.com/bazelbuild/rules_kotlin/issues/211
  • a

    akshay

    03/09/2020, 1:18 AM
    https://medium.com/mindorks/bazel-for-android-b52f22885556
    👏 1
  • c

    Corbin McNeely-Smith

    05/05/2020, 1:30 PM
    PSA: rules_kotlin Legacy-1.4.0-rc1 release is out. Let’s start testing it, and see what needs fixing. https://github.com/bazelbuild/rules_kotlin/releases/tag/legacy-1.4.0-rc1 Notable changes: • Releases are now precompiled, suggested production installation is via a release archive. Please see the Development Guide when running from a non-archive repository. (#271) • Support for Kotlin compiler plugins via the kt_compiler_plugin (#308) • Improved determinism for remote builds (#304) • No longer packages non-kotlin generated sources (#263) • Proper classpath handling for java plugins (#318) • Support for propagating Kotlin version to Intellij (#242 )
  • p

    Pratik Tandel

    12/07/2020, 7:22 PM
    This might be a dumb question; there are many gradle-based tools that do different things at compile time based off system properties. How does one go about configuring them via Bazel? What I want to do is not set it via a CLI but set it in a bazel rule
    c
    • 2
    • 2
  • p

    Pratik Tandel

    03/29/2021, 9:32 PM
    All the new changes in bazel look quite good. Is there an ETA for when 1.5.0 will have a new stable release?
  • d

    David Smith

    08/19/2021, 10:31 AM
    what editor/ide are people using with bazel+kotlin?
  • d

    David Smith

    08/19/2021, 10:32 AM
    also, I have to setup special kapt dependencies in gradle, does the kapt stuff work fine with bazel?
  • m

    Marc Plano-Lesay

    08/19/2021, 11:08 AM
    IntelliJ would most likely be the popular option, the plugin works quite well for Kotlin
  • m

    Marc Plano-Lesay

    08/19/2021, 11:11 AM
    kapt works at least to some extent, Dagger and Anvil work just fine for example, but there are some issues with things exporting multiple plugins (e.g. Hilt is unusable in Kotlin for now)
  • d

    David Smith

    08/19/2021, 1:02 PM
    which plugins do you use, the kotlin plugin and the bazel one? just those 2? I couldn’t find a version of the bazel plugin that works with my intellij ce yet (latest version of intellij I think)
  • d

    David Smith

    08/19/2021, 1:02 PM
    is the kotlin plugin able to understand the libraries that are included and so index them properly?
  • m

    Marc Plano-Lesay

    08/19/2021, 1:03 PM
    Yeah Bazel and Kotlin, but the Bazel plugin does indeed lag behind... 2020.3.1 should work I think?
  • m

    Marc Plano-Lesay

    08/19/2021, 1:04 PM
    It indexes properly, there used to be some issues with transitive dependencies but I haven't seen that in a while
  • d

    David Smith

    08/19/2021, 2:44 PM
    cool, sounds nice if I can get it working
  • p

    Pratik Tandel

    10/24/2021, 4:48 PM
    hey folks, the HEAD is broken for
    rules_kotlin
    for many folks. it’d be great if we could unblock it so teams can upgrade to kotlin 1.5 https://github.com/bazelbuild/rules_kotlin
    m
    • 2
    • 14
  • t

    Trammel May

    02/19/2022, 6:44 AM
    Has anyone gotten compose-desktop (or any other jetbrains compose target) building successfully with bazel?
    b
    • 2
    • 2
  • m

    Marcelus Trojahn

    05/13/2022, 5:40 PM
    Hello, maybe someone can give me a hint here… I’m struggling trying to get rid of this warning for a few days now:
    warning: opt-in requirement marker kotlinx.serialization.ExperimentalSerializationApi is unresolved. Please make sure it's present in the module dependencies
    Copy code
    kt_kotlinc_options(
        name = "kt_kotlinc_options",
        warn = "report",
        x_optin = [
            "kotlin.ExperimentalStdlibApi",
            "kotlin.RequiresOptIn",
            "kotlinx.serialization.ExperimentalSerializationApi",
        ],
    )
    the other 2 opt-ins are fine… just the serialization one is stubborn with that warning. everything builds fine though… but I have hundreds of warnings like that and its pretty annoying.
  • m

    Marcelus Trojahn

    05/13/2022, 5:41 PM
    kotlinx.serialization is obviously on the classpath since it builds fine… so I don’t understand the warning or how to fix it.
  • m

    Marcelus Trojahn

    06/01/2022, 12:31 PM
    FYI. Solved this by having a different toolchain, for whatever needs to be annotated with @ExperimentalSerializationApi, applied to its respective build rule.
  • i

    IsaacMart

    09/30/2022, 5:51 AM
    hello guys am trying to build my first project with bazel on windows 10 following https://bazel.build/start/android-app but on build am hit with this Desugaring error and found no solution to it on the internet: kindly assist
    Copy code
    Desugaring src/main/java/com/example/ba
    zel/libgreeter_activity.jar for Android failed: Worker process did not return a WorkResponse:
    
    ---8<---8<--- Start of log, file at C:/users/izow/_bazel_izow/lslgslbe/bazel-workers/worker-5-Desugar.log ---8<---8<---
    LAUNCHER ERROR: Cannot launch process: "bash.exe" -c "C:\\\\Users\\\\IZOW\\\\_bazel_izow\\\\lslgslbe\\\\execroot\\\\__main__\\\\bazel-out\\\\x64_windows-opt-exec-2
    B5CBBC6\\\\bin\\\\external\\\\bazel_tools\\\\tools\\\\android\\\\desugar_java8 --persistent_worker"
    Reason: (error: 2): The system cannot find the file specified.
    ---8<---8<--- End of log ---8<---8<---
    Target //src/main:app failed to build
  • s

    Sam Gammon

    01/01/2023, 3:50 AM
    Hello K friends, What if Node were more than just JS? To celebrate the new year, I am pleased to share a new project called Elide, a new server runtime, like Node or Deno, but polyglot, written in Kotlin and based on GraalVM. We are in alpha and very open to early feedback and contributions for anyone interested, over in #framework-elide 🥳 You can do wild things with it, like fast React SSR in Micronaut or Spring. Guest language support is starting with JS, but there are plans to integrate other languages like Python, Ruby, and Rust/Go/etc. via LLVM. Of course,
    native-image
    is supported out of the box. • 🚀 Trying it out
    Copy code
    curl -sSL --tlsv1.2 dl.elide.dev/cli/install.sh | bash -s -
    👆 the one liner works on Darwin (amd64/arm64), and Linux (amd64) so far.
    If you prefer NPX:
    Copy code
    npx @elide-dev/elide@alpha shell
    K Building Kotlin apps with it Elide can be used as a plain library with a regular Micronaut server, and Ktor support is on the way. There are Maven artifacts in a custom repository which is easy to use during the alpha; you can see a sample here. • G Gradle plugin You can easily install the Gradle plugin to build your frontend assets and your Kotlin/JS, and package it into your server binary. It will handle building for SSR and CSR both, so you can easily switch between browser rendering modes. Check it out here. Maven and Bazel support are planned. • 🖥️ Using the shell
    elide shell
    drops you into a shell just like Node (see attached screenshot), the difference being the
    URL
    class we're using here is implemented in Kotlin, backed by the road-tested power of Micronaut, KotlinX, Netty, and the Java standard library. It has simply been adapted for use in JavaScript, according to the WhatWG URL Spec. • js Use Kotlin/JS or regular Node stack Elide packages and consumes your JS/TS with built-in support for
    esbuild
    , so you can use a standard Node toolchain or the Kotlin/JS stack. • 💨 Super fast React SSR Because Elide is basically Kotlin with a super-fast JS runtime attached, it can do JS SSR without leaving the JVM. This can soon be drop-in compatible with many React apps. You can see a live sample here to confirm it is fast and server-rendered. The code for that sample is pasted below to show how simple it is to call back and forth between Kotlin and your React app:
    Copy code
    @Page class Index : PageWithProps<YourProps>(YourProps.serializer()) {
    
        // Serve React SSR.
        @Get("/") suspend fun indexPage(request: HttpRequest<*>) = ssr(request) {    // 1: tell the server we're going to do SSR for this request
          head {
            title { +"Hello, Elide!" }
            stylesheet("/styles/base.css")
            stylesheet("/styles/main.css")
            script("/scripts/ui.js", defer = true)   // <-- 2: serve the CSR bundle so it can hydrate the react SSR response
          }
          body {
            injectSSR(this@Index, request)    // <-- 3: execute the JS VM to produce the SSR response, and splice it into the server response
          }
        }
    
    }
    • 🐙 Contributors needed The future of software is much more polyglot than today's paradigm: developers love to fight about frameworks, but at the end of the day, we're all writing code, and eliminating barriers between languages means easier collaboration and more value for all of us. It shouldn't be a Node vs. The World or a Rust vs. The World argument; we should get to pick and pull the best code we want from anywhere and use it to build our apps, especially from a multi-platform language like Kotlin. This runtime and framework are designed for that future. *If you agree, join us and make a dent in the universe*; you'll have a chance to be impactful and shape a brave new idea from the ground up. • 🙏 Thank you We chose Kotlin because of the fantastic community. 2023 will be a massive year for Kotlin, and we think that betting the farm on it is reasonable and smart. We are super excited about what JetBrains and Kotlin have in store for us with K2, context receivers, value classes... just so much to look forward to. Cheers and happy new year, Kotlin devs, K sam Slack Conversation
  • s

    Sam Gammon

    01/01/2023, 3:50 AM
    cross-posted because we will soon be gaining Bazel support in elide 🚀
  • d

    Dragos Rachieru

    01/01/2023, 4:13 PM
    Is this channel used only for kotlin+Bazel? I want to create a gRPC proto that will have a C++ server and a kotlin client, but the kotlin client will be used in a Gradle app, how can I export a Jar from Bazel for the Gradle app?
  • s

    spierce7

    01/27/2023, 8:48 PM
    How good is the current support for Kotlin Multiplatform in Bazel? Currently I'm using Gradle, and there is a wall as to how man modules you can reasonably have.
    ➕ 5
    d
    l
    +2
    • 5
    • 12