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

    jlleitschuh

    07/25/2017, 3:06 PM
    @bamboo is it a kotlin feature that allows the kotlin DSL to convert
    Action<T>
    to
    T.()
    ? If so what feature? Or is it just because of the magic of being able to preprocess the build file?
    o
    • 2
    • 1
  • e

    eskatos

    07/26/2017, 5:46 PM
    @Ian, could be because of https://youtrack.jetbrains.com/issue/KT-17197 depending on which version of the Kotlin Gradle plugin you use, or something else ... is it reproductible? does it vanishes after running
    ./gradlew clean
    ?
    i
    • 2
    • 4
  • s

    sdeleuze

    07/27/2017, 10:48 AM
    I found https://github.com/sureshg/kotlin-starter/blob/master/build.gradle.kts#L151-L177 but can't manage to get
    mvnpom
    accessible cc @suresh
    s
    • 2
    • 1
  • j

    jlleitschuh

    08/03/2017, 5:10 PM
    @bamboo Have you ever seen this error before? https://ci.appveyor.com/project/AustinShalit/shuffleboard/build/1.0.3
    b
    • 2
    • 1
  • x

    x80486

    08/04/2017, 8:16 PM
    Hello folks! Has anyone been able to configure the
    ShadowJar
    plug-in using Kotlin DSL? I'm using Vert.x with Kotlin and so far the
    mergeServiceFiles
    doesn't work; also I get some "unresolved reference" for
    manifest.attributes
    (you know, the red bulb on the right). This is what I got so far...
    plugins {
      ...
      id("com.github.johnrengelman.shadow") version "2.0.1"
    }
    
    tasks.withType<ShadowJar> {
      baseName = project.name
      classifier = "shadow" // fat, shadow
      manifest.attributes.apply {
        put("Application-Name", project.name)
        put("Gradle-Version", gradle.gradleVersion)
        put("Implementation-Version", "${project.version}")
        //put("Main-Class", "io.shido.MainVerticle")
        put("Main-Verticle", "io.shido.MainVerticle")
      }
      mergeServiceFiles({ include("META-INF/services/io.vertx.core.spi.VerticleFactory") })
      version = "${project.version}"
    }
    j
    • 2
    • 2
  • f

    fitzoh

    08/04/2017, 10:27 PM
    using gradle 4.1-rc-2 with the
    kotlin-dsl
    plugin, anything I’m missing here?
    j
    b
    • 3
    • 42
  • j

    jlleitschuh

    08/07/2017, 8:41 PM
    @bamboo I'm getting tons of errors trying to upgrade a project to Gradle
    4.1
    from
    4.0.2
    . Mostly related to dependency configurations missing like
    testCompile
    .
    a
    b
    m
    • 4
    • 27
  • d

    drako

    08/08/2017, 2:37 PM
    hi guys, I can't get the gradle-plugin working with my build.gradle.kts (gradle file in kotlin)
    j
    • 2
    • 1
  • j

    jlleitschuh

    08/08/2017, 11:14 PM
    @bamboo Is GSK known to work/not to work with the JDK 9 compiler?
    b
    • 2
    • 7
  • j

    jlleitschuh

    08/10/2017, 6:19 PM
    That still doesn't work, the kotlin compiler can't figure out the type signatures.
    b
    • 2
    • 21
  • r

    redrield

    08/10/2017, 8:43 PM
    Is there still no nice way to get IntelliJ to play nice with Gradlescript kotlin? I can get a sample to work but the IDE is still showing a ton of errors
    j
    n
    • 3
    • 12
  • m

    mbstavola

    08/11/2017, 6:24 PM
    Are there any examples using Kotlin JS with GSK?
    b
    • 2
    • 1
  • b

    bamboo

    08/11/2017, 6:49 PM
    @mkobit
    kotlin-dsl
    relies on the Kotlin
    SamWithReceiver
    infrastructure which is currently not completely supported by the IntelliJ plugin => https://youtrack.jetbrains.com/issue/KT-18062
    m
    • 2
    • 1
  • n

    napperley

    08/14/2017, 12:46 AM
    Is the Gradle Input Stream problem going to be fixed (https://discuss.gradle.org/t/how-can-i-execute-a-java-application-that-asks-for-user-input/3264)? Been driven up the wall by this issue. What is the fix when building a JAR?
    g
    • 2
    • 4
  • x

    x80486

    08/14/2017, 12:01 PM
    Has anyone used Kotlin DSL with Google's Protobuf? I'm unable to "translate" the
    protobuf
    plug-in from Gradle. This is what I got so far:
    configure<ProtobufConfigurator> { //protobuf
      generatedFilesBaseDir = "$projectDir/build/generated"
    
      //generateProtoTasks {
      //  all() * . plugins {
      //    grpc { option "enable_deprecated = false" }
      //  }
      //}
      generateProtoTasks({ ??? })
    
      //plugins {
      //  grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpc_version}" }
      //}
    
      //  protoc {
      //    artifact = "com.google.protobuf:protoc:3.3.0"
      //  }
    }
    g
    • 2
    • 14
  • b

    bamboo

    08/15/2017, 8:47 PM
    maven { url = uri("https://...") }
    o
    g
    +2
    • 5
    • 16
  • m

    mbstavola

    08/21/2017, 11:05 PM
    With that I get:
    classes
      kotlin
        main
        test
      main
      test
    But I'd rather have the kotlin output alongside the Java
    • 1
    • 1
  • c

    Czar

    08/22/2017, 8:01 AM
    This is not strictly Kdsl related, but in #general this wasn't answered, so maybe someone here can help? Sorry for double posting, but I did wait a while 🙂 After update to kotlin 1.1.4, my gradle build (groovy based) fails with following
    Task with path 'copyMainKotlinClasses' not found in project
    . In
    build.gradle
    I have:
    // groovy code should have access to kotlin classes for things like blablabla to work
    tasks.compileGroovy.dependsOn 'copyMainKotlinClasses'
    // and also for tests
    tasks.compileTestGroovy.dependsOn 'copyTestKotlinClasses'
    Gradle version: 4.0.1
    t
    • 2
    • 9
  • m

    mkobit

    08/23/2017, 2:34 PM
    @ggr the accessors seem to be generated only to plugins projects for which the plugins are applied to in that kotlin-dsl version (they used to be generated statically and differently) so, since you aren’t applying the plugin to that rootproject, they arent available
    g
    g
    • 3
    • 2
  • b

    bamboo

    08/23/2017, 7:09 PM
    @mkobit that might be caused by the
    kotlin-stdlib
    shipped with Gradle being incompatible with more recent versions (assuming you’re running Gradle 4.1 which ships 1.1.3-2)
    g
    • 2
    • 1
  • f

    fitzoh

    08/23/2017, 11:49 PM
    val buildDockerImage by creating(Exec::class) {
                        commandLine("docker", "build", "-t", ${someExtension.somePropertyState},, dockerDirectory)
                        doLast{println("executed $commandLine")}
                    }
    I’m trying to figure out how to lazily set an argument in this exec task from a propertystate, but it’s evaluating too early. Am I missing something?
    j
    g
    • 3
    • 5
  • b

    bamboo

    08/24/2017, 3:41 PM
    @salomonbrys that’s not supported
    s
    • 2
    • 6
  • f

    fitzoh

    08/24/2017, 6:05 PM
    @bamboo any thoughts on the issues I mentioned last night? What I’m basically looking to do is add an exec task to a plugin which is based on the value of an extension, but the command line args are being resolved before the extension value is set
    b
    m
    • 3
    • 6
  • m

    mkobit

    08/29/2017, 1:45 PM
    @dragas does it sound similar to https://kotlinlang.slack.com/archives/C19FD9681/p1503514199000045 ?
    d
    o
    +2
    • 5
    • 9
  • l

    lewis

    08/31/2017, 10:19 AM
    java/java-library don't seem to add the config
    g
    • 2
    • 1
  • l

    lewis

    08/31/2017, 10:21 AM
    Wrapping them in quotes works, but why?
    g
    • 2
    • 1
  • i

    itbeha

    08/31/2017, 7:09 PM
    has the kotlin as gradle build script language (as opposed to just building kotlin projects using gradle) project gone to sleep? https://github.com/gradle/kotlin-dsl doesn't seem to have had technical commits in 2 months; since then it seems to have been just boilerplate stuff for gradle project config standards
    j
    b
    • 3
    • 2
  • j

    jlleitschuh

    09/01/2017, 3:54 PM
    @bamboo Do you have any suggestions for how to work with the JDK 9 issue? I can't get the build to work with JDK 9 so I can't really make meaningful changes/development. Its a catch 22.
    b
    • 2
    • 57
  • j

    jlleitschuh

    09/01/2017, 7:15 PM
    Hey, tabs are more efficient in memory and in disk space. It's only one character vs four. You're actually reducing size of your files by using tabs. I actually prefer spaces, but that is truly an argument that I've heard before.
    d
    • 2
    • 1
  • l

    lewis

    09/04/2017, 9:04 AM
    plugins {
        kotlin("jvm")
    //    kotlin("allopen")
    }
    
    buildscript {
        repositories {
    //        gradleScriptKotlin()
            google()
            mavenLocal()
            jcenter()
            mavenCentral()
            maven { setUrl("<https://plugins.gradle.org/m2>") }
            maven { setUrl("<https://repo.spring.io/snapshot>") }
            maven { setUrl("<https://repo.spring.io/milestone>") }
        }
        dependencies {
            classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M2")
    //        classpath(kotlin("gradle-plugin", "1.2-M2"))
    //        classpath(kotlin("allopen", "1.2-M2"))
        }
    }
    
    apply {
    //    plugin("org.jetbrains.kotlin.plugin.allopen")
        plugin("idea")
        plugin("org.springframework.boot")
        plugin("io.spring.dependency-management")
    }
    g
    • 2
    • 1
Powered by Linen
Title
l

lewis

09/04/2017, 9:04 AM
plugins {
    kotlin("jvm")
//    kotlin("allopen")
}

buildscript {
    repositories {
//        gradleScriptKotlin()
        google()
        mavenLocal()
        jcenter()
        mavenCentral()
        maven { setUrl("<https://plugins.gradle.org/m2>") }
        maven { setUrl("<https://repo.spring.io/snapshot>") }
        maven { setUrl("<https://repo.spring.io/milestone>") }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M2")
//        classpath(kotlin("gradle-plugin", "1.2-M2"))
//        classpath(kotlin("allopen", "1.2-M2"))
    }
}

apply {
//    plugin("org.jetbrains.kotlin.plugin.allopen")
    plugin("idea")
    plugin("org.springframework.boot")
    plugin("io.spring.dependency-management")
}
g

gildor

09/04/2017, 1:06 PM
You shouldn’t use this line, you already applied your plugin in plugins block, remove this lne and keep only one from plugins // plugin(“org.jetbrains.kotlin.plugin.allopen”)
View count: 1