Skip to content

rost5000/ProtolockGradlePlugin

Repository files navigation

Protolock gradle plugin

This plugin is a Gradle plugin that allows you to use the Protolock in gradle.

You can check more examples in the repository

How to use

  1. Add Protolock in your PATH (you can download it from here)
  2. Add the plugin to your build.gradle file
plugins {
    id 'io.github.rost5000.gradle.protolock' 
}

How to configure

You can configure the directory of proto by:

protolock {
    location{
        defaultLocation {
            setProtorootDir("$projectDir/src/main/proto")
            lockDir = "$projectDir/src/main/proto"
        }
    }
}

You can configure many locations by:

protolock {
    location {
        defaultLocation {
            setProtorootDir("$projectDir/src/main/proto")
            lockDir = "$projectDir/src/main/proto"
        }
        location {
            setProtorootDir("$projectDir/src/main/proto2")
            lockDir = "$projectDir/src/main/proto2"
        }
    }
}

Plugin tries run protolock from your PATH environment. You can specify the location of protolock by:

protolock {
    protolock {
        path = "path-to-protolock/protolock"
    }
}

You can specify the dependency of protolock by for maven central repository:

protolock {
    protolock {
        artifact = "io.github.rost5000.protolock:protolock-binaries:0.17.0"
    }
}

if you want do not fail your build if protolock found some errors, you can configure the plugin by:

protolock {
    firstLocation {
        setProtorootDir("$projectDir/src/main/proto")
        lockDir = "$projectDir/src/main/proto"
        throwOnError = fasle
    }
}

You can use protobuf gradle plugin, then dirrectory src/main/proto in your project will be added automatically.

Commands

  1. gradle protolockInit -- initialize your directories with file proto.lock. Analog to protolock init
  2. gradle protolockStatus -- check backwards compatibility. Analog to protolock status. This command will be executed automatically when you run gradle test.
  3. gradle protolockCommit -- commit your changes. Analog protolock commit

Project structure

  1. plugin directory contains plugin source code.
  2. samples directory contains samples for usage plugin.
  3. protolock-publisher directory for publishing binaries to Maven Central repository

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages