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

    Nikky

    01/13/2019, 1:31 AM
    i am trying to make a annotation processor for java and kotlin code.. and for some reason once the kapt plugin is applied the java annotationprocessor does not run at all anymore.. or is ther another way to run a annotation processor on all languages ?
    g
    • 2
    • 1
  • g

    gotoOla

    01/14/2019, 8:09 AM
    Does anyone know how you could go about keeping the run task without using the application plugin and still having the hot reload? The reason why I want to get rid of the application plugin is because it has a lot of the distribution tasks and we are packaging it with the shadow plugin
    n
    g
    d
    • 4
    • 25
  • j

    Johan Vergeer

    01/14/2019, 8:16 AM
    I can even create the task, but then I can't set
    basePackage
    and
    schema
    -.kt
    l
    • 2
    • 1
  • m

    mkobit

    01/14/2019, 5:28 PM
    updated intellij and now it looks like intellij is using the wrong gradle version for my module to compile the scripts so now everything is red🤦‍♂️
    e
    d
    • 3
    • 6
  • n

    nikolaymetchev

    01/15/2019, 6:32 PM
    If I write a custom gradle plugin and publish it to an Ivy repo along with the sources attached is it possible to get Idea/Gradle to download the sources when that plugin is being used? There is an issue from 4 years ago with Jetbrains but I suspect we need to get the Gradle people involved: https://youtrack.jetbrains.com/issue/IDEA-134795
    o
    • 2
    • 4
  • h

    hmole

    01/15/2019, 7:07 PM
    Why does when applying only
    kotlin
    plugin,
    api
    configuration doesn't work as expected(consumers don't see it as transitive dependency), only after applying
    java-library
    modules does it work. Is it intended?
    m
    n
    h
    • 4
    • 9
  • s

    Seri

    01/15/2019, 9:46 PM
    Does anybody have favorite articles or example projects for using buildSrc for handling build logic?
    d
    • 2
    • 1
  • b

    barteks2x

    01/17/2019, 5:01 AM
    (also this is my buildscript with the uploadArchives task commented out https://paste.pound-python.org/show/9Cbepp8dn0pHrlvjmBL9/)
    n
    • 2
    • 27
  • m

    magnusj

    01/17/2019, 5:12 AM
    @barteks2x Tried
    tasks.getByName<Upload>("uploadArchives") {
    ?
    n
    • 2
    • 3
  • t

    thanksforallthefish

    01/17/2019, 10:43 AM
    anybody tried to use the asciidoc plugin? https://asciidoctor.org/docs/asciidoctor-gradle-plugin/
    c
    d
    • 3
    • 15
  • m

    Marc Knaup

    01/17/2019, 5:30 PM
    Is there an easier way to force Gradle to use the same module version for all Kotlin modules?
    configurations {
    		all {
    			resolutionStrategy.eachDependency {
    				if (requested.group == "org.jetbrains.kotlin") {
    					useVersion(embeddedKotlinVersion)
    					because("All Kotlin modules must have the same version.")
    				}
    			}
    		}
    	}
    Something like that being part of the Kotlin Gradle Plugin would be great, but with configurable version of course.
    c
    n
    m
    • 4
    • 7
  • j

    jmfayard

    01/18/2019, 10:56 AM
    @Marc Knaup I use my plugin
    buildSrcVersions
    for that. It extracts all dependencies with their exact version. So you only have to define which dependencies you want
    val forceDependencies = listOf(Libs.kotlin_reflect, Libs.kotlin_stdlib_jdk7)
    and then the
    resolutionStrategy
    block is always the same and straightforward https://github.com/jmfayard/buildSrcVersions/issues/28
    m
    • 2
    • 6
  • a

    aarjav

    01/19/2019, 7:20 PM
    some plugins may do different set up based on os
    d
    • 2
    • 1
  • r

    rook

    01/21/2019, 8:34 PM
    I am having an issue switching to
    gradle.kts
    . I’m working in Android Studio and I’ve replaced my app-level
    build.gradle
    with
    build.gradle.kts
    . My project now helpfully informs me that
    Kotlin not configured
    . I’m not really sure what to do about it. I’ve tried just performing
    Configure Kotlin in Project
    , but it fails with “there aren’t configurators available”.
    c
    g
    • 3
    • 4
  • n

    Nikky

    01/23/2019, 3:12 AM
    something istopped working for me.. i used to have
    -SNAPSHOT
    maven publications that point to the latest actual maven publication.. seems like gradle and/or idea stopped supporting those does anybody know if something like that was mentioned in releasenotes or here ? i just use dynamic version numbers now eg:
    0.4.5+
    instead of
    0.4.5-SNAPSHOT
    it could be that the did not always have a scope in the maven pom.. i guess that would be required, no clue why it worked before then
    x
    • 2
    • 1
  • l

    LeoColman

    01/23/2019, 2:35 PM
    I'm trying to convert this (groovy) to Kotlin KTS
    p
    r
    n
    • 4
    • 41
  • c

    cristiangm

    01/23/2019, 7:38 PM
    Why during Sync on AS there is always?
    Gradle: Build model 'org.jetbrains.kotlin.gradle.KotlinMPPGradleModel' for project ':app'
    I don't use MPP
    • 1
    • 1
  • n

    Nikky

    01/23/2019, 11:32 PM
    with the newest kotlin gradle plugin and enabling the paralell builds and workers this appreared in my build log:
    Could not get logger for ':core:compileKotlin'. Falling back to sl4j logger
    for every module, is it safe to ignore ?
    a
    • 2
    • 1
  • i

    ikej

    01/24/2019, 10:41 AM
    Kotlin 1.3.20 is borderline unusable for me with files in buildSrc: https://youtrack.jetbrains.com/issue/KT-29474
    o
    • 2
    • 1
  • j

    jkbbwr

    01/25/2019, 4:39 PM
    in as much as cpp-library
    c
    • 2
    • 1
  • g

    gumil

    01/26/2019, 11:18 AM
    does anyone know how to parse
    local.properties
    when using kotlin gradle script?
    g
    n
    • 3
    • 7
  • d

    Davide Giuseppe Farella

    01/28/2019, 7:27 AM
    Premise: I don’t strictly need that, I’m just experimenting the gradle-dsl + buildSrc I got this in my Dependencies.kt:
    class Classpath( scope: ScriptHandlerScope ) {
        val dependencies: DependencyHandlerScope.() -> Unit = {
            scope.run {
                classpath( kotlin("gradle-plugin", Versions.kotlin))
                classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}")
                classpath("com.android.tools.build:gradle:3.3.0")
                classpath("com.squareup.sqldelight:gradle-plugin:${Versions.sqldelight}")
            }
        }
    }
    And this in my build.gradle.kts:
    buildscript {
        repositories( Repositories.all )
        dependencies( Classpath(this ).dependencies )
    }
    Is there something wrong here? Sync is running successfully, but I got the warning above my
    kts
    file:
    build configuration failed, using previous dependencies, run 'gradle tasks' for more information
    which is not true, since that doesn’t give me more info 😄
    g
    • 2
    • 76
  • b

    Bernhard

    01/28/2019, 11:06 AM
    hi can someone explain: Could not get logger for ‘:compileKotlin’. Falling back to sl4j logger
    a
    • 2
    • 1
  • u

    user

    01/29/2019, 10:59 AM
    1.1.3 Gradle Kotlin DSL 1.1.3 Release Notes Gradle Kotlin DSL 1.1.3 brings bug fixes and the latest Kotlin release. v1.1.3 is included in Gradle 5.2-RC1. To use it, upgrade your Gradle wrapper in the following fashion: $ cd $YOUR_PROJECT_ROOT $ gradle wrapper --gradle-version 5.2-rc-1 --distribution-type all Updates since v1.1.1 (Gradle 5.1.1) Kotlin 1.3.20 (<a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="402401020" data-permission-text="Issue title is...
    :gradle: 5
    b
    • 1
    • 1
  • x

    xenoterracide

    01/29/2019, 7:24 PM
    how do I fix this, it doesn’t compile
    tasks {
        val dependsOnModules: Task.() -> Unit = {
                gradle.includedBuilds.forEach { dependsOn(it.task(":${this.name}")) }
        }
        "build" dependsOnModules
        "clean" dependsOnModules
        "wrapper" dependsOnModules
    }
    o
    g
    • 3
    • 7
  • a

    aoriani

    01/30/2019, 1:13 AM
    If I create a Kotlin object in `buildSrc', would that object be accessible to a groovy gradle script ?
    i
    g
    j
    • 4
    • 4
  • a

    Aleksey Kornienko

    01/30/2019, 1:17 PM
    Hello, can you please help with my “visual issue”. Project builded successfully, but IDEA mark my build.gradle.kt config red.
    t
    • 2
    • 3
  • n

    Nikky

    01/30/2019, 7:55 PM
    i encountered something funny with gradle plugins yesterday, only applying a plugin to a subproject caused it to use a unsupported gson version, adding the plugin to the rootProject with
    apply false
    and removing the version information from the subProjects plugin block fixed it.. and i have no clue why and whats going on there
    g
    • 2
    • 3
  • n

    Nikky

    01/31/2019, 8:41 AM
    what is the recommended way to check if a task with a specific name and type exists or get a nullable version of it ? i want to configure stuff for multiplatform where maybe the linux or the windows tasks exist.. but not both
    m
    • 2
    • 1
  • s

    snowe

    01/31/2019, 8:23 PM
    https://kotlinlang.slack.com/archives/C8NEU7N9L/p1548957907021200
    x
    s
    +2
    • 5
    • 19
Powered by Linen
Title
s

snowe

01/31/2019, 8:23 PM
https://kotlinlang.slack.com/archives/C8NEU7N9L/p1548957907021200
x

xenoterracide

01/31/2019, 8:29 PM
api()
is the equivalent
s

snowe

01/31/2019, 8:30 PM
that doesn’t work though.
I think I need
java-library
as a plugin???
s

serebit

01/31/2019, 8:36 PM
do you have a kotlin plugin applied? if not, try adding
kotlin-dsl
to your plugins
s

snowe

01/31/2019, 8:39 PM
yeah I have everything working. As soon as I change
compile
to
implementation
everything starts to fail, because
implementation
doesn’t resolve transitively.
therefore I either need to add
implementation
declarations to everything or
api
just to the common modules.
but
api
doesn’t resolve unless I add
java-library
as I just discovered.
but I am not using a java-library.
this is just a multi-module project.
s

serebit

01/31/2019, 8:44 PM
Which is erroring; Intellij, Gradle or both?
s

snowe

01/31/2019, 8:46 PM
sorry I should be clear.
java-library
resolved my issue.
o

octylFractal

01/31/2019, 11:28 PM
java-library
is what you want for that
technically your other module is a library for the others
s

snowe

01/31/2019, 11:34 PM
yeah would just declaring the implementations in each module result in faster gradle builds?
our current module layout is really serialized. I don’t think gradle will be able to build anything in parallel
o

octylFractal

01/31/2019, 11:38 PM
I don't know. I've never had an issue with it being super slow
s

snowe

01/31/2019, 11:38 PM
ok thanks for the help.
j

jlleitschuh

02/01/2019, 8:56 PM
@serebit You shouldn't need to apply the
kotlin-dsl
plugin. The
kotlin-dls
plugin is for developing Gradle plugins using the
kotlin-dsl
.
s

snowe

02/01/2019, 9:46 PM
I specified that I was using the kotlin dsl.
View count: 5