https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
gradle
  • s

    Saul Wiggin

    12/17/2020, 3:14 PM
    Does anyone know why I’m getting this error
    Duplicate class org.apache.http.Consts found in modules jetified-httpclient-android-4.3.5 (org.apache.httpcomponents:httpclient-android:4.3.5) and jetified-httpcore-4.3 (org.apache.httpcomponents:httpcore:4.3.3)
    The best guess I have currently is that something is duplicated or incorrect in the build.gradle file.
    v
    • 2
    • 6
  • j

    Jeff Tycz

    12/18/2020, 1:57 AM
    I am trying to convert groovy tasks from a previous project to my new project that now is a
    .kts
    gradle file and I dont know how to convert them properly here are my two tasks
    task androidJavadocs(type: Javadoc) {
        failOnError = false
        source = android.sourceSets.main.java.srcDirs
        ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
        classpath += files(ext.androidJar)
        exclude '**/R.html', '**/R.*.html', '**/index.html'
    }
    
    task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
        classifier = 'javadoc'
        from androidJavadocs.destinationDir
    }
    Can anyone help me out with this?
    v
    • 2
    • 4
  • c

    christophsturm

    12/18/2020, 12:18 PM
    I’m trying to use a library via
    includeBuild("../nanotest")
    and
    testImplementation("nanotest:nanotest:0.1")
    the build file of the library has this:
    group = "nanotest"
    version = "0.1"
    and the settings file this:
    rootProject.name = "nanotest"
    but when i build gradle does not find it:
    Could not resolve nanotest:nanotest:0.1.
    Required by:
        project :
    I use composite builds all the time and it just works but now i have no idea whats wrong
    • 1
    • 5
  • n

    napperley

    12/20/2020, 3:09 AM
    Is it possible to have a custom Gradle task that exposes a function as part of the API?
    v
    • 2
    • 9
  • s

    samuel

    12/21/2020, 2:10 PM
    i’m migrating from groovy to kotlin and i have a question about extensions. I would like to create an extension in a kotlin file under
    buildSrc
    and access that extension from all the gradle scripts in my project. I was under the impression that it was possible since all files under
    buildSrc
    are automatically added to the class path but it doesn’t seem to work for me. When i define the extension in the same class as its usage, it works fine
    build.gradle.kts
    repositories {
        myExtension()
    }
    
    fun RepositoryHandler.myExtension(): MavenArtifactRepository =
    maven {
        // Some code
    }
    But if i define the extension in another file, i can’t seem to get it to work as here:
    build.gradle.kts
    import extensions.myExtension
    
    repositories {
        myExtension()
    }
    buildSrc/src/main/kotlin/extensions/MyExtensionFile.kt
    package extensions
    // some imports
    
    fun RepositoryHandler.myExtension(): MavenArtifactRepository =
    maven {
        // Some code
    }
    Specifying the extension in another file yields -
    Unresolved reference: extensions
    .Is it possible to have such a setup with reusable extensions accessible from all the gradle files?
    v
    • 2
    • 16
  • m

    mattinger

    12/21/2020, 6:24 PM
    So, we have an app that’s comprised of mutliple smaller libraries. Our dev team is pretty big, so we work in our individual libraries until a feature is ready and then it gets integrated into the app. We’re starting now to use a maven BOM file (which i generate with a custom build.gradle script and publish to nexus). This helps with the jar hell in terms of managing the versions of jetpack libraries that are being used. However, i haven’t really found a way to make sure we’re all on the same gradle plugin and kotlin plugin version. I tried using something like this in the buildscirpt block but it doesn’t work:
    classpath(platform(...))
    classpath("com.android.tools.build:gradle")
    k
    • 2
    • 1
  • u

    ursus

    12/22/2020, 2:36 PM
    Could somebody help converting plugins syntax back to apply plugin? I'm not on the new stuff yet
    plugins {
        id("symbol-processing") version "1.4.20-dev-experimental-20201222"
    }
    I searched maven for "symbol-processing" as to give me the full path, but no luck -- where is that plugin hosted if nothing else is specified?
    v
    • 2
    • 9
  • u

    ursus

    12/23/2020, 1:15 AM
    My gradle sync times (android studio) are getting quite annoyingly long, so I wanted to implement lazy tasks (as I have bunch of static analysis, test setup). First, I naivelly tried to delete those tasks, to see what would be the best case scenario -- and turns out, it did almost nothing Only thing that seems to improve sync times, is simply to not sync everything I have a monorepo setup, a single gradle project with 3 application modules (3 apps) and many shared code modules Most of the time one only works on a single app, so its not necessary to have the other app's modules loaded (and CI will check for breaks everywhere anyway) Is there something more sophisticated other than commenting out modules from
    settings.gradle
    ?
    (I noticed the
    Load/Unload Modules...
    intellij option, which does exactly that, but for builds (green hammer icon), and sync times stay the same, even with the other apps modules unloaded -- so a no go)
    v
    c
    • 3
    • 26
  • s

    Steve Ramage

    12/28/2020, 5:37 PM
    I'm trying to have some plugins applied universally across a build: I've essentially created the following block:
    plugins {
        ...
        id("io.gitlab.arturbosch.detekt") version "1.15.0" apply true
        // ktlint linter - read more: <https://github.com/JLLeitschuh/ktlint-gradle>
        id("org.jlleitschuh.gradle.ktlint") version "9.4.1" apply true
    }
    
    allprojects {
        repositories {
            mavenCentral()
            jcenter()
        }
    
        apply(plugin = "io.gitlab.arturbosch.detekt")
        apply(plugin = "org.jlleitschuh.gradle.ktlint")
    
        dependencies {
            detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.14.2")
        }
    
        // Configure detekt plugin.
        // Read more: <https://detekt.github.io/detekt/kotlindsl.html>
        detekt {
            config = files("${rootProject.projectDir}/detekt-config.yml")
            buildUponDefaultConfig = true
    
            reports {
                html.enabled = false
                xml.enabled = false
                txt.enabled = false
            }
        }
    
        tasks {
            withType<Detekt> {
                jvmTarget = "11"
            }
        }
    }
    I'm getting the following errors:
    e: ./build.gradle.kts:74:9: Unresolved reference: detektPlugins
    e: ./build.gradle.kts:80:5: Unresolved reference: detekt
    e: ./build.gradle.kts:81:9: Unresolved reference: config
    e: ./build.gradle.kts:82:9: Unresolved reference: buildUponDefaultConfig
    e: ./build.gradle.kts:84:9: Unresolved reference: reports
    e: ./build.gradle.kts:85:13: Unresolved reference: html
    e: ./build.gradle.kts:85:18: Variable expected
    e: ./build.gradle.kts:86:13: Unresolved reference: xml
    e: ./build.gradle.kts:86:17: Variable expected
    e: ./build.gradle.kts:87:13: Unresolved reference: txt
    e: ./build.gradle.kts:87:17: Variable expected
    m
    v
    • 3
    • 27
  • s

    Steve Ramage

    12/28/2020, 7:28 PM
    I'm using IntelliJ 2020.3 and Gradle 6.8-rc-1. Does anyone have any tips for speeding up auto-complete and IntelliJ analysis of the gradle files, it seems to take like 5 seconds for auto complete to show up, etc... I have seen this is partially a known issue in the past: https://blog.jetbrains.com/kotlin/2020/02/improved-gradle-kts-ide-support/
    👍 1
    m
    e
    • 3
    • 2
  • z

    zsperske

    12/29/2020, 5:09 PM
    does gradle have its own slack workspace or other venue for asking non-kotlin specific gradle questions?
    m
    v
    e
    • 4
    • 5
  • r

    robstoll

    01/03/2021, 9:48 PM
    question about kotlin-dsl, seems like it behaves differently than groovy:
    subprojects {
       repositories {
            mavenCentral()
            jcenter()
        }
    }
    Dependency is only available in jcenter but the build fails telling me that the dependency is not available in mavenCentral. How can I declare two repositories? (https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:declaring_multiple_repositories looks like it should be correct)
    j
    v
    • 3
    • 27
  • v

    Vampire

    01/04/2021, 9:37 PM
    If you have a few spare minutes, it would be nice if you answer this survey: https://docs.google.com/forms/d/e/1FAIpQLSc9aQrjjsxVqXDkYR35ExeiI1yEIksRXVtN6asuaem084l3aA/viewform
    👍 2
    m
    • 2
    • 6
  • g

    Gus

    01/07/2021, 2:51 PM
    Hey folks. I'm trying to upgrade a dependency defined as
    api 'tech.relaycorp:relaynet:[1.40.0,2.0.0)'
    , and I want to require
    1.41.0
    at a minimum. However, I keep getting the following error:
    Execution failed for task ':compileKotlin'.
    > Could not resolve all files for configuration ':compileClasspath'.
       > Could not find any version that matches tech.relaycorp:relaynet:[1.41.0,2.0.0).
         Versions that do not match:
           - 1.40.0
           - 1.39.1
           - 1.39.0
           - 1.38.4
           - 1.38.3
           - + 76 more
         Searched in the following locations:
           - <https://jcenter.bintray.com/tech/relaycorp/relaynet/maven-metadata.xml>
    However, if you download that
    maven-metadata.xml
    file you'll find version
    1.41.0
    . I get that on CI (https://github.com/relaycorp/relaynet-jvm-testing/pull/21/files) and my local computer. If I use
    api 'tech.relaycorp:relaynet:1.41.0
    ,
    gradle build
    works, but I can't use a fixed version here. Any thoughts on how to fix this?
    v
    • 2
    • 4
  • d

    dirk.dittert

    01/08/2021, 4:19 PM
    Hi! I am porting a Groovy based
    buildSrc
    to Kotlin. What is the equivalent to `project.android.buildTypes.all{buildType ->`(
    android
    is not a property of
    project
    )
    t
    e
    • 3
    • 3
  • j

    janvladimirmostert

    01/09/2021, 11:08 AM
    in a root
    build.gradle.kts
    you can set the version for all plugins:
    plugins {
    
    	val kotlinVersion = "1.4.21"
    	val shadowVersion = "6.0.0"
    
    	kotlin("multiplatform").version(kotlinVersion).apply(false)
    	kotlin("plugin.serialization").version(kotlinVersion).apply(false)
    	id("com.github.johnrengelman.shadow").version(shadowVersion).apply(false)
    
    }
    is there a way to do it with dependencies as well? I've tried adding a dependency block with a
    constraint{...}
    , but the IDE doesn't allow me to add an
    implementation(...)
    inside such a constraint block
    j
    g
    • 3
    • 9
  • t

    tieskedh

    01/10/2021, 9:37 PM
    Question: can I define the url where a dependency is located myself? I'm a dependency on compose, but it attaches
    -samplessources
    for some reason. Without that, it should be able to resolve the dependency..
    v
    r
    • 3
    • 18
  • t

    Tomas Kormanak

    01/13/2021, 10:25 AM
    I am introducing SASS into our KotlinJs project and looking for a sass gradle plugin. Which one would you recomend?
    t
    • 2
    • 1
  • d

    Dariusz Kuc

    01/13/2021, 2:15 PM
    Hello 👋 Anyone else is hitting a problem that Gradle 6.8 cannot resolve platform specific Kotlin module? Trying to bump up Ktor dependencies to 1.5 (from 1.3.1) (https://github.com/ExpediaGroup/graphql-kotlin/pull/1007) What is odd is that if I wipe out my Maven
    .m2/repository
    it works initially but then it subsequently fails (i.e. only sees
    ktor-client-cio
    which fails the build as it needs
    ktor-client-cio-jvm
    ). Chain of events (from the linked PR GH build action): • manually wipe out
    .m2/repository
    and start a build • project A and B are build fine and are able to resolve the
    -jvm
    artifacts • integration tests kick in for maven and gradle plugins - maven tests work fine - gradle tests (using GradleRunner) fail to resolve
    -jvm
    artifacts • project A and B cannot be build anymore and are unable to resolve the
    -jvm
    artifacts Locally • wipe out the
    .m2/repository
    • build project A or B from command line using Gradle wrapper - works fine • reload project in IDEA (which uses Gradle wrapper) -> cannot resolve the
    -jvm
    artifacts
    • 1
    • 1
  • s

    samuel

    01/13/2021, 5:04 PM
    I have a multi-module setup and i am configuring all the modules to use 
    fastInit
     like this:
    kapt {
        javacOptions {
            option("-Adagger.fastInit=enabled")
        }
    }
    I see some warnings that don’t feel clear to me, does anyone know what could trigger such warnings?
    warning: The following options were not recognized by any processor: '[dagger.fastInit, kapt.kotlin.generated]'
    The following options were not recognized by any processor: '[dagger.fastInit, kapt.kotlin.generated]'
    These warnings only affect very few modules
    v
    • 2
    • 7
  • e

    Erik

    01/14/2021, 2:01 PM
    I have a question (I'm using Kotlin Gradle plugin 1.4.21): If my only dependency is
    testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
    , it seems that I don't have to specify a version! Why? I don't have the Kotlin BOM specified either. Only the
    kotlin-test
    dep. And of course the Kotlin Gradle plugin. I know that this version automatically provides the
    kotlin-stdlib
    version including the variant (e.g. JDK8), but judging by this behaviour, it also seems that it provides some kind of Kotlin BOM platform (or at least version constraints) for the
    kotlin-test
    dep (and who knows what others). How does this work? And is it ok to rely on the Kotlin Gradle Plugin version for the
    kotlin-test
    dependency?
    ❓ 1
    t
    i
    • 3
    • 10
  • j

    janvladimirmostert

    01/16/2021, 12:00 PM
    how does one include a library from another project of which you have the code checked out? ProjectB's settings.gradle.kts:
    include("project-a:module-4")
    
    project(":project-a:module-4").projectDir =
        File("../project-a/module-4")
    ProjectB Module4's build.gradle.kts
    sourceSets {
                           val jvmMain by getting {
                               dependencies {
                                   ...
                                   implementation(project(":project-a:module-4"))
    
    
                               }
                           }
                       }
    this compiles, but nothing resolves
    v
    • 2
    • 10
  • m

    Marc Knaup

    01/17/2021, 11:47 PM
    Anyone else having issues to load projects with Gradle 6.8? Only happens when I load a Gradle project in IDEA but works fine in console.
    java.lang.StackOverflowError
    	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.findExternalVariant(NodeState.java:1267)
    	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.getResolvedVariant(NodeState.java:1252)
    	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.getSelectedVariant(EdgeState.java:385)
    	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.findExternalVariant(NodeState.java:1267)
    	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.NodeState.getResolvedVariant(NodeState.java:1252)
    	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.getSelectedVariant(EdgeState.java:385)
    a
    d
    m
    • 4
    • 6
  • s

    suresh

    01/18/2021, 7:41 AM
    How can i pass JPMS
    --add-opens
    option to Kotlin compile task? I was testing the recent loom EA build (JDK 17, which has enabled strong encapsulation of some jdk packages) and failing with the following error.
    Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.util.ResourceBundle.setParent(java.util.ResourceBundle) accessible: module java.base does not "opens java.util" to unnamed module @358e9d30
            at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
            at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
            at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
            at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
            at org.jetbrains.kotlin.com.intellij.util.ReflectionUtil.makeAccessible(ReflectionUtil.java:252)
            at org.jetbrains.kotlin.com.intellij.util.ReflectionUtil.getDeclaredMethod(ReflectionUtil.java:269)
            at org.jetbrains.kotlin.com.intellij.DynamicBundle.<clinit>(DynamicBundle.java:22)
            ... 38 more
    
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':compileKotlin'.
    > Internal compiler error. See log for more details
    The fix is to add
    --add-opens java.base/java.util=ALL-UNNAMED
    option when running java. I tried to set this option in all the following places like 1. gradle properties
    org.gradle.jvmargs=
    2.
    export JAVA_OPTS="--add-opens java.base/java.util=ALL-UNNAMED"
    3. java compile task
    compilerArgs.addAll(
                    listOf(
                        "--enable-preview",
                        "--add-opens",
                        "java.base/java.util=ALL-UNNAMED"
    4. Kotlin compile task
    freeCompilerArgs += listOf(
                    "-progressive",
                    "-Xjavac-arguments=" + listOf(
                        "--add-opens",
                        "java.base/java.util=ALL-UNNAMED"
                    ).joinToString(separator = ",")
    None of these options worked and still getting the above error. Any hint on how to open JDK modules to my all application packages?
    u
    • 2
    • 1
  • v

    Vampire

    01/18/2021, 8:37 AM
    1. Are args for running Gradle itself 2. Is also just looked at by start scripts like the wrapper 3. Is for compiling java, that can never help for compiling Kotlin 4. Sounds reasonable except that you give
    --add-opens,java.base/java.util=ALL-UNNAMED
    , this is most likely not correct. I wonder that it did not complain about that syntax
    s
    • 2
    • 8
  • m

    murdock

    01/18/2021, 1:57 PM
    I have a gradle plugin that adds implementation dependency to KotlinCompilation, everything works fine except commonMain where dependency is not applied
    • 1
    • 1
  • m

    Morten Andersen-Gott

    01/20/2021, 2:56 PM
    Hi. Not sure if this is the right place to ask. I am trying to get jaxb generated java classes into my kotlin project using gradle with the kotlin-dsl. I am applying the
    com.ewerk.gradle.plugins.jaxb2
    -plugin. So far I’ve got the classes generated, but they don’t seem to be added to my classpath correctly, as I can’t use them from my kotlin source code. The generated java classes are put in
    src/generated/java
    . anyone got any experience with using java generators in componation with kotlin? Or got a working jaxb/kotlin/gradle/kotlin-dsl example?
    a
    • 2
    • 8
  • r

    rook

    01/20/2021, 5:19 PM
    I’m having an issue creating a plugin through
    buildSrc
    . The error I’m getting is the following
    Could not find implementation class 'rook.bluetoothpoc.MyPlugin' for plugin 'rook.bluetoothpoc' specified in buildSrc.jar!/META-INF/gradle-plugins/rook.bluetoothpoc.properties
    The path to
    MyPlugin
    is
    root/buildSrc/src/main/java/rook/bluetoothpoc/
    . The path to 
    rook.bluetoothpoc.properties
    is
    root/buildSrc/main/resources/META-INF/gradle-plugins/
    . It contains only the following line:
    implementation-class=rook.bluetoothpoc.MyPlugin
    I feel like I’m missing something really obvious.
    v
    • 2
    • 35
  • d

    Dariusz Kuc

    01/20/2021, 11:03 PM
    Hello 👋 Anyone knows how Gradle determines proper platform Kotlin module? i.e. what determines that Gradle picks up
    -jvm
    artifacts (e.g. given
    io.ktor:ktor-client-cio
    we expect
    io.ktor:ktor-client-cio-jvm
    to be picked up on JVM builds)?
    v
    • 2
    • 31
  • l

    LevT

    01/21/2021, 12:09 PM
    Sorry for me lacking deep motivation to learn Gradle at the moment I have JUnit5 working Please help me with
    build.gradle.kts
    for property testing with Kotest I'd prefer to try it in parallel (not technically said) with another recommended for Kotlin/JVM engine (jqwik? or any preferred over it) And I'm still having no sense of kotlin.test
    s
    • 2
    • 6
Powered by Linen
Title
l

LevT

01/21/2021, 12:09 PM
Sorry for me lacking deep motivation to learn Gradle at the moment I have JUnit5 working Please help me with
build.gradle.kts
for property testing with Kotest I'd prefer to try it in parallel (not technically said) with another recommended for Kotlin/JVM engine (jqwik? or any preferred over it) And I'm still having no sense of kotlin.test
Reviews are welcome
plugins {
kotlin("jvm") version "1.4.21"
id("io.kotest") version "0.2.6"
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
jcenter()
}
dependencies {
implementation("com.google.code.gson:gson:2.8.5")
testImplementation(platform("org.junit:junit-bom:5.7.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("io.kotest:kotest-assertions-core-jvm:4.3.2")
testImplementation("io.kotest:kotest-framework-engine-jvm:4.3.2")
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
How can I know if kotest is working here on itself or via junit5? I am curious about a real check, being aware of the word of the plugin documentation. And please help me adding another PTE (recommended in any opinionated sense)
s

sam

01/23/2021, 5:57 AM
I would avoid the kotest gradle plugin as that is experimental, and use the kotest/junit integration which you have added via the kotest-framework-engine-jvm dependeny.
l

LevT

01/23/2021, 7:07 AM
There is an official word in the docs that seems claiming the opposite "This is an alternative to using JUnit5 support and provides better output than the gradle default, especially for nested tests." https://github.com/kotest/kotest-gradle-plugin BTW, I need a kind of multitest build as a learning device, to get some fluency refactoring tests (between test frameworks) and to select the best framework up to my needs
If I disable the kotest-framework-engine-jvm dependency there is no more FunSpec еtс. What to be added instead?
Sorry I'm getting opposite advice right now, but still have no understanding how to manage builds, these ones that include kotest
s

sam

01/24/2021, 5:16 PM
Do you want a sample build that has kotest in it
View count: 8