https://github.com/vontikov/sbe-gradle-plugin
Simple Binary Encoding plugin for Gradle Build Tool
https://github.com/vontikov/sbe-gradle-plugin
gradle gradle-plugin sbe simple-binary-encoding
Last synced: 12 months ago
JSON representation
Simple Binary Encoding plugin for Gradle Build Tool
- Host: GitHub
- URL: https://github.com/vontikov/sbe-gradle-plugin
- Owner: vontikov
- License: mit
- Created: 2018-02-18T20:11:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-12T18:08:58.000Z (almost 2 years ago)
- Last Synced: 2024-05-12T19:24:15.249Z (almost 2 years ago)
- Topics: gradle, gradle-plugin, sbe, simple-binary-encoding
- Language: Groovy
- Homepage:
- Size: 58.6 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[Simple Binary Encoding](https://github.com/real-logic/simple-binary-encoding) plugin for [Gradle Build Tool](https://gradle.org/)
------------------------------------------
Runs [SBE Tool](https://github.com/real-logic/simple-binary-encoding/wiki/Sbe-Tool-Guide)
in a Gradle project.
Introduces a set of Gradle tasks which can be used to generate
[Simple Binary Encoding](https://github.com/real-logic/simple-binary-encoding)
codecs for Java and C++.
Compiled Java codecs are packed into a jar file.
C++ codecs are delivered in a tarball, as a header-only
[CMake](https://cmake.org/)-ready library.
Plugin site: https://plugins.gradle.org/plugin/com.github.vontikov.sbe-generator-plugin
Usage
-----
#### Plugins DSL
```Groovy
plugins {
id "com.github.vontikov.sbe-generator-plugin" version "0.0.9"
}
```
#### Legacy plugin application
```Groovy
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.vontikov:sbe-generator-plugin:0.0.9"
}
}
apply plugin: "com.github.vontikov.sbe-generator-plugin"
```
#### Full configuration
```Groovy
//
// build.gradle
//
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.vontikov:sbe-generator-plugin:0.0.5"
}
}
apply plugin: "com.github.vontikov.sbe-generator-plugin"
sbeGenerator {
src {
dir = 'src/main/resources/xml'
includes = []
excludes = []
}
javaCodecsDir = 'build/generated/src/main/java'
javaClassesDir = 'build/generated/classes'
cppCodecsDir = 'build/generated/src/main/cpp1'
cppCmakeDir = 'build/generated/cmake-project'
archivesDir = 'build/archives'
javaOptions = [:]
cppOptions = [:]
// enable or disable validation (enabled by default)
shouldValidate = true
}
```
Java or CPP options should be provided in Groovy map format.
For example:
```Groovy
javaOptions = ['sbe.java.generate.interfaces': 'true', 'sbe.generate.ir': 'true']
cppOptions = ['sbe.generate.ir': 'true']
```
The full list of options is [here](https://github.com/real-logic/simple-binary-encoding/wiki/Sbe-Tool-Guide)
#### SBE version
```
#
# gradle.properties
#
sbe_version=1.22.0
```
#### SBE Generator tasks
| Task | Description |
| --------------------- | ------------------------------------------ |
| sbeValidate | Validates message declaration schemas |
| sbeGenerateJavaCodecs | Generates Java SBE codecs |
| sbeCompileJavaCodecs | Compiles Java SBE codecs |
| sbeJavaArchive | Creates Java jar with SBE codecs |
| sbeGenerateCppCodecs | Generates C++ SBE codecs |
| sbeCppArchive | Packs generated C++ codecs |
| sbeCppCmakeScripts | Prepares C++ CMake scripts for SBE library |
Example
------------------------------------------
https://github.com/vontikov/sbe-example