Eugene
10/09/2020, 12:42 PMmbonnin
10/09/2020, 1:43 PMmbonnin
10/09/2020, 1:44 PMJoe
10/09/2020, 10:37 PMMarc Knaup
10/11/2020, 5:50 AMkotlin
block and not in kotlinOptions
or languageSettings
where Iāve expected it.
And thereās also the mix between Groovy Gradle files and Kotlin Gradle files. KTS is quite advanced by now yet many Kotlin projects and samples still use the Groovy syntax. Instead of that, JetBrains projects should be dogfooding Gradle KTS. That also helps people learn. Due to lack of good documentation and samples itās difficult to understand how to do a wide variety of things in KTS.mbonnin
10/11/2020, 1:27 PMEugene
10/12/2020, 7:47 AMMarc Knaup
10/12/2020, 9:39 AMprintln
because the debugger was not helpful. If there are many coroutines then the Coroutines view basically loads forever and is unusable. In some cases stepping through code takes minutes, as does loading variable values. And very often breakpoints are simply ignored, esp. when coroutines are involved. Stack traces with coroutines are not helpful either.Eugene
10/12/2020, 9:55 AMMarc Knaup
10/12/2020, 9:55 AMEugene
10/12/2020, 9:56 AMMarc Knaup
10/12/2020, 10:06 AMEugene
10/12/2020, 11:57 AMMarc Knaup
10/13/2020, 11:02 AMmbonnin
10/13/2020, 11:39 AMCLOVIS
10/17/2020, 8:00 PMZac Sweers
10/18/2020, 1:32 AMZac Sweers
10/19/2020, 5:02 PMbasher
10/22/2020, 3:17 PMh0tk3y
11/19/2020, 5:05 PMimplementation
dependency. This won't bring the module with internal APIs to the consumer's compilation classpath and will only bring it to the runtime classpath. It's more or less equivalent to introducing friend dependencies, because in both cases you shouldn't use the internal declarations in your public API.
However, I can imagine how having friend modules could be more convenient than moving the internal APIs to a separate module that is added as an implementation
dependency, and we should definitely consider this based on the use cases.Marc Knaup
11/19/2020, 5:16 PM@RequiresOptIn
to make internal API unusable by default. It can also break if multiple modules that rely on it have different versions but I kinda expect that. Friend modules would just be a way to formalize such an approach, wouldnāt it?
https://github.com/fluidsonic/fluid-graphql/blob/master/modules/language/sources/common/utility/InternalGraphqlApi.ktbasher
11/19/2020, 5:32 PMDoes your use case assume setting up friend/internal visibility between different projects in a multi-project buildI think the answer to this is yes, though Iām new to composite builds and the associated terminology. We have a project that has become quite large, which we compile into a single library and is consumed by some downstream projects (in other repositories) internally at Autodesk. Weāve been careful to use explicit API mode, so visibility is well-defined for all of our APIs. Most of our APIs are marked as internal whenever possible, so that we can reap those benefits of avoiding breaking downstream clients. Now that the project is large, weād like to breakup the project into sub-projects/modules to make better use of gradle/compiler caching and parallel compilation. Right now, because the library is all one big module, all of the library classes use other library classes internal API, and that is okay and is something weād like to continue to preserve. If we split apart the library into modules, weāll have to make more classes and methods public, so that other modules within the library will be continue to be able to talk to each other. The main issue with this is that because weāll have to now publish all of these modules in concert to continue to allow JVM clients to consume this library, thereās nothing stopping JVM clients from using internal APIs that we had to make public to make modularization possible within the library.
@RequiresOptIn
is one avenue, but KMP makes this more complicated. Itās unclear (or at least not well-documented) whether those annotated APIs would be exposed to K/N clients, if we needed to export one of those modules to make some public APIs from those modules available in an iOS framework, for example. All of that forces us into using naming conventions like util
and util-internal
where the util
module is okay to export or use as an api
dependency, where util-internal
should never be exposed publicly.
I hope this clarifies our situation. Thanks again!h0tk3y
11/19/2020, 7:59 PM@RequiresOptIn
being eligible for export in iOS frameworks, I think I'll pass this to our Kotlin/Native team.
Supporting friend dependencies is definitely a thing for us to consider, although it requires thorough design, which may take time and uncover other problems.
One more potential solution that I see is that it should be possible to customize the build so that it post-processes the output artifacts that are published for the internal API modules (or even more granular, just the internal packages) in a way that makes them inaccessible for other Kotlin consumers outside of your build, while your build could still use the original artifacts. For example, it should be possible to add @Deprecated
with level HIDDEN
to the declarations. This doesn't seem to be anything simple, though, given the multiple artifact formats that you might want to post-process ā JVM bytecode, *.js
files, and `*.klib`s. Maybe writing a Gradle plugin that does this is a good idea.basher
11/19/2020, 8:11 PMItās a curious point about declarations marked withĀMaybe itās already handled? Iām not sure, but I would expect that itās not. But sure, I look forward to hearing what K/N folks have to say š In any case, a solution that requires an annotation to hide APIs from the public brings with it a lot of overhead: 1. Actual overhead of properly annotating all of your APIs 2. Mental overhead of āis this public? oh no, itās annotated withĀ being eligible for export in iOS frameworks, I think Iāll pass this to our Kotlin/Native team.@RequiresOptIn
@X
At that point, how far are you really from adding package private to Kotlin? Iām not suggesting that package private is the solution, but the level of condoned hackery begs the question I think šbasher
11/19/2020, 8:13 PM@RequiresOptIn
were honored by the K/N backend when exporting a module, that might be sufficient.h0tk3y
11/20/2020, 9:14 AM@RequiresOptIn
APIs are exported in frameworks as normal public API. They haven't considered limiting this as of yet.basher
11/20/2020, 4:30 PMh0tk3y
12/02/2020, 12:05 PMbasher
12/02/2020, 6:15 PMh0tk3y
12/02/2020, 6:15 PM