parent
8b1268abe7
commit
545b0c946b
|
@ -29,6 +29,7 @@ import java.io.IOException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -99,14 +100,20 @@ public class NestedJars {
|
||||||
private static List<File> getContainedJars(Project project) {
|
private static List<File> getContainedJars(Project project) {
|
||||||
List<File> fileList = new ArrayList<>();
|
List<File> fileList = new ArrayList<>();
|
||||||
|
|
||||||
ResolvedConfiguration configuration = project.getConfigurations().getByName(Constants.INCLUDE).getResolvedConfiguration();
|
Configuration configuration = project.getConfigurations().getByName(Constants.INCLUDE);
|
||||||
Set<ResolvedDependency> dependencies = configuration.getFirstLevelModuleDependencies();
|
ResolvedConfiguration resolvedConfiguration = configuration.getResolvedConfiguration();
|
||||||
|
Set<ResolvedDependency> dependencies = resolvedConfiguration.getFirstLevelModuleDependencies();
|
||||||
|
|
||||||
for (ResolvedDependency dependency : dependencies) {
|
// Bit ugly doing this, id guess there is a better way but this works.
|
||||||
|
Set<String> projectDeps = new HashSet<>();
|
||||||
|
|
||||||
|
for (Dependency dependency : configuration.getDependencies()) {
|
||||||
if (dependency instanceof ProjectDependency) {
|
if (dependency instanceof ProjectDependency) {
|
||||||
ProjectDependency projectDependency = (ProjectDependency) dependency;
|
ProjectDependency projectDependency = (ProjectDependency) dependency;
|
||||||
Project dependencyProject = projectDependency.getDependencyProject();
|
Project dependencyProject = projectDependency.getDependencyProject();
|
||||||
|
|
||||||
|
projectDeps.add(dependency.getGroup() + ":" + dependency.getName() + ":" + dependency.getVersion());
|
||||||
|
|
||||||
// TODO change this to allow just normal jar tasks, so a project can have a none loom sub project
|
// TODO change this to allow just normal jar tasks, so a project can have a none loom sub project
|
||||||
Collection<Task> remapJarTasks = dependencyProject.getTasksByName("remapJar", false);
|
Collection<Task> remapJarTasks = dependencyProject.getTasksByName("remapJar", false);
|
||||||
Collection<Task> jarTasks = dependencyProject.getTasksByName("jar", false);
|
Collection<Task> jarTasks = dependencyProject.getTasksByName("jar", false);
|
||||||
|
@ -118,6 +125,12 @@ public class NestedJars {
|
||||||
fileList.add(((AbstractArchiveTask) task).getArchivePath());
|
fileList.add(((AbstractArchiveTask) task).getArchivePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ResolvedDependency dependency : dependencies) {
|
||||||
|
if (projectDeps.contains(dependency.getModuleGroup() + ":" + dependency.getModuleName() + ":" + dependency.getModuleVersion())) {
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
fileList.addAll(prepareForNesting(
|
fileList.addAll(prepareForNesting(
|
||||||
dependency
|
dependency
|
||||||
|
|
Loading…
Reference in New Issue