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
  • m

    mkobit

    10/24/2018, 7:07 PM
    anybody have a good example of POM modification for a
    MavenPublication
    using
    withXml
    ?
    s
    n
    +2
    • 5
    • 9
  • j

    jcechace

    10/29/2018, 9:09 AM
    Since I don’t have enough experience with Kotlin nor with Gradle. Could somebody point me out to some example of how to create fat-jar with kotlin dsl in gradle?
    g
    m
    e
    • 4
    • 9
  • m

    mp

    10/29/2018, 3:48 PM
    Is there a recommended way to enable progressive mode compilation in a gradle build?
    a
    • 2
    • 1
  • r

    rivu.chakraborty

    10/30/2018, 8:23 AM
    Hi, facing an issue with Kotlin gradle dsl, need some help. We've a multi-module project, with a module
    :buildSrc
    providing dependencies to all other modules with Kotlin Gradle DSL. This is the build.gradle.kts file inside buildSrc
    import org.gradle.kotlin.dsl.`kotlin-dsl`
    
    plugins {
        `kotlin-dsl`
    }
    It was running perfectly well with Kotlin 1.2.50, but as soon as we update the Kotlin version to 1.3.0, we're getting the below gradle issue.
    org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':buildSrc'.
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
    g
    k
    • 3
    • 2
  • r

    rivu.chakraborty

    10/30/2018, 9:39 AM
    @antonioleiva any help on that?
    a
    • 2
    • 2
  • h

    hallvard

    10/30/2018, 10:06 AM
    Would anyone be kind to remind me how to set the JVM target to 1.8 in an mpp gradle file?
    o
    h
    • 3
    • 5
  • r

    RichyHBM

    10/30/2018, 10:13 AM
    Has anyone managed to get the gradle2kts tool to work? https://github.com/gradle/gradle2kts
    o
    b
    • 3
    • 3
  • h

    hallvard

    10/30/2018, 12:09 PM
    Would love to. But I got this:
    Plugin 'maven-publish' is a core Gradle plugin, which is already on the classpath. Requesting it with the 'apply false' option is a no-op.
    n
    • 2
    • 1
  • d

    darkmoon_uk

    10/30/2018, 8:53 PM
    Hey David, friendly hint - if you begin and end your code block with three backticks `, like this:
    Your code will be
    much more nicely formatted
    for others to see,
    ❓ 3
    s
    d
    • 3
    • 3
  • k

    kartikpatodi

    10/31/2018, 10:12 AM
    Is there a direct flag for selecting the Kotlin build script dsl? Interactive init is nice but is there a direct flag?
    g
    • 2
    • 4
  • k

    kartikpatodi

    10/31/2018, 10:21 AM
    How to add
    JUnit5
    in the plugins block? As per my research junit is aldready bundled with gradle🤔
    g
    • 2
    • 1
  • p

    plastiv

    10/31/2018, 1:46 PM
    How to declare kotlin compile args globally without copy-paste for every subproject? Currently using this snippet
    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
        kotlinOptions {
            allWarningsAsErrors = true
            freeCompilerArgs = ["-Xprogressive"]
        }
    }
    g
    t
    c
    • 4
    • 3
  • s

    Saša Šijak

    11/02/2018, 6:19 AM
    Is it safe to start using Gradle 5 release candidates on new projects with kotlin dsl? I mean how many large breaking changes are there compared to 4.X? Will most of the plugins that worked with 4 "just work" with 5. I don`t have much exp with Gradle (did not like groovy build scripts) but want to try kotlin in there
    g
    • 2
    • 6
  • i

    irus

    11/02/2018, 11:57 AM
    As I understand this is the only way to enable progressive mode currently (Kotlin DSL)?
    tasks.withType<KotlinJvmCompile> {
        kotlinOptions {
            freeCompilerArgs += listOf("-Xprogressive")
        }
    }
    g
    n
    • 3
    • 5
  • j

    Johan Vergeer

    11/02/2018, 1:26 PM
    But that’s written in Groovy, and I’m struggling with closures to convert this snippet
    -.groovy
    g
    • 2
    • 4
  • j

    Johan Vergeer

    11/02/2018, 1:29 PM
    Could this be a good approach?
    Untitled.kt
    g
    • 2
    • 11
  • m

    mp

    11/02/2018, 4:12 PM
    that’s likely up to the test library you’re using to discover tests appropriately
    h
    • 2
    • 2
  • n

    Nikky

    11/05/2018, 1:51 PM
    this may be another mor-gradle-than kotlin question, i am trying to do a mavenPublication and shadow in some dependecies with shadowJar (kotlin-stdlib, kotlin-reflection and coroutines but thats deside the point) when i use shadowjar it wipes all dependnecy inforfmation, so those other compile configurations are not listed in the pom does anybody know how do avoid that ?
    i
    • 2
    • 5
  • m

    mp

    11/05/2018, 10:58 PM
    Where are issues for the kotlin gradle plugin?
    JetBrains/kotlin
    repo doesn't seem to have issues enabled. On Gradle 5.0-rc-1, the kotlin plugin produces:
    The DefaultSourceDirectorySet constructor has been deprecated. This is scheduled to be removed in Gradle 6.0. Please use the ObjectFactory service to create instances of SourceDirectorySet instead.
    d
    r
    • 3
    • 3
  • d

    deviant

    11/06/2018, 10:35 AM
    hey guys. is there a way to simplify this record?
    compileKotlin {
        kotlinOptions {
            jvmTarget = "1.8"
            freeCompilerArgs = [
                    '-Xuse-experimental=kotlinx.coroutines.ObsoleteCoroutinesApi',
                    '-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi',
                    "-XXLanguage:+InlineClasses"
            ]
        }
    }
    compileTestKotlin {
        kotlinOptions {
            jvmTarget = "1.8"
            freeCompilerArgs = [
                    '-Xuse-experimental=kotlinx.coroutines.ObsoleteCoroutinesApi',
                    '-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi',
                    "-XXLanguage:+InlineClasses"
            ]
        }
    }
    e
    g
    • 3
    • 6
  • v

    ValV

    11/06/2018, 4:21 PM
    How do I implement
    compileKotlin
    task? Do I need
    val compileKotlin: KotlinCompile by tasks
    line?
    v
    • 2
    • 4
  • v

    ValV

    11/06/2018, 4:38 PM
    Well, I'm trying to
    import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
    , but it says
    Unresolved reference: jetbrains
    . So I need
    kotlin-gradle-plugin
    to installed somehow, right? I have
    mavenLocal()
    and
    mavenCentral()
    , how do I get the plugin into local repository and plug outta there?
    k
    • 2
    • 22
  • h

    henrik

    11/09/2018, 9:43 AM
    Hi! Does anyone know what the kts command is for setting a environment variable? in groovyn it would be
    run { environment "key" "value" }
    n
    g
    • 3
    • 4
  • d

    dsvoronin

    11/12/2018, 10:26 AM
    is there any way to force kotlin-dsl version higher(lower) than bundled into gradle distrubution?
    g
    c
    • 3
    • 12
  • s

    steamstreet

    11/12/2018, 7:42 PM
    I have a multi-module project that I'm upgrading to 1.3. I have a SpringBoot java project that defines a dependency on a JS project that is built with the kotlin front-end project. Everything was working really well previously, but after upgrade, I get an error when I try to include the dependency in my build file (
    compile(project(":client"))
    ). The error is
    Required org.gradle.usage 'java-runtime' and found incompatible value 'kotlin-api
    a
    • 2
    • 5
  • d

    dsvoronin

    11/13/2018, 8:14 AM
    https://kotlinlang.slack.com/archives/C19FD9681/p1542018400136700 Is there any plans to backport 1.0.x dsl to 4.x gradle? Android devs kinda stuck between unstable Android Studio 3.4 canary (gradle 5 rc not even supported yet) and 4.9 kotlin dsl. dsl 1.0rc in 4.10.x has memory leak issue (https://github.com/gradle/kotlin-dsl/pull/1188) i’m only one seeing this?
    ➕ 2
    🙏 1
    m
    j
    e
    • 4
    • 40
  • p

    Paul Woitaschek

    11/13/2018, 10:38 AM
    How can I apply the progressive compiler mode for all modules?
    p
    g
    d
    • 4
    • 18
  • l

    Lonwabo

    11/14/2018, 9:15 AM
    Hello, Has anyone been able to configure requery using kotlin dsl in build.gradle.kts?
    g
    • 2
    • 6
  • p

    Paul Woitaschek

    11/14/2018, 9:32 AM
    Oh I hate Gradle. They told us modularizing would speed up the build. Now my Gradle sync takes 2 minutes each time 😿
    a
    h
    +5
    • 8
    • 51
  • u

    user

    11/14/2018, 4:34 PM
    1.0.3 Gradle Kotlin DSL 1.0 Release Notes Gradle Kotlin DSL 1.0 brings Kotlin 1.3.0, performance improvements, script compilation build cache, API/DSL refinements and fixes. In order to benefit from the best user experience, please update IntelliJ IDEA to 2018.3, Android Studio to 3.2 and their Kotlin Plugin to the latest 1.3. Thanks to a great help from the community, the Gradle User Manual now contains samples...
    :gradle: 1
    😿 1
    🎉 1
    😎 1
    c
    b
    • 2
    • 3
Powered by Linen
Title
u

user

11/14/2018, 4:34 PM
1.0.3 Gradle Kotlin DSL 1.0 Release Notes Gradle Kotlin DSL 1.0 brings Kotlin 1.3.0, performance improvements, script compilation build cache, API/DSL refinements and fixes. In order to benefit from the best user experience, please update IntelliJ IDEA to 2018.3, Android Studio to 3.2 and their Kotlin Plugin to the latest 1.3. Thanks to a great help from the community, the Gradle User Manual now contains samples...
:gradle: 1
😿 1
🎉 1
😎 1
c

cristiangm

11/14/2018, 6:03 PM
I expected it to update kotlin to 1.3.10
b

bamboo

11/14/2018, 7:08 PM
We wanted to ship 1.3.10 but bumped into https://youtrack.jetbrains.com/issue/KT-28203
👌 1
c

cristiangm

11/14/2018, 9:44 PM
Ouch. And meantime android projects with AGP 3.3.0-beta04 don't work with Gradle 5.0 either.. It seems 5.0 stable is not being an easy release
View count: 4