https://kotlinlang.org logo
Docs
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

    sdeleuze

    03/27/2017, 9:34 AM
    Is there any example of Dokka + Gradle Kotlin somewhere?
    • 1
    • 1
  • r

    richardcatlin

    03/27/2017, 4:53 PM
    @mkobit That works, but then the run task should be of type JavaExec and have an args field as in the groovy doc, but doesn't. How do configure the property to be the args?
    m
    • 2
    • 1
  • s

    suresh

    04/02/2017, 10:46 PM
    the
    optimize import
    action is not working for gsk scripts. Is this a known issue? Couldn't find anything in my search.
    b
    • 2
    • 3
  • g

    groostav

    04/06/2017, 4:18 AM
    yeah, i just cloned the gradle script kotlin repo and i cant even build the sample projects :S
    b
    f
    • 3
    • 9
  • b

    bamboo

    04/08/2017, 12:31 PM
    @suresh maybe you’re running into this issue: https://github.com/gradle/gradle-script-kotlin/issues/204#issuecomment-289452735
    s
    • 2
    • 5
  • e

    ethankhall

    04/10/2017, 2:03 AM
    something fun to try would be to add something like
    compileKotlin.getInputs().files(project.files('.').filter { it.name.endsWith('.kt') })
    to get the compileKotlin task to recompile when the files have been updated
    👍 1
    s
    • 2
    • 2
  • s

    suresh

    04/12/2017, 12:02 AM
    Any one facing issues with latest EAP Kotlin plugin update (
    1.1.2-eap-69-IJ2017.1-1
    ) ? gsk script is full of errors now. Right now using
    3.5-20170331195952+0000
    wrapper version.
    b
    i
    n
    • 4
    • 11
  • y

    yoavst

    04/12/2017, 10:20 AM
    Someone?
    s
    • 2
    • 1
  • m

    mwerschy

    04/16/2017, 5:27 PM
    I'm trying to switch over a project to use kotlin build scripts. The build works fine now but idea is still complaining about unresolved references everywhere (
    gradle
    ,
    buildscript
    , etc). Anything else I need to do to get idea to find those?
    😒imple_smile: 1
    s
    y
    • 3
    • 3
  • j

    jlleitschuh

    04/21/2017, 2:51 PM
    @bamboo Working with gradle and having a strongly typed build system has drastically increased my productivity when it comes to solving build issues and adding features. I sing your praises to my coworkers. Thank you for your hard work and dedication on this project.
    👍 4
    ➕ 3
    ❤️ 4
    b
    m
    • 3
    • 2
  • s

    suresh

    04/24/2017, 11:05 PM
    Is there any better way to access the
    java
    and
    kotlin
    sourcesets (main & test) from gsk ?
    val compileJava: JavaCompile by tasks
    compileJava.doFirst {
        java.sourceSets.asMap.forEach { name, srcSet ->
            val ktSrcSet = (srcSet as HasConvention).convention.getPlugin<KotlinSourceSet>()
            println("Java-${name.capitalize()} => ${srcSet.allSource.srcDirs.map { it.name }}")
            println("Kotlin-${name.capitalize()} => ${ktSrcSet.kotlin.srcDirs.map { it.name }}")
        }
    }
    m
    • 2
    • 1
  • b

    bamboo

    04/26/2017, 5:22 PM
    @sdeleuze have you tried running the build with one of those extensions in the build script? I wonder if it wasn’t a problem with the IDE only
    s
    • 2
    • 2
  • b

    bamboo

    04/26/2017, 6:05 PM
    you can think of the
    buildscript
    and
    plugins
    blocks as separate scripts
    s
    • 2
    • 1
  • v

    vach

    04/26/2017, 7:22 PM
    Hi all, is there a decent guide for getting started a fresh project with gradle script kotlin?
    s
    • 2
    • 1
  • w

    walkinreader

    04/26/2017, 7:23 PM
    Has anyone had any luck using the jruby gradle plugin? I'm trying to use it now, but the documentation says to add a "gem" line to the dependencies list, but that fails. I'm not sure what to do now. I'm going by this: http://mrhaki.blogspot.com/2014/11/awesome-asciidoctor-use-asciidoctor.html and this http://jruby-gradle.org/
    s
    • 2
    • 1
  • p

    Paul Woitaschek

    05/01/2017, 6:48 PM
    How can I import other scripts in my script?
    s
    b
    • 3
    • 10
  • a

    alband

    05/02/2017, 5:36 PM
    I got a question : I just discover that inline functions from a "1.6 target" dependency cannot be inline in a "1.8 target project" [edit] only the contrary is right
    i
    • 2
    • 5
  • a

    alband

    05/03/2017, 3:21 AM
    is build.gradle.kts dead ?
    b
    a
    • 3
    • 5
  • s

    sdeleuze

    05/09/2017, 12:15 PM
    Hey, how are we supposed to share the same
    kotlinVersion
    between the new
    plugin { }
    block and the
    dependencies { }
    one? (I made quick tries with
    by extra
    but could not make it works)
    s
    • 2
    • 4
  • g

    gildor

    05/09/2017, 1:29 PM
    @sdeleuze You can get Kotlin plugin version from plugin properties:
    ext.kotlin_version = project.plugins.findPlugin("kotlin").properties["kotlinPluginVersion"]
    s
    • 2
    • 3
  • g

    gildor

    05/09/2017, 1:32 PM
    Also, now you can omit version for Kotlin dependencies, by default Kotlin plugin set version of plugin to dependencies
    s
    • 2
    • 2
  • s

    sergei.lebedev

    05/12/2017, 9:28 PM
    Hi folks, is there a way to access sourceSets in the API? I’m translating the following Groovy bit
    task sourcesJar(type: Jar) {
        classifier = 'sources'
        from sourceSets.main.allSource
    }
    s
    m
    • 3
    • 10
  • m

    mkobit

    05/18/2017, 2:48 AM
    i see https://plugins.gradle.org/plugin/org.jetbrains.kotlin.plugin.allopen and https://plugins.gradle.org/plugin/org.jetbrains.kotlin.plugin.noarg compiler plugins, is there one available for the
    @SamWithReceiver
    (dont see it documented on https://kotlinlang.org/docs/reference/compiler-plugins.html )
    y
    • 2
    • 2
  • p

    pawel.barszcz

    05/21/2017, 12:25 PM
    Questions: 1. Is it OK that I change all the
    compile
    to
    implementation
    (and
    testCompile
    to
    testImplementation
    )? Did I understand gradle output correctly with its deprecation warning? 2. What is the proper configuration to have library in B avaiable in A too? (if A is including B, and as we know from Gradle output,
    compile
    is deprecated) 3. Is there any place where I can read about currently supported configurations and what is the result of using them?
    m
    • 2
    • 5
  • r

    rocketraman

    05/21/2017, 2:38 PM
    Experimenting with migrating a project from
    build.gradle
    to
    build.gradle.kts
    . Getting the error
    com.gradle.scan.plugin.BuildScanExtension cannot be cast to com.gradle.scan.plugin.BuildScanExtension
    s
    • 2
    • 10
  • a

    annyce

    05/21/2017, 3:33 PM
    I'm trying to add a new
    sourceSet
    in my
    build.gradle.kts
    but the
    kotlin
    is not being recognized:
    val sourceSets = the<JavaPluginConvention>().sourceSets
    
    sourceSets {
        "functionalTest" {
            kotlin {
                srcDir(file("src/functionalTest/kotlin"))
            }
            resources {
                srcDir(file("src/functionalTest/resources"))
            }
            compileClasspath += sourceSets["main"].output + configurations.testRuntime
            runtimeClasspath += output + compileClasspath
        }
    }
    s
    • 2
    • 7
  • s

    suresh

    05/21/2017, 7:58 PM
    @ilya.chernikov Can we expect this to be fixed before 1.0 release https://youtrack.jetbrains.com/issue/KT-17771 ? Currently it’s marked as a bug with no priority. IMO, this is a major usability issue as the IDE hang for 10's of seconds when ever i edit
    build.gradle.kts
    file .
    i
    • 2
    • 1
  • d

    dagguh

    05/22/2017, 4:12 PM
    Hi, how to translate the Gradle Script Groovy
    configurations {
        foo
        bar
        baz
    }
    to Gradle Kotlin Script?
    s
    • 2
    • 2
  • d

    dagguh

    05/22/2017, 4:13 PM
    IntelliJ doesn’t see the
    ConfigurationContainer
    javadoc
    s
    • 2
    • 2
  • r

    rocketraman

    05/23/2017, 9:02 PM
    Is it just me, or is it actually quite difficult to migrate a reasonably complex Groovy-based build to a Kotlin-based one?
    a
    c
    • 3
    • 2
Powered by Linen
Title
r

rocketraman

05/23/2017, 9:02 PM
Is it just me, or is it actually quite difficult to migrate a reasonably complex Groovy-based build to a Kotlin-based one?
a

annyce

05/24/2017, 2:26 AM
rocketraman: it's not just you...I'm hoping with the 1.0 release things will be easier.
c

Czar

05/24/2017, 7:00 AM
It's a progress, not so long ago it was difficult even to migrate a very simple one.
👍 2
View count: 1