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

Improve source set support #17

Merged
merged 7 commits into from
Jun 14, 2024
Merged

Improve source set support #17

merged 7 commits into from
Jun 14, 2024

Conversation

shartte
Copy link
Collaborator

@shartte shartte commented Jun 13, 2024

Allow the modding depedencies to be added to source sets that do not extend from the main source set. Also allow setting of the primary source set for runs, which also translates into that source set being set as the IntelliJ classpath module for that run.

Isolated Source Sets

If you work with source sets that do not extend from main, and would like the modding dependencies to be available
in those source sets, you can use the following api:

sourceSets {
  anotherSourceSet // example
}
neoForge {
  // ...
  addModdingDependenciesTo(sourceSets.anotherSourceSet)
  
  mods {
    mymod {
      sourceSet sourceSets.main
      // Do not forget to add additional soruce-sets here!
      sourceSet sourceSets.anotherSourceSet
    }
  }
}
dependencies {
  implementation sourceSets.anotherSourceSet.output
}

Allow the modding depedencies to be added to source sets that do not extend from the main source set.
Also allow setting of the primary source set for runs, which also translates into that source set being set as the IntelliJ classpath module for that run.
@shartte shartte requested a review from Technici4n June 13, 2024 22:33
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Jun 13, 2024

  • Publish PR to GitHub Packages

Last commit published: 8583e166b1d303d71c812ca13daa5631c68db922.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #17' // https://github.com/neoforged/ModDevGradle/pull/17
        url 'https://prmaven.neoforged.net/ModDevGradle/pr17'
        content {
            includeModule('net.neoforged', 'moddev-gradle')
            includeModule('net.neoforged.moddev', 'net.neoforged.moddev.gradle.plugin')
        }
    }
}

shartte added 2 commits June 14, 2024 00:35
Allow the modding depedencies to be added to source sets that do not extend from the main source set.
Also allow setting of the primary source set for runs, which also translates into that source set being set as the IntelliJ classpath module for that run.
@@ -35,11 +41,16 @@ neoForge {
server {
server()
}
apitest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this add all of the testproject mod to the run despite the dependency on only api?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it adds the entire testproject mod, which contains all of the source sets.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh that is for the folder grouping, but that's not what I cared about here.
this was about setting the right module-path for the IDE

@Technici4n Technici4n merged commit 412a52a into main Jun 14, 2024
2 checks passed
@Technici4n Technici4n deleted the better-source-set-support branch June 14, 2024 19:25
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