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

MergeJarsTask should be an AbstractArchiveTask #6

Open
triphora opened this issue Jul 2, 2022 · 2 comments
Open

MergeJarsTask should be an AbstractArchiveTask #6

triphora opened this issue Jul 2, 2022 · 2 comments

Comments

@triphora
Copy link

triphora commented Jul 2, 2022

This way, it can be used more easily in Minotaur, for example.

@3TUSK
Copy link

3TUSK commented Jul 4, 2023

We encountered the exact same issue in Longjing as well.

See this workflow run for more logs: https://github.com/teaconmc/Longjing/actions/runs/5453959652/jobs/9923451690

Log excerpt:

* What went wrong:
Execution failed for task ':teaconLongjingProcessing'.
> assert targetTask.get() instanceof AbstractArchiveTask
         |          |     |
         |          |     false
         |          task ':mergeJars'
         provider(task 'mergeJars', class io.github.pacifistmc.forgix.plugin.MergeJarsTask)

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

In Longjing, we assume that each project will produce exactly one jar (and if the project produces > 1 jars, we pretend that all other jars do not exist); to find out where the jar is, we further assume that, there is always an AbstractArchiveTask that produces a ready-to-use jar. This has been proven to be the case for almost all standard and non-standard scenarios:

  • Projects using ForgeGradle
  • Projects using Fabric Loom, Quilt Loom or Architectury Loom
  • Multi-project or multi-loader setup (where we support specifying a specific subproject to use)

The fact that MergeJarsTask is not AbstractArchiveTask breaks our assumption.
I have done some preliminary investigation; it appears that hard-coding some special casing on our side seems possible, but with unknown quirks.

I will give more updates once I have more info to share. Still, I personally believe this should be addressed on Forgix's end.

@Ran-Mewo
Copy link
Member

Ran-Mewo commented Jul 5, 2023

I still have no clue how to turn the task into an AbstractArchiveTask
can't figure out a way to detect all projects and their jars and have the task somehow return a single JarFile

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

No branches or pull requests

3 participants