co.tomlee.gradle.plugins.protoc.domain.ProtocPlugin.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-protoc-plugin Show documentation
Show all versions of gradle-protoc-plugin Show documentation
Gradle plugin for protoc, the code generator typically associated with Google's Protocol Buffers
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)
}
}