Skip to content

Gradle plugin for using protop in buildscripts

Notifications You must be signed in to change notification settings

noel-yap/protop-gradle-plugin

 
 

Repository files navigation

Gradle Plugin for Protop

This plugin wraps the protop CLI for your Gradle project. For more information about the protop CLI, please refer to the website at protop.io.

Prerequisites:

  • Latest version of protop

Current version

The current release is version 0.2.0. Import it as a buildscript dependency:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "io.protop:protop-gradle-plugin:0.2.0"
    }
}

Apply the plugin, and customize the options:

apply plugin: "io.protop"
protop {
    useLinks = true
    refreshGitSources = true
}

Add the protop path to your sources. Without this plugin, you'd do the same but with the raw path. Here, the plugin provides that value as a variable:

sourceSets {
    main {
        proto {
            srcDirs += protop.path
        }
    }
}

Finally, have the Protobuf plugin depend on the protopSync task:

protobuf {
    // ...
    generateProtoTasks {
        all().each { task ->
            task.dependsOn { protopSync }
        }
    }
}

Examples

Simple "numbers" service

About

Gradle plugin for using protop in buildscripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 62.6%
  • Groovy 37.4%