intended way to add cats-free as dependency?
ecoskey opened this issue ยท 2 comments
copied from SLP-Example because I mistakenly put this there first
To preface, I've been trying to figure out how to add cats-free as a dependency for my SLP mod for about a week.
Most of the issues have been about two things: the compile only custom cats version, and the fact that cats and all its dependencies are wrapped in scalablecatsforce at runtime. For the first issue, I've set the version of the custom cats version as strict, which seems to solve the version conflict, but that still leaves the runtime issue.
I've tried two approaches to solving this. Calling transitive(false) for cats-free removes all extraneous dependencies, but even though all its dependencies exist both at runtime and compile time, a classDefNotFoundError appears for cats.Foldable when calling foldMap on my Free dsl. I also tried to use dependency substitution, replacing cats core, kernel, etc. with ScalableCatsForce on the runtimeClasspath configuration. However, though this seems to fix gradle's reported runtimeClasspath, minecraft's runClient still contains all the unmodified typelevel dependencies. (Note: as advised by others, I'm using a custom configuration extending implementation to load cats-free and its dependencies to minecraft's classpath. I assume the dependency substitution problem has something to do with this, but I don't know why)
Is there something I can do to fix this as it is, or am I going about this all wrong?
I uploaded Cats Free to maven.
New version of SLP contains the binary of Cats Free.
Original version of Cats contains some illegal package name, like "byte", "long", etc. , which is not allowed in Java. Class loader provided by forge checks package name and will crash if jar contains illegal one. So I forked the repository and changed the package name and some class name to something which should be allowed in Java.
This change breaks binary compatibility, then original Cat Free can't find the type class and cause ClassNotFoundError
.