Skip to content

Conversation

@maxandersen
Copy link
Member

@maxandersen maxandersen commented Apr 26, 2025

initial start of a sample in kotlin (works already)

@maxandersen
Copy link
Member Author

to try out just do mvn install and use jbang org.acme:weather-kotlin:1.0.0-SNAPSHOT:runner as command.

example vscode config:

{
    "servers": {
        "weather-kotlin": {
            "type": "stdio",
            "command": "jbang",
            "args": [
                "org.acme:weather-kotlin:1.0.0-SNAPSHOT:runner"
            ]
        }
    }
}

Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good start, let's add tests and include in CI. It's to do it in separate pr

Comment on lines +13 to +15
class Weather {
@RestClient
lateinit var weatherClient: WeatherClient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructor injection and final fields would probably be better

Suggested change
class Weather {
@RestClient
lateinit var weatherClient: WeatherClient
class Weather(
@RestClient
private val weatherClient: WeatherClient
) {

</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maven compiler should not be needed for kotlin-only build

Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather not add another sample/example app until #201 is resolved.

@kpavlov
Copy link
Contributor

kpavlov commented Apr 28, 2025

Tests indeed are needed, here they are #231

@kpavlov
Copy link
Contributor

kpavlov commented Apr 28, 2025

Let's also add .mvn/jvm.config file:

--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED

@mkouba
Copy link
Contributor

mkouba commented Aug 26, 2025

@maxandersen @kpavlov What's the status of this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants