Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup JavaRosa for Kotlin development #724

Open
seadowg opened this issue Aug 1, 2023 · 7 comments · May be fixed by #725
Open

Setup JavaRosa for Kotlin development #724

seadowg opened this issue Aug 1, 2023 · 7 comments · May be fixed by #725
Assignees

Comments

@seadowg
Copy link
Member

seadowg commented Aug 1, 2023

New code in Collect has been written in Kotlin by default for a few years now (following this PR), and we've wanted to be able to write Kotlin in JavaRosa also.

It's important to note that adding Kotlin to JavaRosa means setting Kotlin up for Gradle and Maven as JavaRosa currently uses both. The former is for day to day to development and the latter is used to publish JavaRosa. It's likely that it's possible to publish using Gradle, so it could be that moving to this approach is easier than getting Kotlin working for Maven (and either is acceptable).

Existing code and test will need to converted to Kotlin to demonstrate that the tooling is working correctly. I think converting everything in entities would be a good candidate as this code is not being touched a lot at the moment, is fairly isolated from the rest of the code base (we've even considered making it its own module) and makes use of things like Java Streams that would benefit from conversion to Kotlin (EntityFormFinalizationProcessor for example).

@jack-bolles
Copy link

jack-bolles commented Aug 1, 2023

So that we're on the same page, this is about building a mixed java-kotlin source code into a package for deployment on the jvm.

The success criteria is building artefact that can be deployed on a jvm platform of the eq spec of today.

Out of scope is spending much effort to get the converted code to be "good" Kotlin rather than java converted to Kotlin.

@seadowg
Copy link
Member Author

seadowg commented Aug 1, 2023

Forgot to add "needs discussion" so just added it now.

The success criteria is building artefact that can be deployed on a jvm platform of the eq spec of today.
Out of scope is spending much effort to get the converted code to be "good" Kotlin rather than java converted to Kotlin.

Yeah that feels correct. I can write acceptance criteria (we often use a given-when-then/gherkin style) if that's helpful for us to make sure this is clear?

@jack-bolles
Copy link

Only if you want to. I think it's clear enough. And will be reviewed regardless.

@seadowg
Copy link
Member Author

seadowg commented Aug 1, 2023

Great! I'll assign this to you then.

@jack-bolles
Copy link

Does anyone have strong opinions about whether kotlin files should be under
src/main/java or src/main/kotlin - and similarly for test files?

Personally, I don't think it matters, and prolly less faff to leave them under src/main/java and make a wholesale change once, but as a future point.

@lognaturel @seadowg - thoughts?

@jack-bolles
Copy link

While I'm here - are you happy fo rme to update the maven-compiler-plugin from 3.8 to 3.11?

Similar question for gradle from 3.6 to 3.8?

@jack-bolles jack-bolles linked a pull request Aug 2, 2023 that will close this issue
@seadowg
Copy link
Member Author

seadowg commented Aug 2, 2023

Does anyone have strong opinions about whether kotlin files should be under
src/main/java or src/main/kotlin - and similarly for test files?

Great question! I've never separated them out before and we use src/main/java for evertything in Collect, so I think that makes the most sense.

While I'm here - are you happy fo rme to update the maven-compiler-plugin from 3.8 to 3.11?
Similar question for gradle from 3.6 to 3.8?

I'm assuming that's required for the latest Kotlin versions. I'm not aware of any blockers to doing that off the top of my head!

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 a pull request may close this issue.

2 participants