Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForgeGradle fails to find remapped mods with exclusiveContent repositories #925

Closed
lukebemish opened this issue Jun 29, 2023 · 3 comments
Closed

Comments

@lukebemish
Copy link

This may not be easily fixable with the current state of forgegradle, but I figured it was worth reporting so that it is documented. If you add a repository with mod dependencies with gradle's exclusiveContent filter (https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository) (which basically stops gradle from searching other repositories for stuff in a given group), and attempt to fg.deobf a mod from that repository, forge fails to find the deobfed dependency when genIntelliJRuns is ran. This is as forge's generated, remapped dependencies are in the same group that is filtered to only belong to the given repository - while I was able to figure this out, this would not be obvious to the average user or even someone with a bit of gradle knowledge but little knowledge of how forgegradle works.

@lukebemish lukebemish changed the title ForgeGradle fails to fnd remapped mods with exclusiveContent repositories ForgeGradle fails to find remapped mods with exclusiveContent repositories Jun 29, 2023
@pupnewfster
Copy link
Member

As of a while back it does you just have to include fg.repository as one of the repos the exclusive content can be found at. Can't link to specific lines of build.gradles super well from mobile but I wrote a twitter thread a while back when fg added support for it that showcased some helpers and the like I wrote that should contain enough code examples to see how to use exclusiveContent. https://twitter.com/pupnewfster/status/1638601379966074880?s=61&t=c-lOGetK6m2GaYuaICnrIw

@pupnewfster
Copy link
Member

Now that I am back at my PC so can type a bit better of an explanation of the requirements for using exclusiveContent with ForgeGradle rather than just giving an example of how to use it the main difference is that as part of the exclusiveContent block (which is defining an ExclusiveContentRepository) you need to also define forge gradle's deobf repo using fg.repository via ExclusiveContentRepository#forRepositories. Looking at the implementation details of forRepositories it seems that it is additive so you can use the common forRepository system that gradle shows in their docs as an example and then after that somewhere else in the exclusiveContent block you just would need to add a forRepositories(fg.repository) and in theory it should just work. This basically just marks the deobf repo as a valid repo for the filter so that gradle can check both the repo you list in the block as well as the deobf repo.

@lukebemish
Copy link
Author

This makes sense to me; I still think it might be better, if at all possible, to move forgegradle's remapped artifacts to their own group - that way this step is unnecessary, and adidtionally gradle doesn't scan other repositories for forgegradle's stuff (unless that is already avoided somehow). Thank you for the information though; that makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants