Skip to content

Commit

Permalink
Fix copyProjectDependencies task
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamebuster19901 committed Sep 4, 2024
1 parent a33142a commit b3dbd4b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,14 @@ public enum ProjectDependencyType {
*/
excludedFabricDeps,

/**
* A non-transitive subdependency of a dependency. These dependencies are needed only at compile time, as
* they will be included by other dependencies at runtime.
*
* For example, fabric loader has mixinExtras as a transitive dependency. MixinExtras is automatically included
* at runtime by extracting it from fabric-loader's jar via JarInJar.
*
* At compile time, however, it is unavailable as it's nested inside of fabric-loader
*/
retrieveJson
}
Original file line number Diff line number Diff line change
Expand Up @@ -385,17 +385,15 @@ private void setupTasks(WWProjectContext context) {
});

project.getTasks().register("copyProjectDependencies", Copy.class, task -> {
task.doFirst(t -> {
// Get the files from the exclusion configuration
Set<File> exclusionFiles = excludedFabricDeps.getResolvedConfiguration().getFiles();
// Get the files from the exclusion configuration
Set<File> exclusionFiles = excludedFabricDeps.getResolvedConfiguration().getFiles();

task.from(resolvableImplementation, copySpec -> {
// Exclude files that are in the exclusion configuration
copySpec.exclude(fileTreeElement -> exclusionFiles.contains(fileTreeElement.getFile()));
});

task.into(Path.of(extension.getGameDestDir()).resolve("fabric"));
});
task.from(resolvableImplementation, copySpec -> {
// Exclude files that are in the exclusion configuration
copySpec.exclude(fileTreeElement -> exclusionFiles.contains(fileTreeElement.getFile()));
});

task.into(Path.of(extension.getGameDestDir()).resolve("fabric"));
});

}
Expand Down

0 comments on commit b3dbd4b

Please sign in to comment.