Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

Exclude packages from testing #22

Open
tglaeser opened this issue Mar 1, 2017 · 5 comments
Open

Exclude packages from testing #22

tglaeser opened this issue Mar 1, 2017 · 5 comments
Assignees

Comments

@tglaeser
Copy link

tglaeser commented Mar 1, 2017

I'm trying to build project github.com/tendermint/tendermint.

My environment is Cygwin under Windows. That's not my preferred environment, but I need to stick to it right now.

Following my build.gradle file from directory github.com/tendermint/tendermint.

plugins {
id "org.echocat.golang" version "0.1.15"
}
group 'github.com/tendermint/tendermint'
golang {
    toolchain {
        goroot = '/cygdrive/c/opt/go'
    }
    build {
	useTemporaryGopath = false
   }
   testing {
//		packages = ['github.com/tendermint/tendermint/types']
//		includes = ['./types']
//		excludes = ['./']
   }
}

First, without setting golang.toolchain.goroot, the build fails with error ...

$ gradle --no-daemon build
:baseValidate
:validate
:prepareToolchain
Go toolchain for windows-amd64 build.
:prepareToolchain FAILED
Execution failed for task ':prepareToolchain'.
go SDK in C:\Users\foo\\.go\sdk\go1.8 has expected of version go1.8 but it is null.

Second, whenever I try to filter the packages for testing, ether using golang.testing.packages or golang.testing.includes, the build always fails with error ...

$ gradle --no-daemon build
:baseValidate
:validate
:prepareToolchain
:baseGetTools
:getTools
:basePrepareSources
:prepareSources
:baseTest
github.com/tendermint/tendermint/types tested.
:test
:baseBuild
can't load package: package github.com/tendermint/tendermint: no buildable Go source files in C:\home\projects\go\src\github.com\tendermint\tendermint
:baseBuild FAILED

The error is in a way correct, there are no Go sources directly under package github.com/tendermint/tendermint, but that's why I'm trying to set the filter in the first place.

Please advice. Thanks.

@blaubaer
Copy link
Member

blaubaer commented Mar 2, 2017

Hi @tglaeser!

Thanks for your report. I will try to reproduce your reported behavior (with cygwin) within the next days. Please stand by. 😄

Cheers

@blaubaer blaubaer self-assigned this Mar 2, 2017
@tglaeser
Copy link
Author

tglaeser commented Mar 5, 2017

I do have an architectural question in this context ...

Why introducing new properties project.golang.build.includes and project.golang.testing.includes? According to the Gradle DSL, shouldn't we be able to filter on a Golang SourceSet instead via project.sourceSets.main.golang.includes and project.sourceSets.test.golang.includes?

@tglaeser
Copy link
Author

Do you have an update for me? Is the plugin still actively maintained/developed?

@blaubaer
Copy link
Member

Hey @tglaeser: Currently I does not explicitly work on this issue but I still maintain/develop this project. I still focused on older issues at first. 😄

@maksim77
Copy link

+1 to this issue.
In one of our projects there is no code in the root folder. And building fails with the error:

can't load package: package our.git/folder1/folder2: no buildable Go source files in

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants