What is the best way to start with a development of KMP library from scratch? Yes, I would probably take a look at any existing high rank KMP lib, but I was wondering that KMP library template is 6 months old. KMP App already uses Kotlin 2.0, but doesn't have a library as a separated library gradle module...
p
Pablichjenkov
06/14/2024, 8:35 PM
6 months is not too bad although agree it should be updated with the latest language and tooling version.
I would say start with something simple. TBH a library is just another gradle module with a publishing plugin applied to it.
In fact the KMP App template you mentioned, the module
shared
is basically a library.
👌 1
m
Michal Harakal
06/14/2024, 9:48 PM
Thank you for the hint on the
shared
module. I've learned, that the current KMP App template doesn't contain
shared
, if you generate mobile apps only. If I add "server", `shared`will also became a part of the project ...
p
Pablichjenkov
06/14/2024, 10:09 PM
That's right
Pablichjenkov
06/14/2024, 10:11 PM
But in fact they are all just gradle modules. There are some unofficial naming conventions to ease things up, like
share
,
iosApp
and
composeApp
. But the name doesn't mean much. What really make a module an application or a library is the Gradle Plugins you apply on the project.
Pablichjenkov
06/14/2024, 10:13 PM
You can see all them as modules that depend on other modules.