Replies: 4 comments
-
Maybe we will need this to resolve version information or even download library for mods |
Beta Was this translation helpful? Give feedback.
-
This dependency system should use a separate file for info instead of the manifest |
Beta Was this translation helpful? Give feedback.
-
My current implementation in exp branch is:
|
Beta Was this translation helpful? Give feedback.
-
Allowed to include coremod via jar in jar |
Beta Was this translation helpful? Give feedback.
-
Summary
Version manage different non-mod dependencies with not having duplicates in the classpath along with jar-in-jar support
Goals
Non Goals
Motivation
The issues we have had with external libraries changing method signatures and such brought up somewhat of a burden. Along with seeing the issues in imaginary versions where it has become dependency hell; where every mod is packing their own dependency. Jar-in-jar and shading being the major solutions to do so.
We have decided to propose a more centralized systems that cleanroom mod developers will be able to use, and have Cleanroom itself handle the dependency hell at runtime.
Description
Forge currently has a primitive Jar-in-Jar system that not many mods use, one notable mod that uses the system is
EnderIO
.EnderIO
is notorious for being hard to work with in dev, asForgeGradle
never reflected Forge's own Jar-in-Jar system properl; to be able to launch withEnderIO
in dev you had to jump through some hoops.We will tackle this component in
CleanroomGradle
, and is actually one of the easier facets of this proposal:ContainedDeps
valuesContainedDeps
values within the!jar/META-INF/libraries
folder, into themods/memory_repo/
folder.Which is what Forge does at runtime.
However, this alone absolutely does not solve the issues of poor dependency management we have currently. Which is the second portion of this proposal.
Instead of just packing dependencies in jars, cleanroom mod developers can simply state maven artifact coordinates in their jars' manifest files... which is very similar to the existing forge functionality that can be used with the
Maven-Artifact
key in the manifest, but had never been documented in any capacity.We will have to clean out this portion of the code and introduce a cleaner approach that is 100% documented and tested. While introducing proper version management.
The initial idea of version managing these non-mod libraries is quite straightforward.
Development Situation
org.apache.groovy:groovy-all
org.apache.groovy:groovy-all:5.0.0-alpha-5
andProject A
Project A
:org.apache.groovy:groovy-all:4.0.18
The implementation should resolve the above situation as such:
org.apache.groovy:groovy-all:5.0.0-alpha-5
andorg.apache.groovy:groovy-all:4.0.18
org.apache.groovy:groovy-all:4.0.18
's packages to have prefix of:v4_0_18.
Project A
references toorg.apache.groovy:groovy-all:4.0.18
packages to have the prefix ofv4_0_18.
Production Situation
org.apache.groovy:groovy-all
Mod A
depends onorg.apache.groovy:groovy-all:5.0.0-alpha-5
Mod B
depends onorg.apache.groovy:groovy-all:4.0.18
Mod C
depends onorg.apache.groovy:groovy-all
with the version range of3.0.0 <= x <= 5.0.0
The implementation should resolve the above situation as such:
org.apache.groovy:groovy-all
as being a library that is needed to be downloadedMod A
,Mod B
,Mod C
's version requirements fororg.apache.groovy:groovy-all
org.apache.groovy:groovy-all:4.0.18
andorg.apache.groovy:groovy-all:5.0.0-alpha-5
be downloaded, sinceMod C
accepts either of those versions alreadyorg.apache.groovy:groovy-all:4.0.18
, and theMod B
that depends on it.The most complex part of this being the remapping portion, the shadow plugin for gradle does a terrific job at doing this, but at compile time.
This is the initial proposal and will be subjected to revisions and scrutiny. Hence the content may change.
Dependencies
References
No response
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions