abelana
abelana copied to clipboard
gRPC backend doesn't compile
I've been at this a while and I am stuck. Please advise. Thankyou.
With a new, unedited clone:
git clone https://github.com/GoogleCloudPlatform/abelana/
The documentation says:
https://cloud.google.com/solutions/mobile/image-management-mobile-apps-grpc
"Launch a local gRPC backend and create Datastore indexes"
" 5. Launch the server."
$ ./gradlew execute
When I do this, I get the following error. This means that I can not run the sample project. Is something broken?
:extractProto :generateProto UP-TO-DATE :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar UP-TO-DATE :startScripts UP-TO-DATE :distZip UP-TO-DATE :prepare :execute build/distributions/abelana-grpc-server-1.0/bin/abelana-grpc-server: 158: build/distributions/abelana-grpc-server-1.0/bin/abelana-grpc-server: Syntax error: "(" unexpected :execute FAILED
FAILURE: Build failed with an exception.
-
What went wrong: Execution failed for task ':execute'.
Process 'command 'sh'' finished with non-zero exit value 2
-
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.687 secs
I'm using Ubuntu:
Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty
Ubuntu replaced sh with dash, which doesn't appear to be compatible with the generated script. Your options are to either manually call the script that resides inside the build folder after you execute gradle, or edit the execute task inside the gradle build file to execute using bash. You could also just point to the file and let the environment determine what it should use by what is specified in the head (which is bash) in case you switch environments often.
so either call it directly with some variation of
./abelana-grpc-server
Or edit the gradle build task to something like
task execute(type: Exec) {
commandLine "bash build/distributions/$project.name-$version/bin/$project.name".split()
}
or even
task execute(type: Exec) {
commandLine "./build/distributions/$project.name-$version/bin/$project.name".split()
}