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

    Sasha Zimm

    11/25/2017, 2:03 PM
    Hi, I am trying to get off the ground with a Dropwizard skeleton building and running with Gradle via the Kotlin DSL. I want to run up the application using a common approach such as: https://stackoverflow.com/questions/28610015/run-main-method-using-gradle-run-task My run block in Intellij is giving me hassle as it does not want to recognise the args as in the link above. It also seems to think the run {} is some funky Kotlin function. Any ideas please?
    n
    m
    g
    • 4
    • 7
  • j

    jkbbwr

    11/26/2017, 2:49 AM
    Current issue
    Caused by: org.gradle.cache.CacheOpenException: Could not open cache directory aat8l8gx46xy6a1lqc8xd1ny9 (/home/jakob/.gradle/caches/4.3.1/gradle-kotlin-dsl/aat8l8gx46xy6a1lqc8xd1ny9).
    	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:61)
    	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:32)
    	at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:90)
    	at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:64)
    	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.open(DefaultCacheRepository.java:123)
    	at org.gradle.kotlin.dsl.cache.ScriptCache.cacheDirFor(ScriptCache.kt:51)
    	at org.gradle.kotlin.dsl.cache.ScriptCache.cacheDirFor$default(ScriptCache.kt:43)
    	at org.gradle.kotlin.dsl.provider.CachingKotlinCompiler.cacheDirFor(CachingKotlinCompiler.kt:170)
    	at org.gradle.kotlin.dsl.provider.CachingKotlinCompiler.compileScript(CachingKotlinCompiler.kt:131)
    	at org.gradle.kotlin.dsl.provider.CachingKotlinCompiler.compileBuildScript(CachingKotlinCompiler.kt:111)
    	at org.gradle.kotlin.dsl.provider.KotlinBuildScriptCompiler.compileScriptFile(KotlinBuildScriptCompiler.kt:239)
    	at org.gradle.kotlin.dsl.provider.KotlinBuildScriptCompiler.executeScriptBodyOn(KotlinBuildScriptCompiler.kt:111)
    	at org.gradle.kotlin.dsl.provider.KotlinBuildScriptCompiler.prepareAndExecuteScriptBodyOn(KotlinBuildScriptCompiler.kt:105)
    	at org.gradle.kotlin.dsl.provider.KotlinBuildScriptCompiler.access$prepareAndExecuteScriptBodyOn(KotlinBuildScriptCompiler.kt:48)
    	at org.gradle.kotlin.dsl.provider.KotlinBuildScriptCompiler$compileTopLevelScript$1.invoke(KotlinBuildScriptCompiler.kt:88)
    	at org.gradle.kotlin.dsl.provider.KotlinBuildScriptCompiler$compileTopLevelScript$1.invoke(KotlinBuildScriptCompiler.kt:48)
    	at org.gradle.kotlin.dsl.provider.KotlinScriptPlugin.apply(KotlinScriptPlugin.kt:48)
    	at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
    	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
    	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:41)
    	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    	at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    	at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:64)
    	... 84 more
    c
    • 2
    • 21
  • j

    jkbbwr

    11/26/2017, 3:19 AM
    Another differnet issue
    e: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
    When using java9
    c
    • 2
    • 2
  • j

    jkbbwr

    11/26/2017, 1:16 PM
    All the documentation is out of date for everything, I have spent about 2 days trying to get everything to just work and its not, its super frustrating
    c
    • 2
    • 5
  • v

    voddan

    11/26/2017, 2:39 PM
    Hi, guys! When (approximately) are you planing on releasing kotlin DSL 1.0 ? I understand that usually it is a bad question to ask, but I need a very rough approximation of how close you think you are to the 1.0 point. 3 months? A year? Thanks in advance !
    n
    b
    • 3
    • 6
  • g

    g4sarma

    11/27/2017, 9:31 PM
    buildscript { ext.kotlin_version = '1.1.60' ext.tornadofx_version = '1.7.8' repositories { mavenCentral() jcenter() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.github.jengelman.gradle.plugins😒hadow:1.2.3' classpath 'no.tornado:fxlauncher-gradle-plugin:1.0.16' } } apply plugin: 'kotlin' apply plugin: 'application' apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'no.tornado.fxlauncher' repositories { mavenLocal() mavenCentral() } dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile "no.tornado:tornadofx:$tornadofx_version" compile 'org.controlsfx:controlsfx:8.40.12' compile "org.apache.commons:commons-dbcp2:2.1.1" compile 'com.google.guava:guava:23.5-jre' }
    d
    • 2
    • 1
  • g

    g4sarma

    11/27/2017, 9:33 PM
    Okay sorry i was not aware
    m
    • 2
    • 2
  • n

    nikolaymetchev

    11/28/2017, 2:17 PM
    I am not exactly sure how
    HasImplicitReceiver
    annotation works on the
    Action
    interface but it seems to workin build.gradle.kts and doesn't seem to work in *.kt files in buildSrc. I have to explicitly cast to the receiver:
    private fun KotlinBuildScript.setupIvyRepository() {
      plugins.apply("org.gradle.ivy-publish")
      val conf: org.gradle.api.publish.PublishingExtension.() -> Unit = {
        repositories {
          this as RepositoryHandler
          ivy {
            this as IvyArtifactRepository
            url = URI("file:////C:/Temp/ivy.local")
            layout("pattern") {
              this as IvyPatternRepositoryLayout
              ivy("[module]/[revision]/ivy.xml")
              artifact("[module]/[revision]/[artifact]-[type].[ext]")
            }
          }
        }
      }
      extensions.configure("publishing", conf)
    }
    b
    • 2
    • 2
  • r

    rocketraman

    11/28/2017, 10:32 PM
    After updating my project to 1.2.0, I still have transitive deps pulling in 1.1.x. Do I need to force the correct kotlin version with a
    resolutionStrategy
    or is there a more elegant approach?
    m
    • 2
    • 5
  • n

    nikolaymetchev

    11/29/2017, 2:52 PM
    switching from the gradle plugin version 1.1.51 to 1.2.0 i get the following error
    Could not find Kotlin Compiler classpath. Please specify compileKotlin.compilerClasspath
    . Anybody know what is going on?
    j
    • 2
    • 1
  • m

    Marcel Overdijk

    11/30/2017, 8:14 AM
    is there a way to force all kotlin deps to
    1.2.0
    easily?
    g
    • 2
    • 2
  • b

    bamboo

    11/30/2017, 5:56 PM
    We haven’t updated the master branch yet because Gradle 4.4 GA hasn’t been released
    k
    c
    • 3
    • 6
  • f

    flstaats

    11/30/2017, 9:15 PM
    Are init scripts also supported with .kts extensions or does that have wait. I remember seeing the open ticket for settings.gradle.kts support but I don't specifically remember there being a ticket to support -I init.gradle.kts files.
    e
    • 2
    • 1
  • d

    dylan

    12/01/2017, 11:28 AM
    I created a gradle plugin in kotlin but I cant seem to get it working. When the I compile the plugin to a jar and use it in another project to test it I get
    Build cache type 'com.drost.buildcache.minio.MinioPlugin' has not been registered.
    I have the gradle-plugins file in meta inf with
    implementation-class=com.drost.buildcache.minio.MinioPlugin
    which I set with the
    java-gradle-plugin
    b
    • 2
    • 19
  • d

    dharrigan

    12/05/2017, 1:22 PM
    Hey, with gradle kotlin scripts, one of the things that I find a bit toooo noisy compared to plain groovy gradle scripts, is the necessity to put in
    ${property("foo")}
    inside dependencies definitions, i.e.,
    compile("com.google.protobuf:protobuf-java:${property("protobufVersion")}")
    I know there is another way of defining the var inside the kts file,
    var foo="1.2"
    then using
    $foo
    inside the dependency definition. The latter being more "groovy" like (without the var definition). Is there no shorter way of expressing this?
    c
    • 2
    • 2
  • n

    napperley

    12/06/2017, 10:15 PM
    What is the replacement for tasks.getting in Gradle 4.4?
    • 1
    • 1
  • m

    mkobit

    12/06/2017, 10:48 PM
    the
    tasks.getting
    is working for me for all
    val dokka by tasks.getting
    and
    tasks { val dokka by getting(DokkaTask::class) }
    , and
    val dokka by tasks.getting(DokkaTask::class)
    n
    e
    • 3
    • 18
  • n

    napperley

    12/07/2017, 12:45 AM
    Receiving this error after updating Gradle to 4.4: e: Kotlin home does not exist or is not a directory: :compileKotlin2Js FAILED
    • 1
    • 1
  • c

    Czar

    12/07/2017, 11:44 AM
    project(":child:grandchild") {
    	plugins {
    		id("war")
    		id("org.springframework.boot")
    	}
    	dependencies {
    		providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
    		//...
    	}
    	//...
    }
    gives me unresolved reference:
    providedRuntime
    Any ideas?
    💁 1
    e
    • 2
    • 10
  • l

    leodeng

    12/07/2017, 12:31 PM
    providedRuntime
    probably should be within a
    dependencies
    block.
    c
    • 2
    • 1
  • e

    eskatos

    12/07/2017, 3:16 PM
    Yes please add it, I’ll triage it right away
    c
    • 2
    • 2
  • g

    gildor

    12/08/2017, 6:26 AM
    or even:
    tasks {
        "bower" {
            dependsOn("gulp_bower")
        }
    }
    👍 1
    c
    • 2
    • 26
  • m

    masc3d

    12/08/2017, 1:45 PM
    I’m using
    kotlin.copyClassesToJavaOutput = true
    and it works well in our setup, but it causes tests to run twice when using the gradle test runner
    h
    • 2
    • 5
  • s

    sdeleuze

    12/09/2017, 12:11 AM
    This change https://github.com/JetBrains/kotlin/commit/5ce514bd42a8e8cb2afac99ea20bc359a4222951 introduces a regression that prevent us to generate the Dokka documentation for Kotlin code without using Java code since we were using
    sourceDirs = files(subprojects.collect { project -> project.sourceSets.main.kotlin.srcDirs })
    . What can I use to get only the Kotlin source dirs ?
    h
    • 2
    • 1
  • m

    mkobit

    12/11/2017, 8:35 PM
    i dont think that is what is causing it - there is a
    build.gradle.kts
    in the directory that can't be compiled.
    ➕ 1
    g
    • 2
    • 1
  • k

    kartikpatodi

    12/12/2017, 6:13 PM
    can you please elaborate @bamboo
    b
    m
    • 3
    • 13
  • d

    dagguh

    12/12/2017, 7:41 PM
    is there a way to suppress
    Using Kotlin incremental compilation
    info?
    d
    g
    • 3
    • 3
  • s

    StefMa

    12/13/2017, 7:34 AM
    Hey guys, I don’t get kotlin-dsl running. 😕 For testing I’ve created a simple hello tasks like that:
    task("Hello") {
      println("Hello World")
    }
    This works. Now I wanted to map this to my android project. I’ve updated the script to:
    buildscript {
      repositories {
        jcenter()
        google()
      }
    
      dependencies {
        classpath("com.android.tools.build:gradle:3.0.1")
      }
    }
    
    apply {
      plugin("com.android.application")
    }
    
    android {
      compileSdkVersion("26")
    }
    But if I run it I get:
    build.gradle.kts:18:1: Unresolved reference: android
    build.gradle.kts:19:3: Unresolved reference: compileSdkVersion
    What I’m doing wrong? I’ve already checked out the samples. With the hello-android I don’t have that issue 😕
    c
    e
    • 3
    • 6
  • c

    Czar

    12/13/2017, 10:31 AM
    compile(kotlin("stdlib", "1.2.0"))
    won't help, you'll have to specify it for all stdlib variants if you want to do it like that.
    gradle.properties
    is easier, IMO.
    g
    • 2
    • 1
  • c

    Czar

    12/13/2017, 10:48 AM
    yup, true, you do not have to specify
    kotlinVersion
    for dependencies in this case, I do though, because project I copied this from is a lib, and if I don't the version is not properly resolved on the project which is depending on my lib.
    g
    • 2
    • 3
Powered by Linen
Title
c

Czar

12/13/2017, 10:48 AM
yup, true, you do not have to specify
kotlinVersion
for dependencies in this case, I do though, because project I copied this from is a lib, and if I don't the version is not properly resolved on the project which is depending on my lib.
g

gildor

12/13/2017, 10:51 AM
Had the same problem. Actually, I think it’s a bug, probably we should create an issue for Kotlin Gradle Plugin to support such case, not sure that it’s possible to fix without maven publish plugin modification
c

Czar

12/13/2017, 10:57 AM
Yeah, I lazied out on the investigation, just found what was breaking my build, patched it up by specifying version and moved on. I'm not sure if it's a bug, under-designed feature or a misunderstanding 🙂
g

gildor

12/13/2017, 11:04 AM
Same for me, not sure about bug and how hard to fix it, so just use particular version for stdlib in my lib to generate correct pom
View count: 3