Possible to create a kotlin js app gradle config without webpack/npm/yarn? - kotlin

Is it possible to create a gradle config that uses the kotlin multiplatform plugin to create a project with a kotlin js client (and ktor/jvm back end) that does required the webpack/npm/yarn gymnastics which I have little use for? Even if I remove the webpack element from the config the build still seems to fail because of the yarn lock problem. (Can be worked around of course, but it just seems for simple apps all this complexity ideally could be avoided.)
Solutions that don't use gradle at all - like just calling the compiler(s) and other tools directly in a script - would also be welcome!

Related

How to make ktor reload JS changes at runtime

I'm using the KTOR multiplatform project template in IntelliJ (New Project -> Kotlin -> JS Client and JVM Server). Is there any way, when running the project in IntelliJ, to pick up runtime changes to the JS build? When I look at the classpath of the running JVM I don't see where the JS files are being picked up from at all.
Autoreloading is described here:
https://ktor.io/servers/autoreload.html
For Kotlin files compiling to Javascript, though, this does not work properly as one expects, which I presume it is why you posted this question on SO.
I posted a solution that worked for me here
https://discuss.kotlinlang.org/t/webpack-watch-in-ktor-js-project/18428/4

IntelliJ IDEA: Unable to create a Gradle project

I'm facing difficulties in setting up a gradle project. During setting up of the Gradle settings in the wizard,
I am not able to use the default recommended gradle wrapper because it downloads the Gradle and the network connectivity is very bad. So I go with the local gradle distribution which I have installed in my Ubuntu. On refreshing of the gradle project after creation, I always get stuck to this error. When I run the gradle build command through the terminal on the empty project, It works fine.
I have also tried the troubleshooting solutions given by the IDE. But, that made no improvements. Need assistance to solve this problem.
Comment if any additional info required.
As no-one else has chipped in, an approach that should work is to use the Gradle Idea Plugin instead of relying on the build in support Gradle in Idea. In my experience the plugin supports a wider range of Gradle project structures than Ideasupports directly. So you would
Create a Gradle project outside Idea and confirm it all works on from the command line.
Add the Idea plugin to the project
Run 'gradle cleanIdea idea' to generate the Idea project files.
Open up the newly generated project files from Idea and off you go.

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

use zeromq inside an eclipse plugin

I am trying to use zeromq inside an eclipse plugin.
The OSGi framework denies the use of normal external jars; thus, the solution is to bundle them into plugins themselves. Following a simple process (described also in
http://www.vogella.de/articles/EclipseJarToPlugin/article.html), I managed to use some of the external jars I needed without any suffering.
However, when I tried to bundle the jzmq.jar, I am having issues. The 'zmq plugin' is created easily but, once it is used, it freezes by looping into org.eclipse.ui.internal.Workbench.runEventLoop.
Anyone of you ever used zeromq inside an eclipse plugin successfully?
Any hint on how to solve this issue?

Ignore Sibling-Modules During Maven Javadoc/Site Compilation

I have a Maven-managed project which contains a few modules, one of which is the actual library of interest. The other modules are just add-ons or examples that build off of the library. I'm looking to generate the Maven site for this library and have it automatically deployed (as a standalone site and not as part of a multi-module site) but I am having trouble with the Javadoc plugin.
When executing the javadoc:javadoc goal, the javadoc plugin is attempting to access the jar for the other modules causing a failure.
I have created a simple example which demonstrates this phenomenon. Make sure you run the clean goal before any others so that the flaw be shown. Though executing the packaging first would solve this error, this cannot be done because the use case occurs during the Maven-managed release process which starts from a clean state.
Is there a way for me to disable this functionality in the javadoc plugin so I only get the documetation for the library module?
I can think of two options depending on your preference. Both include using profiles. If you want the default build to create the javadocs for your library of interest. Make the other modules use a property inside of the default profile in order to skip the javadocs.
If you are okay with passing in a profile, just have the javadocs only run in the profile.