How should I create my Kotlin multi-module project with Intellij Idea? - kotlin

I want to create a Kotlin project with Gradle as a build tool that has 3 modules:
A core module that contains the "business logic" (the entities that I will use and all the stuff I need to implement the logic of my app) used by the other modules
A cli module that uses picocli to create a command line utility
A desktop module that uses Jetpack Compose for Desktop to build the UI
Is this a use case for Kotlin Multiplatform?
What (and how) can I do with some kind of wizard and what do I have to do by hand?
And if not Kotlin Multiplatform, how do I setup the whole thing?

Yes, this very much is a use case for Kotlin Multiplatform.
In IntelliJ use the menu to create a new project and select "Kotlin Multiplatform App". That will create the basic structure for you. After that, study study study.

Related

Can I add my kotlin models to Business Central?

I was looking at Business Central as a tool to help me manage my rule files. I have all my models in Kotlin and I share them from project to project.
I was hoping I could import them into Business Central to help me with writing and updating rules.
I tried importing a project which I created with the archetype for kjars but none of the Kotlin code I added showed up in BC.
Would I have to copy/write all my models in Java to this new project to be able to use BC?
Is there a way to add my models to the classpath or to a project without having to rewrite them all in Java?
Is there a compatibility plugin available for BC to help with Kotlin code?
KIE Business Central v.7.73.0.Final
Kotlin 1.7.10

How should I set up a web project using Kotlin on the back-end and in the browser?

If I wanted to build a website which used Kotlin both on the back-end, and in the browser - how would I set this up? Is there a Maven archetype or a Gradle template that captures best-practices for something like this?
The easiest way is to keep the modules separate, and I guess conceptually you'd probably want to do that also. While IntelliJ IDEA for instance doesn't natively support the ability to output to JS and JVM with Kotlin, in principle with Gradle/Maven you could. Here are instructions on targeting JVM and JavaScript for Gradle http://kotlinlang.org/docs/reference/using-gradle.html

Libraries, projects, modules and packages in Intellij Idea

I'm a beginner programmer and I'm learning how to work with Intellij IDEA. A project in IntelliJ IDEA has some different structures like libraries, modules and packages.
Can someone explain what the difference is between those structures and when to use a particular structure? e.g. I can't choose my package name (of a class) arbitrarily when it's already part of a module. What is the connection between those? I'm primarily having difficulties understanding the difference between a package and a module. (characters)
A project in intellij consists of modules. Modules can be java modules, or android modules or whatever. Modules contain your java code and all that stuff. A Module can reference a library which can be a project library or a global library. Global libraries have to be defined only once. Project library in every project you need them.
Packages are a java concept and are IDE independent.
Lets say I wanna do a little game. I would create a intellij Project called "mySuperGame". Then I would create two java modules from intellij, called "logic" and "ui". In the module settings of "ui" I would specify a project library to use opengl and a dep. to "logic". The package name of my logic classes would be "com.mysupergame.logic.XXX".
See http://confluence.jetbrains.com/display/IDEADEV/Structure+of+IntelliJ+IDEA+Project for more information.
IntelliJ IDEA supports everything eclipse has. But vise versa might not be true. Please check this table for the differences. IntelliJ support intelligent perspective and has many windows.
Read the documentation from IntelliJ idea.
Below comparison between Visual Studio (.NET) and IntelliJ (Java), which might be helpful for .NET developers migrating to Java:

Eclipse plugins for Play & Lift to create new projects

I am a beginner on Play and Lift frameworks and I have a question:
Is there any Eclipse plugin for either Play framework and/or Lift framework enabling us to create a new Play/Lift project directly from Eclipse IDE (kind from Eclipse we can do File>New>Play Project (and/or Lift Project))?!
There is a "lifty" plugin (but it may be outdated) which can create parts of the project from SBT:
http://lifty.github.io/Installing+The+Plugin.html
Anyway, the best way to create liftweb projects is, as I personally think, to start from https://github.com/lift/lift_25_sbt/
This is a small sample project created by some of Lift's commiters. It contains 2 simple pages and a basic setup. After that you can do:
./sbt eclipse with-sources=true to create an eclipse project

How to create OSGI project in IntelliJ Idea?

I am trying to create an OSGI project on IntelliJ Idea but so far couldn't make it. I can change the facet after creating a Java project but it isn't the one I want.
In eclipse, while I am creating the project ( Plugin Project ) I can select it to be an OSGI project thus IDE helps me to create required project structure.
But in IntelliJ Idea it is not - at least I couldn't find it -
Have a look to Osmorc. Its for OSGi development in Intellij. If you are familiar with Maven you can use a combination of Bnd Framework and maven-bundle-plugin. With the last one you are independend of the IDE you are using