EOCV-Sim icon indicating copy to clipboard operation
EOCV-Sim copied to clipboard

Support for Kotlin Pipelines

Open KyleChamberlin opened this issue 1 year ago • 2 comments

Kotlin Source OpenCvPipeline files

Our FTC team uses Kotlin for our OpModes and OpenCvPipelines. We would love the ability to leverage EOCV-Sim to iterate on the implementation for our pipelines. Currently, EOCV-Sim only finds java files (and I assume only can compile the java source) so we don't get the nice iteration loop.

Describe the solution you'd like Ideally, it would work very similar to how it works today with java source files. we would select the package that contains our .kt files and EOCV-Sim would compile them to run the pipelines just like .java files.

Describe alternatives you've considered Alternatively, if we were able to point EOCV-Sim to the compiled files coming out of gradle that could work too. So we would just run the gradle build and EOCV-Sim might just pick up the changes in those file. Obviously, this feels like not a great user experience, but it could be a workaround without requiring full kotlin support.

Additional context n/a

KyleChamberlin avatar Sep 27 '24 20:09 KyleChamberlin

I would be happy to submit a PR along these lines, but I would want to understand what approach you would prefer to see.

KyleChamberlin avatar Sep 27 '24 20:09 KyleChamberlin

Hi! I haven't been able to document this feature, the only option (currently) for running Kotlin pipelines is to download the EOCV-Sim repository (the whole source code) and import it into IntelliJ IDEA. Once imported, you'll be able to find a TeamCode module where you can place your own code - Kotlin is already configured in this project by default and EOCV-Sim will automatically look up for all of your pipelines within the classpath.

image

You can run EOCV-Sim directly from IntelliJ IDEA:

image

However, I'm aware this is less convenient than using workspaces, since you need to close EOCV-SIm and rebuild every time you make changes to your pipelines. I'll leave the issue open and actively consider adding Kotlin support to workspaces, although that might require extensive research on how to dynamically call and integrate a Kotlin compiler. If you're interested in working on the integration I'll be more than happy to be involved actively.

The code of interest that handles Java pipeline building lies within the EOCV-Sim module in com.github.serivesmejia.eocvsim.pipeline.compiler

serivesmejia avatar Sep 27 '24 22:09 serivesmejia