MarkusAmshove / Kluent

Fluent Assertion-Library for Kotlin
https://markusamshove.github.io/Kluent/
MIT License
867 stars 64 forks source link

feat(build): Use java matrix in github action #222

Closed ursjoss closed 2 years ago

ursjoss commented 2 years ago

Adds the jvm version to the github action build job.

Configured in the course of trying to work on #220.

Checklist

MarkusAmshove commented 2 years ago

I'm wondering if it's because I build the release artifacts locally with Java 17, meaning the target version doesn't get picked up correctly, although setting it in the resulting module file.

I think that's an easy test that I can do locally with your earlier repro

MarkusAmshove commented 2 years ago

I think I could make you repro work locally.

When building Kluent with Java 11 and publishing it locally, then I can run all tests in your project with that version and Java 11. I must have built it with java 11 in the past (which is not unlikely) and didn't notice that it picks it up for APIs.

Your matrix with JVM versions is interesting, I think we'll take that for github actions :) I'll also set up a JDK 8 build for publishing.

You can test your projects locally by doing the following:

  1. Set the Kluent version in build.gradle allProjects to something like 55.0
  2. Build the project with Java 11 and gradlew build publishToMavenLocal
  3. Add mavenLocal() as a repository in your project
  4. Increment the version you use as dependency to 55.0
  5. Run a build

This worked for me

ursjoss commented 2 years ago

Yep that worked for me too (after having disabled signing). Glad you like the java matrix and thanks for fixing the issue.

MarkusAmshove commented 2 years ago

I've found a nasty workaround, as described in #223 For that the matrix isn't necessary anymore, as it's dependent on the JVM that Gradle was launched with.

I'll merge this PR anyway, to give you all the credit to deserve for hunting down this issue, thank you :)