-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
810 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
[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. | ||
|
||
Usage | ||
----- | ||
|
||
#### Minimum configuration | ||
|
||
```Groovy | ||
// | ||
// build.gradle | ||
// | ||
buildscript { | ||
repositories { | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath "gradle.plugin.vontikov:sbe-generator-plugin:0.0.1" | ||
} | ||
} | ||
apply plugin: "vontikov.sbe-generator-plugin" | ||
``` | ||
|
||
#### Full configuration | ||
|
||
```Groovy | ||
// | ||
// build.gradle | ||
// | ||
buildscript { | ||
repositories { | ||
maven { | ||
url "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath "gradle.plugin.vontikov:sbe-generator-plugin:0.0.1" | ||
} | ||
} | ||
apply plugin: "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' | ||
} | ||
``` | ||
|
||
#### SBE version | ||
``` | ||
# | ||
# gradle.properties | ||
# | ||
sbe_version=1.8.5 | ||
``` | ||
|
||
#### 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 | | ||
|
||
License (See LICENSE file for full license) | ||
------------------------------------------ | ||
|
||
Copyright 2018 Vladimir Ontikov | ||
|
||
Licensed under the MIT License | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
v0.0.1 | ||
------ | ||
Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,93 @@ | ||
buildscript { | ||
repositories { | ||
maven { | ||
url 'https://plugins.gradle.org/m2/' | ||
} | ||
} | ||
dependencies { | ||
classpath 'com.gradle.publish:plugin-publish-plugin:0.9.10' | ||
} | ||
} | ||
|
||
|
||
plugins { | ||
id 'groovy' | ||
id 'java-gradle-plugin' | ||
id 'eclipse' | ||
id 'groovy' | ||
id 'java-gradle-plugin' | ||
id 'eclipse' | ||
id 'idea' | ||
id 'maven-publish' | ||
id 'ivy-publish' | ||
} | ||
|
||
apply plugin: 'com.gradle.plugin-publish' | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
mavenLocal() | ||
jcenter() | ||
mavenCentral() | ||
} | ||
group = artifact_group | ||
version = "${artifact_version}" | ||
|
||
group = artifact_group | ||
version = artifact_version | ||
|
||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
task createClasspathManifest { | ||
def outputDir = file("$buildDir/$name") | ||
gradlePlugin { | ||
plugins { | ||
sbeGenerator { | ||
id = 'vontikov.sbe-generator-plugin' | ||
implementationClass = 'vontikov.SbeGeneratorPlugin' | ||
} | ||
} | ||
} | ||
|
||
inputs.files sourceSets.main.runtimeClasspath | ||
outputs.dir outputDir | ||
pluginBundle { | ||
website = 'https://github.com/vontikov/sbe-gradle-plugin/' | ||
vcsUrl = 'https://github.com/vontikov/sbe-gradle-plugin/' | ||
description = 'Simple Binary Encoding plugin' | ||
tags = ['SBE', 'Simple Binary Encoding'] | ||
|
||
doLast { | ||
outputDir.mkdirs() | ||
file("$outputDir/plugin-classpath.txt").text = | ||
sourceSets.main.runtimeClasspath.join('\n') | ||
plugins { | ||
sbeGenerator { | ||
id = 'vontikov.sbe-generator-plugin' | ||
displayName = 'Simple Binary Encoding plugin' | ||
} | ||
} | ||
} | ||
|
||
publishing { | ||
repositories { | ||
mavenLocal() | ||
} | ||
} | ||
|
||
task createClasspathManifest { | ||
def outputDir = file("$buildDir/$name") | ||
|
||
inputs.files sourceSets.main.runtimeClasspath | ||
outputs.dir outputDir | ||
|
||
doLast { | ||
outputDir.mkdirs() | ||
file("$outputDir/plugin-classpath.txt").text = | ||
sourceSets.main.runtimeClasspath.join('\n') | ||
} | ||
} | ||
|
||
dependencies { | ||
compile 'org.codehaus.groovy:groovy-all:2.4.12' | ||
compile 'org.codehaus.groovy:groovy-all:2.4.12' | ||
compile gradleApi() | ||
compile localGroovy() | ||
|
||
testCompile 'junit:junit:4.12' | ||
testCompile 'org.hamcrest:hamcrest-all:1.3' | ||
testCompile 'junit:junit:4.12' | ||
testCompile 'org.hamcrest:hamcrest-all:1.3' | ||
|
||
testRuntime files(createClasspathManifest) | ||
testRuntime files(createClasspathManifest) | ||
} | ||
|
||
defaultTasks 'clean', 'build' | ||
clean.doFirst { | ||
delete "${rootDir}/src/test/resources/projects/generator/build/" | ||
} | ||
|
||
defaultTasks 'clean', 'build' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
artifact_name=sbe-generator-plugin | ||
artifact_group=vontikov | ||
artifact_version=0.0.1 | ||
artifact_version=0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rootProject.name = 'sbe-generator-plugin' | ||
rootProject.name = artifact_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.