Skip to content

Commit edc0f55

Browse files
committed
Update files for pr
1 parent 4295a63 commit edc0f55

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ Please see the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/io.netif
1515
### Extension Properties
1616
The plugin defines the following extension properties in the `flatbuffers` closure:
1717

18-
| Property | Type | Default Value | Required | Description |
19-
|-----------|--------|---------------|----------|----------------------------------------------------|
20-
| flatcPath | String | flatc | False | The path to the flatc compiler. |
21-
| language | String | null | False | The language to use when compiling the FlatBuffers.|
18+
|Property | Type | Default Value | Required | Description |
19+
|--------------|--------|---------------|----------|----------------------------------------------------|
20+
| flatcPath | String | flatc | False | The path to the flatc compiler. |
21+
| language | String | null | False | The language to use when compiling the FlatBuffers.|
22+
| flatBuffersVersion | String | 1.10.0 | False | The version of the java maven binaries to include. |
2223

2324
*Note:* Please see the [Supported Languages](#supported-languages) section for valid `language` values.
2425

build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ pluginBundle {
2121
website = 'https://github.com/netifi/gradle-flatbuffers-plugin'
2222
vcsUrl = 'https://github.com/netifi/gradle-flatbuffers-plugin'
2323
tags = [ 'serialization', 'build', 'codegen' ]
24-
}
25-
2624

25+
plugins {
26+
flatBuffersPlugin {
27+
description = "Gradle plugin for generating code from Google FlatBuffers schemas."
28+
displayName = 'FlatBuffers Plugin'
29+
}
30+
}
31+
}
2732

2833
gradlePlugin {
2934
plugins {
3035
flatBuffersPlugin {
3136
id = 'io.netifi.flatbuffers'
32-
displayName = 'FlatBuffers Plugin'
3337
implementationClass = 'io.netifi.flatbuffers.plugin.FlatBuffersPlugin'
34-
description = "Gradle plugin for generating code from Google FlatBuffers schemas."
3538
}
3639
}
3740
}

ci/travis.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env bash
22
# This script builds the project in Travis
3+
export GRADLE_OPTS="-Dorg.gradle.daemon=false"
34

45
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
56
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"

src/main/groovy/io/netifi/flatbuffers/plugin/FlatBuffersPlugin.groovy

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ class FlatBuffersPlugin implements Plugin<Project> {
6363
/**
6464
* Adds a 'clean' flatBuffers for any FlatBuffers tasks in the project.
6565
*
66-
* @param flatBuffers {@link FlatBuffers} flatBuffers
66+
* @param flatBuffersTask {@link FlatBuffers} flatBuffers
6767
*/
68-
void addCleanTask(FlatBuffers flatBuffers) {
69-
def taskName = "clean${GUtil.toCamelCase(flatBuffers.name)}"
68+
void addCleanTask(FlatBuffers flatBuffersTask) {
69+
def taskName = "clean${GUtil.toCamelCase(flatBuffersTask.name)}"
7070
project.tasks.create(name: taskName, type: Delete) { Delete task ->
71-
task.delete flatBuffers.outputDir
71+
task.delete flatBuffersTask.outputDir
7272
}
7373
}
7474

@@ -109,10 +109,8 @@ class FlatBuffersPlugin implements Plugin<Project> {
109109
// Java specific dependencies
110110
project.pluginManager.withPlugin('java') {
111111
project.configurations.getByName(IMPLEMENTATION_CONFIGURATION_NAME) { Configuration config ->
112-
config.defaultDependencies {
113-
def version = "com.google.flatbuffers:flatbuffers-java:${extension.flatBuffersVersion ?: '1.10.0'}"
114-
it.add(project.dependencies.create(version))
115-
}
112+
def flatBufferVersion = "com.google.flatbuffers:flatbuffers-java:${extension.flatBuffersVersion ?: '1.10.0'}"
113+
config.dependencies.add(project.dependencies.create(flatBufferVersion))
116114
}
117115
}
118116
}

src/test/groovy/io/netifi/flatbuffers/plugin/FlatcExecutableFromPathTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import java.nio.file.Paths
2727

2828
import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
2929

30-
@IgnoreIf({ env.TRAVIS || env.CI })
30+
@IgnoreIf({ !(env.TRAVIS || env.CI) })
3131
@Requires({ os.linux })
3232
class FlatcExecutableFromPathTest extends Specification {
3333

@@ -47,7 +47,7 @@ class FlatcExecutableFromPathTest extends Specification {
4747
testProjectDir.newFolder("src", "main", 'flatbuffers')
4848
bufferSpec = testProjectDir.newFile("src/main/flatbuffers/vehicle.fbs")
4949
outputDirPath = outputDir.absolutePath
50-
flatcPath = "which -p flatc".execute().text
50+
flatcPath = "which -p flatc".execute().text.trim()
5151
}
5252

5353
def "can find flatc compiler on system path" () {
@@ -62,7 +62,7 @@ class FlatcExecutableFromPathTest extends Specification {
6262
6363
flatbuffers {
6464
language = 'java'
65-
flatcPath = 'flatc'
65+
flatcPath = '$flatcPath'
6666
}
6767
6868
task flatBuffers1(type: FlatBuffers) {

0 commit comments

Comments
 (0)