Search in sources :

Example 1 with MorePaths

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;
}
Also used : Path(java.nio.file.Path) ST(org.stringtemplate.v4.ST) MorePaths(com.facebook.buck.io.MorePaths)

Aggregations

MorePaths (com.facebook.buck.io.MorePaths)1 Path (java.nio.file.Path)1 ST (org.stringtemplate.v4.ST)1