Created
October 2, 2016 22:26
-
-
Save DenWav/3a01a14aecb74ef9eaa20ac8d7da0c30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean isForge = node.getChildren().stream() | |
.filter(n -> n.getData() instanceof ModuleData) | |
.filter(n -> ((ModuleData) n.getData()).getInternalName().equals(module.getName())) | |
.limit(1) | |
.flatMap(n -> n.getChildren().stream()) | |
.filter(n -> n.getData() instanceof GradleSourceSetData || n.getData() instanceof LibraryDependencyData) | |
.filter(n -> !(n.getData() instanceof GradleSourceSetData) || ((GradleSourceSetData) n.getData()).getId().contains("main")) | |
.filter(n -> ((GradleSourceSetData) n.getData()).getId().contains("main")) | |
.limit(1) | |
.flatMap(n -> { | |
if (n.getData() instanceof GradleSourceSetData) { | |
return n.getChildren().stream(); | |
} else { | |
return Stream.of(n); | |
} | |
}) | |
.filter(n -> n.getData() instanceof LibraryDependencyData) | |
.map(n -> (LibraryDependencyData) n.getData()) | |
.filter(l -> l.getExternalName().isEmpty()) | |
.anyMatch(l -> l.getTarget().getPaths(LibraryPathType.BINARY).stream() | |
.anyMatch(p -> p.contains("forgeSrc")) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment