-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hello. I'm trying to use the griddle plugin to generate the default Java classes that you normally get from Thrift (ie. without Scrooge). To do this I configured my build.gradle file like so:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.7'
classpath 'com.yodle.griddle:griddle:1.7'
}
}
plugins {
id "com.commercehub.gradle.plugin.avro" version "0.8.0"
}
apply plugin: 'idl'
apply plugin: 'thrift'
apply plugin: 'scala'
apply plugin: "com.google.protobuf"
apply plugin: 'idea'
repositories {
mavenCentral()
}
dependencies {
compile 'org.scala-lang:scala-library:2.11.7',
'com.google.protobuf:protobuf-java:3.0.0-beta-2',
'com.google.protobuf:protobuf-java-util:3.0.0-beta-2',
'org.apache.tinkerpop:tinkerpop:3.2.0-incubating',
'org.apache.tinkerpop:gremlin-core:3.2.0-incubating',
'com.michaelpollmeier:gremlin-scala_2.11:3.1.0-incubating.2',
'com.trueaccord.scalapb:scalapb-runtime_2.11:0.5.26',
'com.trueaccord.scalapb:scalapb-json4s_2.11:0.1.1',
'org.apache.avro:avro:1.7.7'
compile 'org.apache.thrift:libthrift:0.9.3'
}
sourceSets {
main {
proto {
srcDirs = ['src/main/protobuf']
}
scala {
srcDirs = ['src/main/scala', "$protobuf.generatedFilesBaseDir", "$thriftGenDir"]
}
}
test {
proto {
srcDirs = ['src/test/protobuf']
}
scala {
srcDirs = ['src/test/scala', "$protobuf.generatedFilesBaseDir", "$thriftGenDir"]
}
}
}
idea {
module {
sourceDirs += file("$protobuf.generatedFilesBaseDir");
}
}
protobuf {
// Configure the protoc executable
protoc {
// Download from repositories
artifact = 'com.google.protobuf:protoc:3.0.0-beta-2'
}
// generatedFilesBaseDir = "$buildDir/generated-sources/main"
}
avro {
createSetters = false
fieldVisibility = "PRIVATE"
}
/**
* Task will use the ScalaPB binary to generate Scala classes using the .proto IDL files
* */
task generateScalaPB(type: Exec) {
workingDir 'src/main/protobuf'
commandLine './scalapbc-0.5.26/bin/scalapbc'
def protoFiles = fileTree(dir: "src/main/protobuf", include: '**/*.proto').
getFiles().
collect() { file -> file.name }
args = [protoFiles, "--scala_out=flat_package:$protobuf.generatedFilesBaseDir"].flatten()
}
compileScala {
dependsOn generateScalaPB
}
thriftSrcDir = "${projectDir}/src/main/idl"
Excuse the length build.gradle file. I'm in the process of testing out Protobuf and Avro in addition to Thrift but I thought I would provide the entire file in case there is a known compatibility issue in any of that.
Anyways, when I go to run the generateInterfaces task for gradle, I get the following output:
Note: That I'm running Gradle 2.13 on IntelliJ but the command above I ran from the terminal.
bash$ ./gradlew generateInterfaces --info
...
os.detected.name=osx
os.detected.arch=x86_64
os.detected.classifier=osx-x86_64
All projects evaluated.
Selected primary task 'generateInterfaces' from project :
Tasks to be executed: [task ':copyDependencyIdl', task ':copyIncludedIdl', task ':generateInterfaces']
:copyDependencyIdl (Thread[main,5,main]) started.
:copyDependencyIdl
Skipping task ':copyDependencyIdl' as it is up-to-date (took 0.017 secs).
:copyDependencyIdl UP-TO-DATE
:copyDependencyIdl (Thread[main,5,main]) completed. Took 0.022 secs.
:copyIncludedIdl (Thread[main,5,main]) started.
:copyIncludedIdl
Skipping task ':copyIncludedIdl' as it is up-to-date (took 0.001 secs).
:copyIncludedIdl UP-TO-DATE
:copyIncludedIdl (Thread[main,5,main]) completed. Took 0.002 secs.
:generateInterfaces (Thread[main,5,main]) started.
:generateInterfaces
Executing task ':generateInterfaces' (up-to-date check took 0.005 secs) due to:
Task ':generateInterfaces' has changed type from 'com.yodle.griddle.GenerateInterfacesScroogeTask_Decorated' to 'com.yodle.griddle.GenerateInterfacesThriftTask_Decorated'.
Starting process 'command 'thrift''. Working directory: /Users/luis.medina/code/protobuf Command: thrift -o /Users/luis.medina/code/protobuf/build/gen-src --gen java:hashcode -I /Users/luis.medina/code/protobuf/build/idl/dependency -I /Users/luis.medina/code/protobuf/build/idl/included /Users/luis.medina/code/protobuf/src/main/idl/test.thrift
:generateInterfaces FAILED
:generateInterfaces (Thread[main,5,main]) completed. Took 0.044 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateInterfaces'.
> A problem occurred starting process 'command 'thrift''
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 3.366 secs
Stopped 0 compiler daemon(s).
Any idea what might be going on when it says that the "generateInterfaces" task changed type?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels