Last active
October 2, 2016 22:16
-
-
Save DenWav/8f2edb9ecb9d5144ec3e6765fa6f0696 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 || n.getData() instanceof LibraryDependencyData) | |
| .filter(n -> !(n.getData() instanceof GradleSourceSetData) || ((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