Skip to content

Make sample projects compilable standalone #302

@kpavlov

Description

@kpavlov

Describe the bug
Currently sample projects are viable only as a submodules of the main project.

To Reproduce
Steps to reproduce the behavior:

  1. User clones the repo
  2. cd samples/(project)
  3. Build gradle project- it fails

Expected behavior

  1. git clone
  2. cd kotlin-sdk/samples/PROJECT
  3. ./gradlew build
  4. Success 🎉

Logs
If applicable, add logs to help explain your problem.

./gradlew kotlin-mcp-server:runJvm                                                                                                                                                 

Welcome to Gradle 8.14.3!
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :kotlin-mcp-server:compileKotlinJvm FAILED
e: file:///Users/user/TestWorkspace/kotlin-sdk/samples/kotlin-mcp-server/src/commonMain/kotlin/server.kt:26:50 Unresolved reference 'ServerSession'.
e: file:///Users/user/TestWorkspace/kotlin-sdk/samples/kotlin-mcp-server/src/commonMain/kotlin/server.kt:98:48 Unresolved reference 'ServerSession'.
e: file:///Users/user/TestWorkspace/kotlin-sdk/samples/kotlin-mcp-server/src/commonMain/kotlin/server.kt:116:31 Unresolved reference 'onClose'.
e: file:///Users/user/TestWorkspace/kotlin-sdk/samples/kotlin-mcp-server/src/commonMain/kotlin/server.kt:124:60 Unresolved reference 'transport'.

DoD

  1. Samples are still compiled with the main project (publishToMavenLocal + replace sdk.version to snapshot in build script)
  2. Samples are continously compiled/tested as a separate GH workflow. sdk.version=latest released version

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsamples

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions