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

Seems Kotlin is required for the tests #106

Open
jimklimov opened this issue Dec 11, 2021 · 0 comments
Open

Seems Kotlin is required for the tests #106

jimklimov opened this issue Dec 11, 2021 · 0 comments

Comments

@jimklimov
Copy link

jimklimov commented Dec 11, 2021

Hi, first of all - thanks for the great project :)

Just wanted to share a bit of trench story, maybe to highlight this in the docs. I have a JSL for my pipelines that was long maintained by simple text editors, and decided to try getting it into an IDE (picking IDEA Community, randomly) and making built-in selftests rather than harassing guinea pigs on real servers (even if not production ones) with a lot of Replay on prepared projects.

Note: I am a noob regarding both Gradle and IDEA, though have some related experience from writing Groovy pipelines, Jenkins shared libs and maintaining some Jenkins plugins in "native" Java with maven.

Looking around for ways to unit-test JSLs I came across this project, and picked random blocks from its and the example sibling's build.gradle etc. files, having set up the project as a "Java+Groovy" one (as one of the other articles for JSL editing in IDEA had suggested).

After fixing some typos in my franken-config I got it to build (and following issues like #79 and #69 to get my JSL code past the compiler) - except for the test part, failing with compilation of RuleBootstrapper and in particular with this unresolved line:

import com.mkobit.jenkins.pipelines.codegen.LocalLibraryRetriever

for which indeed there is no matching class file name in the JAR archive.

I double-checked that an unmodified import of your example project did work, so it was not something about years passing and things becoming incompatible.

In the end, I noticed that your examples and text mentioned "Kotlin" (which I as a noob disregarded at first), and your config files had the .kts extensions. So I git mv renamed my gradle setting files and had to adapt some syntax back (def => val, more parenthesis, double-quoted strings...) et voila - IDEA did build and unit-test my JSL project (after asking to change the toolkit to process Kotlin recipes).

So I think this should be highlighted in the README, so other noobs like me suffer less :)

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

No branches or pull requests

1 participant