korlibs / korlibs/korge-hello-world-client-server

client / server setup for JS and Desktop targets

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Kotlin
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm trying to setup a project with the client / server setup with a shared module as this sample.

But I have a problem when I want to target JS & Desktop platforms !

Here is my build.gradle.kts for the client module:

```
import com.soywiz.korge.gradle.*

apply()

korge {
id = "com.ereldev.rotsg"

targetJs()
targetDesktop()

dependencyProject(":shared")
}

dependencies {
//add("commonMainImplementation", project(":shared"))
}
```

If I'm targeting the JS platform I have this error:

```
Could not determine the dependencies of task ':client:compileProductionExecutableKotlinJs'.
> Could not resolve all task dependencies for configuration ':client:jsCompileClasspath'.
> Could not resolve project :shared.
Required by:
project :client
> No matching variant of project :shared was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js', attribute 'org.jetbrains.kotlin.js.compiler' with value 'ir' but:
- Variant 'jvmApiElements' capability rotsg:shared:unspecified declares an API of a library, preferably optimized for standard JVMs:
- Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
- Other compatible attribute:
- Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
- Variant 'jvmRuntimeElements' capability rotsg:shared:unspecified declares a runtime of a library, preferably optimized for standard JVMs:
- Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
- Other compatible attribute:
- Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
- Variant 'metadataApiElements' capability rotsg:shared:unspecified declares a usage of 'kotlin-api' of a library, preferably optimized for non-jvm:
- Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
- Other compatible attribute:
- Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
- Variant 'mingwX64ApiElements' capability rotsg:shared:unspecified declares a usage of 'kotlin-api' of a library, preferably optimized for non-jvm:
- Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
- Other compatible attribute:
- Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
- Variant 'mingwX64CInteropApiElements' capability rotsg:shared:unspecified declares a library, preferably optimized for non-jvm:
- Incompatible because this component declares a usage of 'kotlin-cinterop' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js'
- Other compatible attribute:
- Doesn't say anything about org.jetbrains.kotlin.js.compiler (required 'ir')
```

For the Desktop platform I have another error during the build:

```
e: E:\dev\rotsg\shared\build\platforms\native-desktop\bootstrap.kt: (5, 103): No value passed for parameter 'args'
```

I'm not really expérimented with Korge and Gradle so maybe I'm missing something obvious !

It is possible to make this client / server setup working with other targets than Jvm ?

Regards !

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with client/build.gradle.kts and the shared project configuration, then reproduce the JS dependency-resolution failure and the Desktop build failure. Inspect shared/build/platforms/native-desktop/bootstrap.kt alongside the reported errors. Done means the client/server setup builds successfully for both JS and Desktop targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system, full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.