Created
October 2, 2016 22:07
-
-
Save DenWav/0da425de0629c840a479b6ac270c8f2a 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 -> { | |
final String[] array = ((ModuleData) n.getData()).getIdeModuleGroup(); | |
return array != null && array.length != 0 && array[0].equals(module.getName()); | |
}) | |
.limit(1) | |
.flatMap(n -> n.getChildren().stream()) | |
.filter(n -> n.getData() instanceof GradleSourceSetData) | |
.filter(n -> ((GradleSourceSetData) n.getData()).getId().contains("main")) | |
.limit(1) | |
.flatMap(n -> n.getChildren().stream()) | |
.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