Skip to content

Commit

Permalink
Review comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed Jun 14, 2024
1 parent 37dc79d commit f20ab93
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.neoforged.moddevgradle.dsl;

import net.neoforged.moddevgradle.internal.ModDevPlugin;
import net.neoforged.moddevgradle.internal.utils.ExtensionUtils;
import org.gradle.api.Action;
import org.gradle.api.GradleException;
import org.gradle.api.NamedDomainObjectContainer;
Expand Down Expand Up @@ -52,7 +53,7 @@ public NeoForgeExtension(Project project) {
*/
public void addModdingDependenciesTo(SourceSet sourceSet) {
var configurations = project.getConfigurations();
var sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
var sourceSets = ExtensionUtils.getSourceSets(project);
if (!sourceSets.contains(sourceSet)) {
throw new GradleException("Cannot add to the source set in another project.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public static File getIntellijProjectDir(Project project) {

// Try every included build
for (var includedBuild : project.getGradle().getIncludedBuilds()) {
// If the project itself is the included build (this is unclear from the docs), skip it, since it
// was already checked above.
if (!includedBuild.getProjectDir().equals(project.getRootDir())) {
intellijProjectDir = getIntellijProjectDir(includedBuild.getProjectDir());
if (intellijProjectDir != null) {
Expand All @@ -60,6 +62,7 @@ public static File getIntellijProjectDir(Project project) {
return null;
}

@Nullable
private static File getIntellijProjectDir(File gradleProjectDir) {
// Search the .idea folder belonging to this Gradle project
// In includeBuild scenarios, it might be above the project. It's also possible
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/neoforged/moddevgradle/tasks/JarJar.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class JarJar extends DefaultTask {
@Inject
public JarJar(FileSystemOperations fileSystemOperations) {
this.fileSystemOperations = fileSystemOperations;
this.getOutputDirectory().convention(getProject().getLayout().getBuildDirectory().dir("generated/jarjar/" + getName()));
this.getOutputDirectory().convention(getProject().getLayout().getBuildDirectory().dir("generated/" + getName()));
}

@TaskAction
Expand Down

0 comments on commit f20ab93

Please sign in to comment.