Skip to content

Commit 3bae0a3

Browse files
authored
Re-run NFRT after the content of an artifact changed (#149)
1 parent 7ca5498 commit 3bae0a3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/main/java/net/neoforged/moddevgradle/internal/ModDevPlugin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ public void apply(Project project) {
237237
var nfrtSettings = extension.getNeoFormRuntime();
238238
task.getVerbose().set(nfrtSettings.getVerbose());
239239
task.getArtifactManifestFile().set(createManifest.get().getManifestFile());
240+
for (var configuration : createManifestConfigurations) {
241+
task.getArtifacts().from(configuration);
242+
}
240243
task.getNeoFormRuntime().from(neoFormRuntimeConfig);
241244
};
242245

src/main/java/net/neoforged/moddevgradle/internal/NeoFormRuntimeTask.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ abstract public class NeoFormRuntimeTask extends DefaultTask {
4646
@Optional
4747
abstract RegularFileProperty getArtifactManifestFile();
4848

49+
/**
50+
* Should contain the files that are in the artifact manifest.
51+
* This is used to make sure that updates to the content of these files force a task re-run,
52+
* even if the path did not change. (For example, when updating a mavenLocal file).
53+
*/
54+
@InputFiles
55+
abstract ConfigurableFileCollection getArtifacts();
56+
4957
/**
5058
* Path to the Java executable to launch NFRT with.
5159
*/

testproject/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ plugins {
22
id 'net.neoforged.moddev'
33
}
44

5-
repositories {
6-
mavenLocal()
7-
}
8-
95
sourceSets {
106
api
117
}

0 commit comments

Comments
 (0)