https://kotlinlang.org logo
Title
g

gildor

02/01/2018, 5:49 AM
There is a problem that CLion doesn’t work with Gradle, so you cannot build Android application from CLion
a

albertgao

02/01/2018, 6:21 AM
I know there must be some reasons behind this. But still, a minimal setup for an Android/iOS project would be very helpful, isn’t it? 🙂
g

gildor

02/01/2018, 6:39 AM
Yes, of course. But there are 2 big problems: 1. CLion doesn’t support Gradle (and Android too) and Intellij/AS doesn’t support K/N, so there is no IDE that can manage both 2. K/N doesn’t support multiplatform projects (Gradle also blocker for that, because only Gradle now supports Kotlin Multiproject), so there is no way to share code easily you still need self-manual source management to share some sources between Android/JVM/JS Kotlin and K/N So this template will be really hacky and not easy to use (you need 2 IDE or IDE + CLI), maybe doesn’t worth to recommend this way officially
a

albertgao

02/01/2018, 6:48 AM
Thanks for the info. Now it starts to make sense, but why I have the thought that this problem will be very hard to solve….Seems we’re gonna embrace a new IDE? 😅
g

gildor

02/01/2018, 7:02 AM
There is no announcement about that and probably even no solution inside JB. Of course it’s possible some CMake integration with Kotlin multiplatform. But not sure that this is the case, looks that nobody likes CMake and probably it requires a lot of work to support all Kotlin build features with CMake. Imho this will not happen. And K/N team mentioned that CMake is temporary solution (to support CLion) So eventually K/N will support multiplatform projects and you can build all the platforms of your project using Gradle (Kotlin Plugin + Konan, maybe some integration). Everything cool, you will get your template and can easily build it using command line or even Idea/AS And then I see a few options: 1. CLion will support Gradle and you can develop there. But not sure about support of Android/JVM/JS on Clion, sounds not very realistic, at least soon. Issue about Gradle support on Clion https://youtrack.jetbrains.com/issue/CPP-1104 2. CLion will be available as one more plugin for Intellij Idea, so Idea will allow you to develop all the platforms at the same time. But again, requires support of Gradle for native development and not clear situation with license (Idea Ultimate and CLion are different products with own license). See https://youtrack.jetbrains.com/issue/CPP-4141 3. New Kotlin IDE for Multiplatform development with JVM/Android/JS/Native stacks (and maybe even some parts of AppCode for ObjC/Swift to have full support for the all platforms). Actually similar to option 2, but with different positioning. But at least you can sell it separately Maybe I’m wrong, just my speculations
👍 1
P.S. There is a lot of work, but I don’t think that integration of multiplatform and kotlin gradle plugin + konan is something very difficult for Kotlin Team, it should solve many problems. But situation with IDEs is more interesting and I’m curious what will be the solution my bet for option 3
a

albertgao

02/01/2018, 7:34 AM
Wow, I’m impressed…. You did a lot of research man… I agree with you, multi+gradle+konan shouldn’t be a big deal for the team but the IDE is. And once they have made the former part happen, then this project will be IDE-agnostic…. well…
g

gildor

02/01/2018, 7:49 AM
It’s not a research, just read Kotlin Slack and listening for rumours 😄
With full support of Gradle and multiplatform you at least can develop in 2 IDEs simultaneously (Idea Ultimate for JVM/Android/JS and CLion for Native), not perfect situation but already quite useful. You can do that now too, but you should support 2 different build toolchains
Also, about multiplatform Kotlin IDE, would be really cool to have also features from AppCode to have better support of iOS development
m

msink

02/01/2018, 8:05 AM
Andrey Breslav said (in Russian) something about new product

https://www.youtube.com/watch?v=QOIn8Uh3lkE

at 6:20 They started development of new commercial product for cross-mobile development, Android and iOS.
a

albertgao

02/01/2018, 8:14 AM
@gildor Yes, agree. that will be a much better solution. I don’t mind using 2 IDEs at all as long as everything works. I just felt KN is pretty solid and quite ready. We are nearly there. It is the toolchain which becomes the last hurdle. Which sounds a little bit weird for a company like JB…
@msink Wow. Thanks for sharing! Ok, well, this indeed solves the problem and fits JB’s business model.
g

gildor

02/01/2018, 8:16 AM
It’s just the first IDE from JB that supports those platforms at the same IDE
Before Kotlin Multiplatform it was not so useful to have IDE that supports JVM, JS, Android, iOS and Native at the same time, nobody just use them together
a

albertgao

02/01/2018, 8:21 AM
It makes sense. But really, is it just that hard to add the according support to either IDEA or CLion as a plugin rather than a new IDE? 🤔
g

gildor

02/01/2018, 8:22 AM
At least it’s clear situation with license. Just one more license instead combining two existing licenses of Idea and CLion. And from point of marketing and positioning it’s more clear
Also I suppose CLion has own team and they focus on C/C++
a

albertgao

02/01/2018, 8:24 AM
😂OK, someone just pointed it out. I don’t mind as my company will pay for the license. Understood. KN is not CLion’s main focus.
g

gildor

02/01/2018, 8:25 AM
Actually I don’t know, maybe they now focus on KN too
I think it make sense to pay once and get IDE that supports all features for multiplatform development Don’t forget that AppCode also has own license
a

albertgao

02/01/2018, 8:27 AM
Yup, this idea makes sense.
r

rootandy

02/01/2018, 12:47 PM
I didn't read the complete and maybe I got wrong, but if you want to write some code in Kotlin "Core" without jvm or K/N extensions it should work to compile it with konan and kotlin/jvm - i am already writing libraries in kotlin that I use in android and ios Apps.
g

gildor

02/01/2018, 1:26 PM
@rootandy yes, it's possible, but you cannot use multiplatform expect/actual modifiers and you cannot use common modules, only use the same source for between native and Android projects
r

rootandy

02/01/2018, 2:20 PM
ok then I got it right
a

albertgao

02/01/2018, 8:26 PM
@rootandy Agree with you. I got it working too. It’s just the using the platform specific API tricks me. 😞
r

rootandy

02/02/2018, 4:37 AM
@albertgao for sure - since the platform specific API is different on any Platform - so you can't write one code for different platforms. The only thing is to share code between libraries that use the same platform - and that is just kotlin "core"