CC: Tweaked

CC: Tweaked

42M Downloads

Published metadata exposes seemingly-internal capabilities

lukebemish opened this issue ยท 6 comments

commented

Minecraft Version

1.20.x

Version

1.110.3

Details

The common project depends on common-api through implementation(commonClasses(project(":common-api"))). However, the vanillaextract tool that commonClasses uses seems to expose specifically the common classes through a capability, <group>:common-api-common in this case; this capability in the dependency is exposed on publish (see the module metadata), resulting in an impossible-to-consume common module that causes a variant incompatibility error when you attempt to depend on it as a runtime dependency, as there is no published variant on the common-api project with that capability.

commented

Thanks for the report! I thought I'd turned off publishing Gradle metadata for the common jar, but clearly not โ€” will do so now.

resulting in an impossible-to-consume common module that causes a variant incompatibility error when you attempt to depend on it as a runtime dependency

Oh, what are you depending on the common jar for? I'd expect the the common jar to crash as soon as you try to use anything from it, as all the platform specific hooks are missing.

commented

Not quite sure to be honest; it wasn't actually my project I was debugging when I ran into this ๐Ÿ˜‚. Thanks for getting it fixed.

commented

I was the one that ran into it lol.

I get

A problem occurred configuring project ':common'.
> Could not resolve all files for configuration ':common:modCompileOnly'.
   > Could not resolve cc.tweaked:cc-tweaked-1.20.1-common-api:1.110.3.
     Required by:
         project :common > cc.tweaked:cc-tweaked-1.20.1-common:1.110.3
      > Unable to find a variant of cc.tweaked:cc-tweaked-1.20.1-common-api:1.110.3 providing the requested capability cc.tweaked:common-api-common:
           - Variant apiElements provides cc.tweaked:cc-tweaked-1.20.1-common-api:1.110.3
           - Variant javadocElements provides cc.tweaked:cc-tweaked-1.20.1-common-api:1.110.3
           - Variant runtimeElements provides cc.tweaked:cc-tweaked-1.20.1-common-api:1.110.3
           - Variant sourcesElements provides cc.tweaked:cc-tweaked-1.20.1-common-api:1.110.3

* Try:
> Review the variant matching algorithm at https://docs.gradle.org/8.7/userguide/variant_attributes.html#sec:abm_algorithm.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
commented

so what do I do??

commented

I fixed it by updating to 1.111.0 lol

commented

What are you using the common jar for? External mods should really only be going through the API.