mirror of
https://github.com/bluszcz/cutego.git
synced 2024-09-28 21:25:16 +03:00
fix go module related issues
This commit is contained in:
parent
0491386233
commit
1097424d65
3 changed files with 11 additions and 7 deletions
|
@ -201,7 +201,7 @@ func moc(path, target, tags string, fast, slow, root bool, l int, dirty bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
importAs := "custom_" + ipkg + "_" + cls[0].Hash() + "m"
|
importAs := "custom_" + ipkg + "_" + cls[0].Hash() + "m"
|
||||||
if strings.Contains(spath, "/vendor/") {
|
if strings.Contains(spath, "/vendor/") && !utils.UseGOMOD(path) {
|
||||||
importAs = ipkg
|
importAs = ipkg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,7 +727,7 @@ func parse(path string) ([]*parser.Class, string, error) {
|
||||||
} else if _, ok := parser.State.GoClassMap[class.Name]; !ok { //TODO: support proper namespaces instead
|
} else if _, ok := parser.State.GoClassMap[class.Name]; !ok { //TODO: support proper namespaces instead
|
||||||
ipkg := file.Name.String()
|
ipkg := file.Name.String()
|
||||||
importAs := "custom_" + ipkg + "_" + class.Hash() + "m"
|
importAs := "custom_" + ipkg + "_" + class.Hash() + "m"
|
||||||
if strings.Contains(path, "/vendor/") {
|
if strings.Contains(path, "/vendor/") && !utils.UseGOMOD(path) {
|
||||||
importAs = ipkg
|
importAs = ipkg
|
||||||
}
|
}
|
||||||
class.Module = importAs
|
class.Module = importAs
|
||||||
|
|
|
@ -27,10 +27,14 @@ func Check(target string, docker, vagrant bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
hash := "please install git"
|
hash := "please install git"
|
||||||
if _, err := exec.LookPath("git"); err == nil {
|
if utils.UseGOMOD("") {
|
||||||
cmd := exec.Command("git", "rev-parse", "--verify", "HEAD")
|
hash = utils.GoListOptional("{{.Version}}", "github.com/therecipe/qt", "-m", "get qt hash")
|
||||||
cmd.Dir = utils.GoQtPkgPath()
|
} else {
|
||||||
hash = strings.TrimSpace(utils.RunCmdOptional(cmd, "get git hash"))
|
if _, err := exec.LookPath("git"); err == nil {
|
||||||
|
cmd := exec.Command("git", "rev-parse", "--verify", "HEAD")
|
||||||
|
cmd.Dir = utils.GoQtPkgPath()
|
||||||
|
hash = strings.TrimSpace(utils.RunCmdOptional(cmd, "get git hash"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vars := [][]string{
|
vars := [][]string{
|
||||||
|
|
|
@ -23,7 +23,7 @@ func GOPATH() string { return envOr("GOPATH", build.Default.GOPATH) }
|
||||||
func MustGoPath() string {
|
func MustGoPath() string {
|
||||||
mustGoPathMutex.Lock()
|
mustGoPathMutex.Lock()
|
||||||
if mustGoPath == "" {
|
if mustGoPath == "" {
|
||||||
if _, err := exec.LookPath("go"); err == nil {
|
if _, err := exec.LookPath("go"); err == nil && !UseGOMOD("") {
|
||||||
mustGoPath = strings.TrimSpace(RunCmd(GoList("{{.Root}}", PackageName, "-find"), "get list gopath"))
|
mustGoPath = strings.TrimSpace(RunCmd(GoList("{{.Root}}", PackageName, "-find"), "get list gopath"))
|
||||||
}
|
}
|
||||||
if mustGoPath == "" {
|
if mustGoPath == "" {
|
||||||
|
|
Loading…
Reference in a new issue