Skip to content

Instantly share code, notes, and snippets.

@DenWav
Created October 2, 2016 22:07
Show Gist options
  • Save DenWav/0da425de0629c840a479b6ac270c8f2a to your computer and use it in GitHub Desktop.
Save DenWav/0da425de0629c840a479b6ac270c8f2a to your computer and use it in GitHub Desktop.
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