* What went wrong:
Could not determine the dependencies of task ':jar'.
> Resolving dependency configuration 'implementation' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'implementation' should be resolved.
Workaround: use configurations.compileClasspath.collect instead of configurations.implementation.collect
after that, I still can't run build (./gradlew build) because of missing dependencies
Workaround: add to build.gradle:
distZip.dependsOn shadowJar
distTar.dependsOn shadowJar
startScripts.dependsOn shadowJar
startShadowScripts.dependsOn jar
FWIW everything that worked before for me still works.
When we first moved to Gradle, the jar task did not work for me. I was advised to use shadowjar instead and it continues to work. The jar task does fail for me now from a command line so we should probably fix it or deprecate it.
Fallout from #2178, but I think this is the right way to do it anyway.
github.com
It "works" for me and "gradlew jar" produced a usable file that did not seem to have problems with SVN commands. If anyone wants to try it before it is committed that might be helpful. I learned enough gradle to believe the fix is correct but I went to bed before I discovered the fix independently.
As far as I can tell, "shadow jar" is one of many generic terms for "jar that also includes all dependencies .. but kolmafia already includes all of its dependencies in its own sources, and so they are compiled into the normal jar instead of being distributed as separate precompiled jar files that are just copied around (and potentially downloaded from completely different repositories).
In fact, looking at https://romanmarkunas.com/build/2018/11/13/0007-build-gradle-fat-jars/ and looking at mafia's build.gradle ... I think the jar task already does (most of) what the shadow plugin does for shadowJar? Specifically the "from { configurations....collect { it.isDirectory() ... } }" bit