Skip to content

Commit

Permalink
Re-run NFRT after the content of an artifact changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Aug 31, 2024
1 parent cd03652 commit 4a5a303
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ public void apply(Project project) {
var nfrtSettings = extension.getNeoFormRuntime();
task.getVerbose().set(nfrtSettings.getVerbose());
task.getArtifactManifestFile().set(createManifest.get().getManifestFile());
for (var configuration : createManifestConfigurations) {
task.getArtifacts().from(configuration);
}
task.getNeoFormRuntime().from(neoFormRuntimeConfig);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ abstract public class NeoFormRuntimeTask extends DefaultTask {
@Optional
abstract RegularFileProperty getArtifactManifestFile();

/**
* Should contain the files that are in the artifact manifest.
* This is used to make sure that updates to the content of these files force a task re-run,
* even if the path did not change. (For example, when updating a mavenLocal file).
*/
@InputFiles
abstract ConfigurableFileCollection getArtifacts();

/**
* Path to the Java executable to launch NFRT with.
*/
Expand Down
4 changes: 4 additions & 0 deletions testproject/jijtest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ plugins {
id 'net.neoforged.moddev'
}

repositories {
mavenLocal()
}

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
Expand Down
4 changes: 4 additions & 0 deletions testproject/subproject/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ plugins {
id 'maven-publish'
}

repositories {
mavenLocal()
}

neoForge {
version = project.neoforge_version

Expand Down

0 comments on commit 4a5a303

Please sign in to comment.