How to use beta version of WPILib in IntelliJ IDEA

Hello!
My team is using IntelliJ IDEA to write robot code, instead of VSCode. We rely on the FRC plugin by @Javaru .

Beta versions of WPILib 2024, as well as other libraries that use it (namely PathPlannerLib and Phoenix) are being released, and they have many new things that we would like to start using already.

In IntelliJ, when I create a new project with the FRC plugin, I can choose the desired WPILib version for the project in the drop-down menu. However, the versions only go up to 2023.4.3.

Is there a workaround that will let us use a 2024 beta version of WPILib in IntelliJ?
Thanks!

More information

Our computers run Windows 10 or 11. They have IntelliJ IDEA Ultiame 2023.2.x, with the latest version of the FRC plugin.

We chose IntelliJ over VSCode because we want to program in Kotlin. We made the switch after the 2023 season ended. Besides this issue, everything else has worked perfectly.

Just create a new robot project using the 2024 WPILib Beta VS Code and then open the project in IntelliJ afterwards.

2 Likes

Just tried it, it workes in Java (in simulatin anyway), but fails to build in Kotlin. (I should have mentioned - we chose IntelliJ in the first place because we want to program in Kotlin).

I’m now fumbling with gradle in an attempt to make it work

You can see the changes that the plugin makes to build.gradle for kotlin support: src/main/resources/frc-wizard-templates/2023/-DEFAULT-FILES-/gradle/groovy-dsl/build.gradle.ftl · main · Mark / IntelliJ IDEA FRC Plugin · GitLab search for getIncludeKotlinSupport()

1 Like

Thank you!

Along with build.gradle I also had to change settings.gradle, and it works now!

@shush By default, the plugin does not show the beta versions. The main reason I do not show them is that since I update my plugin separately from the WPI code, functionality of the plugin is not in sync with the changes of betas. This can cause issues. But if you would like to see the beta versions in the new project wizard, with the above caveat in mind, do the following:

  1. In IntelliJ IDEA, go to Help > Edit Custom Properties…
  2. In the custom properties file, add on a new line with the property frc.show.betas.in.new.project.wizard=true
  3. Restart IntelliJ IDEA

You will now see beta versions in the project selection wizard until the first release. Once a version has been released, beta versions are filtered out. If a beta version is selected, the project will be created using the previous year’s templates (until such time that I am able to update the templates to match the new ones from the WPI Lib project, which is usually one of the last things they do), but the WPI Lib version and FRC Year will populated based on the beta version.

p.s. I see in an post back in Oct that I missed, (sorry about that) you asked about alphas. I do not have a way to show alphas as by definition they are very unstable. And so at this time I limit to only having a way to opt-in for betas, not alphas.

1 Like

Oh that’s a much easier way, thank you!

It’s not a problem that the templates are still 2023, that’s easy enough to change on our own.


yeah, makes sense.

I also want to say, thank you for all the effort you put into this plugin!

Pretty sure this won’t work this year, as the 2024 gradlerio needs a new gradle version also.

What had to be updated in settings.gradle?

Hence my caveat that things may not work :joy: Thanks for the heads up on that since I’ve not looked at new changes yet. For the next release, I’ll make it use the new gradle version if a 2024 WPI Lib version is selected. There’s a simple lookup mapping for that. I’m hoping to have some time Sunday to dedicate to getting a new release out. It’s been a busy summer and fall (so far), so I unfortunately have not had much free time to dedicate to the plugin. With a month or so until kickoff :scream_cat: I need to find some time.

There’s an frcYear String variable in there that is set.

The project I created in VSCode and then adapted to IntelliJ and Kotlin, that built and simulated successfully.

Tomorrow I’ll check if it still works when you create the project in IntelliJ

@shush FYI, I released a new version of the plugin over the weekend that will use the new version gradle version (v8.4) when WPI Lib v2024 is selected. I will continue to work on additional changed between now and the build season kickoff.

Awesome, thank you!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.