echocat / gradle-golang-plugin

Gradle plugin to build, test and do other stuff of Golang projects.
https://github.com/echocat/gradle-golang-plugin
Mozilla Public License 2.0
44 stars 8 forks source link

Compatible with gRPC? #26

Open breznik opened 7 years ago

breznik commented 7 years ago

I'm trying to set up a simple gradle/golang project that depends on Google's gRPC library. When I add other dependencies like protocol buffers, things seem to work as expected, but once I add gRPC I am seeing a clone exception.

Here's my sample build.gradle:

plugins {
    id "org.echocat.golang" version "0.1.16"
}

group = 'github.com/breznik/myproject'

golang {
    platforms = System.getProperty("platforms", "linux-amd64,darwin-amd64")

    dependencies {
        build 'github.com/golang/protobuf/proto'
        build 'github.com/golang/protobuf/protoc-gen-go'
        build 'google.golang.org/grpc'
    }
}

The output is:

:baseValidate
:validate
:baseClean
:clean
:prepareToolchain
:baseGetTools
:getTools
:basePrepareSources
:prepareSources
:baseTest
:test
:baseBuild
Dependency golang.org/x/sync updated.
Dependency golang.org/x/net updated.
:baseBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':baseBuild'.
> org.echocat.gradle.plugins.golang.vcs.VcsException: Cannot clone https://github.com/golang/genproto.git@unresolved to /Users/breznik/myproject/vendor/google.golang.org/genproto.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Doing a regular 'go get google.golang.org/grpc' seems to work fine in other projects. Is there something I'm doing wrong? I've also tried to pin the dependencies to specific versions, but that didn't seem to help.

maksim77 commented 7 years ago

Is there any news on this issue? I also came across with this problem

thomasjungblut commented 6 years ago

I'm having the same issues with custom repositories like

k8s.io/client-go/kubernetes which eventually resolves to https://github.com/kubernetes/client-go

Right now it just naively appends ".git" and hopes that it can retrieve something from the other end.