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

Cannot cast object '~/.go' with class 'java.lang.String' to class 'java.nio.file.Path' #19

Closed jerome-laforge closed 7 years ago

jerome-laforge commented 7 years ago

Hello, I have this error:

gradle build

FAILURE: Build failed with an exception.

* Where:
Build file '/tmp/gradle_go/build.gradle' line: 10

* What went wrong:
A problem occurred evaluating root project 'gradle_go'.
> Cannot cast object '~/.go' with class 'java.lang.String' to class 'java.nio.file.Path'

* 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: 0.594 secs

version of gradle

gradle -v
------------------------------------------------------------
Gradle 3.3
------------------------------------------------------------

Build time:   2017-01-03 15:31:04 UTC
Revision:     075893a3d0798c0c1f322899b41ceca82e4e134b

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_121 (Oracle Corporation 25.121-b13)
OS:           Linux 4.9.8-1-ARCH amd64

build.gradle

plugins {
    id 'org.echocat.golang' version '0.1.14'
}

group 'cmd'

golang {
    // Set default platforms to build but make it overwritable via -Dplatforms=<..>
    platforms = 'linux-386,linux-amd64,windows-386,windows-amd64,darwin-amd64' // String
    cacheRoot = '~/.go'

    build {
        // Use temporary GOPATH to build everthing in
        useTemporaryGopath = true

        // Is used to identify sources to be processed
        includes = [] // []String

        // Is used to identify sources to be NOT processed
        excludes = ['.git/**', '.svn/**', 'build.gradle', 'build/**', '.gradle/**', 'gradle/**'] // []String

    }

    toolchain {
        // Always build toolchain also if already there and working
        forceBuildToolchain = false // Boolean

        // Used go version
        goversion = 'go1.8' // String

        // Used GOROOT. This will normally automated detected by validate task
        //goroot = '<automatically detected>' // Path

        // Use cgo or not
        cgoEnabled = false // Boolean

        // Used GOROOT_BOOTSTRAP. This will normally automated detected by validate task
        //bootstrapGoroot = '<automatically detected>' // Path

        // Location where to download bootstrap toolchain and target toolchain
        //downloadUriRoot = 'https://storage.googleapis.com/golang/' // URI
    }
}
blaubaer commented 7 years ago

Thanks @jerome-laforge for the report, you are totally right. I will fix this within the next days.