Search in sources :

Example 1 with Manifest

use of com.google.devtools.build.buildjar.proto.JavaCompilation.Manifest in project bazel by bazelbuild.

the class AnnotationProcessingModule method buildManifestProto.

private Manifest buildManifestProto() {
    Manifest.Builder builder = Manifest.newBuilder();
    List<String> keys = new ArrayList<>(units.keySet());
    Collections.sort(keys);
    for (String key : keys) {
        CompilationUnit unit = units.get(key);
        builder.addCompilationUnit(unit);
    }
    return builder.build();
}
Also used : CompilationUnit(com.google.devtools.build.buildjar.proto.JavaCompilation.CompilationUnit) ArrayList(java.util.ArrayList) Manifest(com.google.devtools.build.buildjar.proto.JavaCompilation.Manifest)

Example 2 with Manifest

use of com.google.devtools.build.buildjar.proto.JavaCompilation.Manifest in project bazel by bazelbuild.

the class GenClass method main.

public static void main(String[] args) throws IOException {
    GenClassOptions options = GenClassOptionsParser.parse(Arrays.asList(args));
    Manifest manifest = readManifest(options.manifest());
    deleteTree(options.tempDir());
    extractGeneratedClasses(options.classJar(), manifest, options.tempDir());
    writeOutputJar(options);
}
Also used : Manifest(com.google.devtools.build.buildjar.proto.JavaCompilation.Manifest)

Example 3 with Manifest

use of com.google.devtools.build.buildjar.proto.JavaCompilation.Manifest in project bazel by bazelbuild.

the class IdlClass method main.

public static void main(String[] args) throws IOException {
    OptionsParser optionsParser = OptionsParser.newOptionsParser(IdlClassOptions.class);
    optionsParser.parseAndExitUponError(args);
    IdlClassOptions options = optionsParser.getOptions(IdlClassOptions.class);
    Preconditions.checkNotNull(options.manifestProto);
    Preconditions.checkNotNull(options.classJar);
    Preconditions.checkNotNull(options.outputClassJar);
    Preconditions.checkNotNull(options.outputSourceJar);
    Preconditions.checkNotNull(options.tempDir);
    List<Path> idlSources = Lists.newArrayList();
    for (String idlSource : optionsParser.getResidue()) {
        idlSources.add(Paths.get(idlSource));
    }
    Manifest manifest = readManifest(options.manifestProto);
    writeClassJar(options, idlSources, manifest);
    writeSourceJar(options, idlSources, manifest);
}
Also used : Path(java.nio.file.Path) OptionsParser(com.google.devtools.common.options.OptionsParser) Manifest(com.google.devtools.build.buildjar.proto.JavaCompilation.Manifest)

Aggregations

Manifest (com.google.devtools.build.buildjar.proto.JavaCompilation.Manifest)3 CompilationUnit (com.google.devtools.build.buildjar.proto.JavaCompilation.CompilationUnit)1 OptionsParser (com.google.devtools.common.options.OptionsParser)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1