use of com.facebook.buck.io.MorePaths in project buck by facebook.
the class IjProjectWriter method writeLibrary.
private Path writeLibrary(IjLibrary library) throws IOException {
projectFilesystem.mkdirs(LIBRARIES_PREFIX);
Path path = LIBRARIES_PREFIX.resolve(library.getName() + ".xml");
ST contents = getST(StringTemplateFile.LIBRARY_TEMPLATE);
contents.add("name", library.getName());
contents.add("binaryJar", library.getBinaryJar().map(MorePaths::pathWithUnixSeparators).orElse(null));
contents.add("classPaths", library.getClassPaths().stream().map(MorePaths::pathWithUnixSeparators).collect(MoreCollectors.toImmutableSet()));
contents.add("sourceJar", library.getSourceJar().map(MorePaths::pathWithUnixSeparators).orElse(null));
contents.add("javadocUrl", library.getJavadocUrl().orElse(null));
//TODO(marcinkosiba): support res and assets for aar.
writeToFile(contents, path);
return path;
}