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
build-tools
  • z

    Zac Sweers

    01/24/2018, 10:41 AM
    the 1.2.2x releases seem pretty broken. Lot of colleagues reporting just weird issues popping up - Kotlin plugin in gradle fails to apply - breakpoints won’t hit in tests -
    Cannot access 'XXX': it is internal in 'YYY'
    happening in random places (cleared by a gradle clean or killing daemons) all on android studio, but haven’t tested intelliJ
    a
    • 2
    • 1
  • z

    Zac Sweers

    01/24/2018, 10:47 AM
    A problem occurred evaluating project ':tooling:kdata-moshi:integration'.
    > Could not find implementation class 'org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper' for plugin 'org.jetbrains.kotlin.jvm' specified in jar:file:/Users/pandanomic/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-gradle-plugin/1.2.21/e53ec8cdacbc461d750d0add731e803e5d4cf71c/kotlin-gradle-plugin-1.2.21.jar!/META-INF/gradle-plugins/org.jetbrains.kotlin.jvm.properties.
    a
    • 2
    • 1
  • a

    albertgao

    02/19/2018, 10:21 PM
    That’s fair. But the message from IDE is confusing: Test events were not received. I know this may because gradle won’t trigger the test event when nothing changes. But still, a little bit confuse 😄
    g
    • 2
    • 1
  • t

    thalescm

    02/21/2018, 10:02 PM
    @yan do you have any clue ☝️ ?
    y
    • 2
    • 2
  • b

    beholder

    04/20/2018, 11:49 AM
    How to enable new compiler option
    -Xenable-jvm-default
    in Maven and Gradle?
    g
    • 2
    • 1
  • d

    diesieben07

    06/11/2018, 12:08 PM
    I am generating some Kotlin code using KotlinPoet. How would I best mark the target directory as a code-source using Gradle? The following works, but marks the directory as a regular source root in IntelliJ, instead of "Generated Sources Root"
    sourceSets {
        main.kotlin.srcDirs += 'generated/kotlin'
    }
    u
    a
    v
    • 4
    • 13
  • c

    Casey Kulm

    07/14/2018, 8:06 PM
    I do not want to have to explicilty disable a company made lint rule in my personal project, but I’m not sure how. I cannot see where this company specific lint rule is living. Seems like it’s living within Android Studio iteself
    t
    • 2
    • 3
  • m

    michaeldang

    07/26/2018, 11:01 PM
    Hi all! Does anyone know if it’s possible for the
    -Werror
    flag to ignore generated files? I assume not, but just wanted to ask
    a
    • 2
    • 3
  • m

    mglukhikh

    09/14/2018, 10:19 AM
    We are glad to announce beta version 0.2.0 of Gradle inspection plugin! Gradle inspection plugin is a tool which is able to run Kotlin inspections, code reformatting and cleanup as Gradle tasks, using configurable versions of IDEA CE and Kotlin plugin. The tool can be helpful as a part of continuous integration and/or code review tools and/or code analysis tools. It's still "project under development", but we will greatly appreciate any feedback about the tool. Basic usage information can be found in README here: https://github.com/JetBrains/inspection-plugin.
    🔥 2
    👍 6
    🤘 1
    d
    e
    a
    • 4
    • 16
  • k

    kirillrakhman

    10/08/2018, 7:50 AM
    hey, @Alexander Podkhalyuzin [JB], at KotlinConf we've talked about the possibility of having code hot reload in Gradle builds. You've asked me to remind you 😉
    👍 1
    🤔 5
    a
    • 2
    • 3
  • k

    Kenneth

    10/16/2018, 8:20 AM
    Is there any good reason to use Gradle when you are used to Maven?
    a
    g
    • 3
    • 9
  • x

    xyma

    10/23/2018, 2:11 AM
    Hi,is there any code formatter & lint tool that can integrate with maven, I tried
    ktlin
    , but it’s rules is different from the official one
    g
    • 2
    • 3
  • r

    Ravi Hasija

    10/24/2018, 4:59 AM
    Hello, Is their any way in maven to have kotlin + java as main source and groovy as test source?
    a
    • 2
    • 1
  • t

    theiw

    10/24/2018, 8:10 PM
    this is probably a better channel for this
    a
    • 2
    • 5
  • j

    Joe

    10/28/2018, 2:38 PM
    I'm build a kotlin library and when I run build with
    ./gradlew build
    , it creates the jar file, but not when I use
    Build Project
    or
    Build Module
    in Intellij. How do I get those commands to have the same output?
    v
    g
    • 3
    • 5
  • m

    mantono

    11/01/2018, 1:08 PM
    Does anyone know of any good procedure or build tool to help you with semantic versioning when you are creating libraries? For example, I would need something that make sure I do not accidentally change a function or class that is exposed in the API of my library in a breaking way. So I would get an warning or error at build time if the signature of a function has changed.
    a
    • 2
    • 5
  • l

    Lommelun

    11/04/2018, 11:59 PM
    Hi, I'm wondering if there are any best-practises or points to think about when deciding how much or when to modularize a project into multiple build files (maven modules, gradle subprojects). Does anyone have any good advice for when, and how to decide what to break up into different build modules?
    a
    a
    +2
    • 5
    • 10
  • l

    Lonwabo

    11/14/2018, 9:10 AM
    Hello, Has anyone been able to configure requery using kotlin dsl in build.gradle.kts?
    a
    • 2
    • 2
  • l

    lukaswelte

    11/20/2018, 8:17 AM
    In maven and gradle you can set
    <kotlin.code.style>official</kotlin.code.style>
    for a code style (which is super nice). Is there tooling which can lint the code to follow the code style? Would be great to have it directly in maven, but a additional tool would also be fine
    t
    • 2
    • 4
  • d

    Damiano Giusti

    02/27/2019, 8:35 PM
    Hi everyone, I have issues creating a library fat jar for my kotlin project. I’m using the built-in jar plugin and adding the compiled dependencies. This is the task:
    task fatJar(type: Jar) {
        from {
            // Add runtime dependencies to jar.
            configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
        }
        with jar
    }
    Is there something wrong? When I include the jar into another project I can only see my classes from the Java code, not the Kotlin one.
    a
    a
    • 3
    • 8
  • a

    adams2

    03/12/2019, 11:16 PM
    I'm actually just trying to run --help on it to see if there's a --verbose option
    • 1
    • 2
  • a

    adams2

    03/13/2019, 11:53 PM
    do I want to use the KotlinCompileDaemon or should I set
    -Dkotlin.compiler.execution.strategy=“in-process”
    g
    • 2
    • 2
  • s

    Smallville7123

    04/12/2019, 2:49 AM
    what build tools are there for targeting kotlin-native and kotlin-jvm
    g
    • 2
    • 1
  • h

    Hawk

    04/17/2019, 9:50 PM
    Hey, I have a weird one. I have a project that is currently building fine on a colleagues windows pc, it also builds fine on our TeamCity agent. However, on my pc Windows 1809, I get the following exception (will post below). I've tried
    mvn package
    on wsl (ubuntu 1804) using the default jdk (10) as well as openjdk11 both give the same error. Same error when I try and run from intellij (right click green arrow -> run ). Any ideas 😕
    h
    • 2
    • 1
  • r

    ralf

    04/22/2019, 7:48 PM
    I realized that #gradle might not be the right channel for this question, because it’s about the Kotlin DSL. Is there a way to do this?
    s
    j
    +3
    • 6
    • 18
  • m

    Marc Knaup

    05/09/2019, 2:11 PM
    Hey guys, does anybody know why I get the following error when I remove either the
    exclude
    or the
    attributes
    block from my dependencies? https://github.com/fluidsonic/fluid-json/blob/master/annotation-processor/build.gradle.kts#L18 `./gradlew :fluid-json-examples:kaptKotlin`:
    -.txt
    h
    k
    p
    • 4
    • 11
  • a

    adams2

    06/11/2019, 4:00 PM
    so my compiler crashes intermittently
    -.txt
    • 1
    • 2
  • m

    Maksim Vlasov

    07/31/2019, 11:06 AM
    Hi! I have a question about kotlin-maven-plugin. Do I have to provide configuration parameters explicitly like in example below:
    <plugin>
    	<groupId>org.jetbrains.kotlin</groupId>
    	<artifactId>kotlin-maven-plugin</artifactId>
    	<version>${kotlin.version}</version>
    	<executions>
    		<execution>
    			<id>compile</id>
    			<phase>compile</phase>
    			<goals>
    				<goal>compile</goal>
    			</goals>
    		</execution>
    		<execution>
    			<id>test-compile</id>
    			<phase>test-compile</phase>
    			<goals>
    				<goal>test-compile</goal>
    			</goals>
    		</execution>
    	</executions>
    	<configuration>
    		<jvmTarget>${java.version}</jvmTarget>
    		<javaParameters>true</javaParameters>
    	</configuration>
    </plugin>
    or I could simply set a property like this:
    <properties>
    	<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
    </properties>
    i
    • 2
    • 1
  • e

    Eugen Martynov

    08/21/2019, 11:26 AM
    Could it be related to memory pressure?
    t
    • 2
    • 4
  • c

    christiangruber

    08/23/2019, 5:58 PM
    I'm trying to track down a problem with the kotlin bazel rules, which seems to occur when you switch from pulling in kotlinc 1.3.40+. The compiler seems to have no problems if it's <= 1.3.31, but anything past 1.3.40+, with no infrastructure/rules changes, results in failure to see internal types and methods. Repeat, it's precisely the same rule infrastructure, so it builds
    -Xfriend-paths
    and does all of that. The only variable is swapping in a later kotlinc. I can't find anything in the change-logs to indicate a change in internal/module enforcement in that timeline. Anyone know of changes that might affect internal enforcement and the behavior of
    -Xfriend-paths
    ?
    s
    a
    • 3
    • 22
Powered by Linen
Title
c

christiangruber

08/23/2019, 5:58 PM
I'm trying to track down a problem with the kotlin bazel rules, which seems to occur when you switch from pulling in kotlinc 1.3.40+. The compiler seems to have no problems if it's <= 1.3.31, but anything past 1.3.40+, with no infrastructure/rules changes, results in failure to see internal types and methods. Repeat, it's precisely the same rule infrastructure, so it builds
-Xfriend-paths
and does all of that. The only variable is swapping in a later kotlinc. I can't find anything in the change-logs to indicate a change in internal/module enforcement in that timeline. Anyone know of changes that might affect internal enforcement and the behavior of
-Xfriend-paths
?
s

StevieB

08/23/2019, 8:16 PM
The difference between the versions that caused me a problem was with a plugin that builds module-info.java of all sorts of things and it baulked over kotlin.native.concurrent because "native" is a java reserved word, that said, I don't know what bazel is or what "-Xfriendpaths" are. But you did mention modules!
c

christiangruber

08/23/2019, 8:41 PM
Yeah - this is a different thing entirely. No kotlin native stuff involved here.
s

StevieB

08/23/2019, 9:40 PM
Ok, it was worth a try, there was no kotlin native stuff in mine either, the older kotlin stdlib doesn't contain kotlin.native and the newer ones do, I don't know why exactly, but the result is, doing moduley things just on the JVM can (or could, it's fixed now - for the jlink plugin) run into this.
a

artem_zin

08/29/2019, 8:32 PM
@christiangruber likely due to this commit
Check friend jars paths for exact match
https://github.com/JetBrains/kotlin/commit/db6a7779b841995a68a7dff25bf382acbd7ef2fb First public release with it is exactly
v1.3.40
,
1.3.31
didn’t have it
c

christiangruber

08/29/2019, 8:34 PM
@artem_zin - Aha! Thank you. That looks about right. That should help me work this out.
a

artem_zin

08/29/2019, 8:35 PM
👍 pls post an update here with your findings, I’m just curious but also we’ll hit it too one way or another 😄
c

christiangruber

08/29/2019, 8:37 PM
Oh for sure. I'll actually update my rules fork with whatever I figure out.
👍 1
Still haven't gotten to this, but it's starting to get higher priority. Also, (side note) I'll be upstreaming my kotlin rules fork to the main bazel project, at their request, so I'll probably try to finish that before I tackle this. But we do need 1.3.50+ so I will get to this in the next couple of weeks, or early Q4 if I can't.
So... found it.
If you have one -Xfriends-path entry, it works fine. If you have two it doesn't. Why you might ask? Well, I asked myself that question. By the time I was done answering it, I was step-through debugging individual calls to kotlinc.
So it turns out with more than one entry in -Xfriends-path, the values in the path weren't being split. So the whole string was being passed in, not the individual path entries.
Why is THAT you may ask? Well... I also asked this.
First, I got fooled because I went hunting for the splitting code, and found.
ArraysKt.filterNot(arguments.getFriendModules().split(File.pathSeparator), String::isEmpty)
That looks right, I thought to myself. So what's wrong?
That actually fooled me for about four hours of banging my head on my keyboard.
Until I realized that was in the K2JSCompiler class, not the java compiler.
It never occurred to me that they would treat this differently... and they do.
In the java it's:
environment.configuration.getList(JVMConfigurationKeys.FRIEND_PATHS)
- a whole different infrastructure.
So, a getList() on a property-like construct often has a comma-separated default, so I thought "fuck it, why not". Sure enough. When I separated with a comma, not a semicolon (or platform path separator), it worked.
I need to file a bug. You have to use two different separators for the two backends. Not even sure what the native one would do.
Ima have to file a bug.
a

artem_zin

10/09/2019, 8:05 PM
dang, thanks for this investigation 👍
c

christiangruber

10/29/2019, 6:54 PM
All fixed in the latest bazel rules release
View count: 20