All Downloads are FREE. Search and download functionalities are using the official Maven repository.

co.tomlee.gradle.plugins.protoc.domain.ProtocPlugin.groovy Maven / Gradle / Ivy

Go to download

Gradle plugin for protoc, the code generator typically associated with Google's Protocol Buffers

There is a newer version: 0.0.3
Show newest version
package co.tomlee.gradle.plugins.protoc.domain

import org.gradle.api.Named
import org.gradle.api.GradleException

class ProtocPlugin implements Named {
    final String name
    String executable
    File out
    LinkedHashMap options = new LinkedHashMap<>()
    
    public ProtocPlugin(String name) {
        this.name = name
    }
    
    def out(File outDir) {
        this.out = outDir
    }
    
    def executable(String executable) {
        this.executable = executable
    }
    
    def option(Map opt) {
        if (opt.size() > 1) {
            throw new GradleException("Too many arguments for protoc plugin option")
        }
        options.putAll(opt)
    }
    
    def options(Map opts) {
        options.putAll(opts)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy