https://kotlinlang.org logo
Title
c

colljos

09/11/2018, 9:03 AM
How does one use the
internal
keyword inside the same module for say
integrationTests
(eg. as per the above definition it can be used across
main
and
unit
in the same module)?
i

ilya.gorbunov

09/11/2018, 3:03 PM
Currently
internal
declarations from main source set are only visible inside test source set of the same project.
c

colljos

09/11/2018, 4:21 PM
OK - so that sounds like a hard restriction. Any reason why this cannot be extended to any other source set (extending test) ?
i

ilya.gorbunov

09/11/2018, 6:08 PM
There was a discussion about that recently and it seems that the visibility of internal could be extended to all source sets of a project.
j

jlleitschuh

09/12/2018, 2:15 AM
This has to do with a generally user hidden concept called “friend” sources. Currently, only the
compileTest
classes are made friends of your
compileMain
code. There’s really no documentation on how to set friend sources yourself. The feature is very well hidden and not well documented.