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

Implement a fallback when including non-NeoGradle source sets in a run #65

Closed
wants to merge 1 commit into from

Conversation

shartte
Copy link
Contributor

@shartte shartte commented Dec 5, 2023

Implement a fallback when including source sets that do not have NeoGradle applied so they get merged with the sources from the project in which the runs are defined.

This fixes issues with the multi-loader setups (i.e. JEIs) where a Common project is managed by sponges VanillaGradle, while the NeoForge projects are managed by NeoGradle.

In this case, the mod author just wants to have all their projects merged into a single mod at runtime:

  • project(":Common").sourceSets.main [VanillaGradle]
  • project(":CommonApi").sourceSets.main [VanillaGradle]
  • project(":NeoForgeApi").sourceSets.main [NeoGradle]
  • project(":NeoForge").sourceSets.main [NeoGradle]

With the changes in this PR, this becomes possible by specifying a mod-id on the NeoGradle and NeoGradleApi projects and including the source-sets of Common and CommonApi as usual, since these two projects will then inherit the mod id jei.

minecraft {
	modIdentifier.set("jei")
}

…radle applied so they get merged with the sources from the project in which the runs are defined.
@marchermans
Copy link
Contributor

Do I understand this right that this makes any unknown sourceset use the project that owns the runs mod identifier?

@shartte
Copy link
Contributor Author

shartte commented Dec 5, 2023

Do I understand this right that this makes any unknown sourceset use the project that owns the runs mod identifier?

Yes, exactly

@shartte
Copy link
Contributor Author

shartte commented Dec 5, 2023

Another possibility would be something along those lines...
I don't remember if FG5 or 6 had this, or if I am completely misremembering...

runs {
  configureEach {
    mods {
      jei {
        sourceSet sourceSets.main
        sourceSet project(":Common").sourceSets.main
        sourceSet project(":CommonApi").sourceSets.main
        sourceSet project(":NeoForgeApi").sourceSets.main
      }
    }
  }
}

@marchermans
Copy link
Contributor

Another possibility would be something along those lines...
I don't remember if FG5 or 6 had this, or if I am completely misremembering...

runs {
  configureEach {
    mods {
      jei {
        sourceSet sourceSets.main
        sourceSet project(":Common").sourceSets.main
        sourceSet project(":CommonApi").sourceSets.main
        sourceSet project(":NeoForgeApi").sourceSets.main
      }
    }
  }
}

You are right, but I explicitly redesigned it, because I really want to allow direct project references during runs, instead of these kinds of hacks. In my eyes, after the platform DSL completes, I want to nuke mod sources from orbit.

@shartte shartte closed this Dec 12, 2023
@shartte
Copy link
Contributor Author

shartte commented Dec 12, 2023

We need something better / more expressive than this.

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

Successfully merging this pull request may close these issues.

2 participants