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

    lex

    02/12/2018, 5:45 AM
    hi, how I can do it right?
    g
    • 2
    • 19
  • j

    jeherrejon08

    02/13/2018, 10:42 PM
    Hello, I'm getting a conflict version between my project and the buildSrc, using the
    kotlin-dsl
    plugin
    c
    • 2
    • 13
  • z

    ziggy42

    02/14/2018, 8:41 AM
    Are kotlin gradle scripts ready for production? If not how near?
    c
    n
    +3
    • 6
    • 16
  • a

    aballano

    02/18/2018, 10:41 PM
    Ok, but in the same context, how to create in Kotlin-dsl deps such as this in gradle?
    robolectric : dependencies.create("...") {
        exclude group: 'org.assertj'
    },
    g
    • 2
    • 4
  • h

    hmole

    02/20/2018, 10:51 AM
    Hello. Is there a way to do dependency management with buildSrc but for multiple gradle projects? Extract it into a plugin or setup shared buildSrc dir? https://handstandsam.com/2018/02/11/kotlin-buildsrc-for-better-gradle-dependency-management
    g
    • 2
    • 8
  • h

    hmole

    02/20/2018, 1:25 PM
    @eskatos Any news on when there will be a working sample project for gradle-kotlin-dsl for android?
    g
    • 2
    • 5
  • m

    mantono

    02/20/2018, 3:54 PM
    Anyone know how to setup Jacoco with Gradle? I never get it to generate any coverage reports, I guess it somehow does not find my generated class files or something.
    w
    • 2
    • 1
  • c

    Czar

    02/22/2018, 1:56 PM
    Hm... shouldn't
    settings.gradle.kts
    be evaluated before
    build.gradle.kts
    ? Specifically
    pluginManagement
    part?
    g
    • 2
    • 1
  • c

    Czar

    02/22/2018, 2:00 PM
    Gradle version
    4.5.1
    gradle.properties
    kotlin.version=1.2.21
    build.gradle.kts
    plugins {
    	kotlin("jvm")
    }
    settings.gradle.kts
    pluginManagement {
    	repositories {
    		gradlePluginPortal()
    	}
    	resolutionStrategy {
    		eachPlugin {
    			if (requested.id.id.startsWith("org.jetbrains.kotlin")) {
    				useVersion(gradle.rootProject.extra["kotlin.version"] as String)
    			}
    		}
    	}
    }
    
    rootProject.name = "blabla"
    $ gradle tasks
    result:
    FAILURE: Build failed with an exception.
    Build file '/home/czar/work/occ/build.gradle.kts' line: 2
    Plugin [id: 'org.jetbrains.kotlin.jvm'] was not found in any of the following sources:
    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Gradle Central Plugin Repository (plugin dependency must include a version number for this source)
    g
    • 2
    • 20
  • e

    evan

    02/28/2018, 12:18 AM
    Has anyone been able to get unit test coverage for
    inline
    functions with gradle? I’ve done a cursory search on Stack and found no leads: https://stackoverflow.com/questions/41466092/code-coverage-inline-function
    • 1
    • 1
  • g

    gaetan

    02/28/2018, 10:32 AM
    Is it possible to use kotlin dsl for multiplatform projects?
    g
    • 2
    • 3
  • m

    mkobit

    02/28/2018, 5:47 PM
    has anybody gotten
    settings.gradle.kts
    scripts to work in IntelliJ?
    c
    • 2
    • 3
  • a

    araqnid

    02/28/2018, 5:56 PM
    they used to work, but broke a couple of upgrades ago
    👍 1
    c
    • 2
    • 2
  • s

    sdeleuze

    03/01/2018, 11:31 AM
    This (Groovy version) does not seem to work:
    test {
    	useJUnitPlatform()
    }
    b
    m
    • 3
    • 8
  • j

    jlleitschuh

    03/01/2018, 4:25 PM
    @bamboo Still wish there was an easy way to make the dsl:
    tasks {
      "test"<Test> {
        useJUnitPlatform()
      }
    }
    Just looks cleaner IMO
    💯 2
    b
    • 2
    • 1
  • v

    Vova Lantsov

    03/05/2018, 6:33 AM
    How to include ':app' in settings.gradle.kts?
    g
    • 2
    • 1
  • v

    voddan

    03/05/2018, 10:40 AM
    Hello! Could you recommend a book on Gradle that somehow systemizes the build and script features in my head? Something like "a list of all the convention we use over configuration". Not Android specific if possible.
    🙂 1
    s
    • 2
    • 3
  • s

    s1m0nw1

    03/05/2018, 9:47 PM
    Does anyone have an example build.gradle.kts using the bintray plugin? https://github.com/bintray/gradle-bintray-plugin
    m
    h
    • 3
    • 4
  • p

    patrickdelconte

    03/06/2018, 12:18 PM
    does anyone know how to access variables defined in ~/.gradle/gradle.properties in my init.gradle.kts file? The usual "val variable by project" does not work
    • 1
    • 1
  • f

    Florian Wiesner

    03/08/2018, 4:42 PM
    Hi guys. I yesterday have asked a question on #general regarding TestKit as it fails for me when I try testing my custom extension (https://kotlinlang.slack.com/archives/C0922A726/p1520441466000341). I have not made any progress on this today and wonder whether somebody in this channel might know how to fix the problem that my test-
    build.gradle.kts
    fails with
    GradleRunner
    as the decoraded class lacks the extension properties
    m
    • 2
    • 7
  • v

    vinayagasundar

    03/11/2018, 6:42 PM
    Hi All I'm trying to create MultiPlatform project with Gradle(Kotlin-DSL) when i try to set
    kotlin-platform-common
    plugiin I'm getting following error any idea what's wrong here
    m
    i
    • 3
    • 7
  • c

    carolos

    03/12/2018, 4:46 PM
    yeah if I remove it everything works - managed to fix @gildor when I generate a new Gradle Kotlin DSL project using intelliJ with Kotlin 1.2.30 plugin for some reason it uses Gradle 4.0 I changed my gradle-wrapper.properties to use Gradle 4.6 and added the java plugin and it compiles now
    g
    • 2
    • 2
  • g

    gildor

    03/13/2018, 4:27 PM
    -PpropertyName=value
    👍 1
    t
    f
    • 3
    • 7
  • g

    guenther

    03/16/2018, 11:39 AM
    Does anybody has experience with external build scripts and KotlinDSL: What I have (and what works in groovy)
    build.gradle.kts
    
    plugins {
        id("org.sonarqube") version "2.6.2" apply false
    }
    apply {
        from("sonarqube.gradle.kts")
    }
    
    
    --------
    sonarqube.gradle.kts
    
    
    apply{
        plugin("org.sonarqube")
    }
    
    configure<org.sonarqube.gradle.SonarQubeExtension> {
        properties {
            property("sonar.projectName", "${rootProject.name}-${project.name}")
        }
    }
    m
    • 2
    • 2
  • b

    bjartek

    03/17/2018, 5:49 PM
    in gradle script kotln what is the same as setting ext.someThing= [ foo : true]
    c
    • 2
    • 3
  • b

    bjartek

    03/18/2018, 7:58 PM
    I am trying to do this https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/gradle-plugin/reference/html/#managing-dependencies-using-in-isolation in my build.gradle.kts file but i get a compile error saying that dependencyManagement does not exist. is this too dynamic for kotlin or is there a solution?
    c
    • 2
    • 8
  • s

    sprelacart

    03/19/2018, 11:37 AM
    Hi, I need to migrate the following Gradle snippet to Kotlin DSL. How do I do that ? Is there any doc I should read?
    jar {
    excludes = ["application*.yaml"]
    }
    Currently I found a way but it looks a bit awkward to me:
    tasks {
        "jar"(Jar::class) {
            excludes.add("application*.yaml")
        }
    }
    g
    • 2
    • 1
  • s

    sprelacart

    03/19/2018, 11:45 AM
    Cool: ' tasks.withType<Jar> { excludes.add("application*.yaml") }' worked 🙂
    g
    • 2
    • 1
  • a

    apomelov

    03/19/2018, 5:39 PM
    Hi. I've just starting receiving
    \build.gradle.kts:8:5: Expression 'kotlin' cannot be invoked as a function. The function 'invoke()' is not found
    on any gradle task, I'm running from IDEA. This is preceded by strange warning I've never seen before:
    WARN: Failed to initialize native filesystem for Windows
    java.lang.RuntimeException: Could not find installation home path. Please make sure bin/idea.properties is present in the installation directory.
    	at org.jetbrains.kotlin.com.intellij.openapi.application.PathManager.getHomePath(PathManager.java:95)
    	at org.jetbrains.kotlin.com.intellij.openapi.application.PathManager.getBinPath(PathManager.java:132)
    	at org.jetbrains.kotlin.com.intellij.util.lang.UrlClassLoader.loadPlatformLibrary(UrlClassLoader.java:311)
    	at org.jetbrains.kotlin.com.intellij.openapi.util.io.win32.IdeaWin32.<clinit>(IdeaWin32.java:48)
    Any idea? upd: from cmd line everything is ok, but I have --no-daemon global setting, that does not affect IDEA afaik
    d
    • 2
    • 5
  • a

    apomelov

    03/19/2018, 7:15 PM
    Hi. Sorry for probably irrelevant question, but why can't I find some of official kotlin plugins in plugins.gradle.org repository? For example javascript related (kotlin2js, kotlin-dce-js) or multiplatform ones
    b
    • 2
    • 2
Powered by Linen
Title
a

apomelov

03/19/2018, 7:15 PM
Hi. Sorry for probably irrelevant question, but why can't I find some of official kotlin plugins in plugins.gradle.org repository? For example javascript related (kotlin2js, kotlin-dce-js) or multiplatform ones
b

bashor

03/20/2018, 5:38 PM
the related issue https://youtrack.jetbrains.com/issue/KT-20156
feel free to vote or star it to get updates
View count: 4