Skip to content

Commit

Permalink
initial support for go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
therecipe committed Dec 17, 2018
1 parent 5746a84 commit 8610850
Show file tree
Hide file tree
Showing 17 changed files with 181 additions and 63 deletions.
16 changes: 16 additions & 0 deletions cmd/go.mod
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
module github.com/therecipe/qt/cmd

require (
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/shurcooL/go v0.0.0-20181215222900-0143a8f55f04 // indirect
github.com/therecipe/qt v0.0.0-20181217005229-5746a84fb25d
github.com/therecipe/qt/internal/binding/files/docs v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.10.0 v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.11.1 v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.6.3 v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.7.0 v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.7.1 v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.8.0 v0.0.0-20181217005229-5746a84fb25d // indirect
github.com/therecipe/qt/internal/binding/files/docs/5.9.0 v0.0.0-20181217005229-5746a84fb25d // indirect
)
60 changes: 60 additions & 0 deletions cmd/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86 h1:D6paGObi5Wud7xg83MaEFyjxQB1W5bz5d0IFppr+ymk=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab h1:eFXv9Nu1lGbrNbj619aWwZfVF5HBrm9Plte8aNptuTI=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/shurcooL/go v0.0.0-20181215222900-0143a8f55f04 h1:X91gi8bbAueDtGVwO0XepT+QvcFKhkteYiRhrb7pQ80=
github.com/shurcooL/go v0.0.0-20181215222900-0143a8f55f04/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371 h1:SWV2fHctRpRrp49VXJ6UZja7gU9QLHwRpIPBN89SKEo=
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/therecipe/qt v0.0.0-20181217005229-5746a84fb25d h1:ztf0HJNHGw2A+7DuTG22O8jRN+pzf6E2RCt1xjPlcUw=
github.com/therecipe/qt v0.0.0-20181217005229-5746a84fb25d/go.mod h1:9zQ4FWiZ+FDr0DwZwBoC6o7DE0lRRWV8IC8J7GtUIgQ=
github.com/therecipe/qt/internal/binding/files/docs v0.0.0-20181217005229-5746a84fb25d h1:IJ1T0wqtRbnH0W5FhHF3hD7FwHrXUwcLqGDSs4y4Q/E=
github.com/therecipe/qt/internal/binding/files/docs v0.0.0-20181217005229-5746a84fb25d/go.mod h1:3m53YtVScOef+bvEyu5Pnhhdt1948eTNnsVZrP6hYeE=
github.com/therecipe/qt/internal/binding/files/docs/5.10.0 v0.0.0-20181217005229-5746a84fb25d h1:9vOm9S9NoyP2GdDfwNAV23YPXnLRFlRuv0SiHlGShKI=
github.com/therecipe/qt/internal/binding/files/docs/5.10.0 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:0kdyvN3U5+T/7oroKwjnxjOCSl0KgMdslhGFRiY6CYw=
github.com/therecipe/qt/internal/binding/files/docs/5.11.1 v0.0.0-20181217005229-5746a84fb25d h1:wrnRndejvWCu+AZrlO0MH42+z3pq0IRfjAcFAlmcmqk=
github.com/therecipe/qt/internal/binding/files/docs/5.11.1 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:89DJ2jP40NC3R0AHpsYfRtFcZxg8hg64u+GFb8cjyYs=
github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20181217005229-5746a84fb25d h1:K+1/tTrPKQ6/w4jn7MldeM1LhALK4/6ql5sRUId8nDg=
github.com/therecipe/qt/internal/binding/files/docs/5.12.0 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:7m8PDYDEtEVqfjoUQc2UrFqhG0CDmoVJjRlQxexndFc=
github.com/therecipe/qt/internal/binding/files/docs/5.6.3 v0.0.0-20181217005229-5746a84fb25d h1:8/xZoTfukHKmOAye8wIJcA/NsfBKaDN/2SK9eyMqV6c=
github.com/therecipe/qt/internal/binding/files/docs/5.6.3 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:Vekyc8wPRbEBD1XjJpnjhm8l5TRuvoZFZnRe9812jRk=
github.com/therecipe/qt/internal/binding/files/docs/5.7.0 v0.0.0-20181217005229-5746a84fb25d h1:4qqRzOw2GG/+lAbc5dEB37lkn6mG/IZr5lWbRSF1pZs=
github.com/therecipe/qt/internal/binding/files/docs/5.7.0 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:nxvy/0d+Vs+CDWSYMQTUe/CYB/gFfL35WuikY+Nk/NE=
github.com/therecipe/qt/internal/binding/files/docs/5.7.1 v0.0.0-20181217005229-5746a84fb25d h1:E/LsPb28AnoFdqc1+4y0Fq13U7keB7ylwvMJmNcBIAg=
github.com/therecipe/qt/internal/binding/files/docs/5.7.1 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:LH+7O1UJfPKV17+JOpg8jsBp+t+zR9qvPnz6c8ji9c4=
github.com/therecipe/qt/internal/binding/files/docs/5.8.0 v0.0.0-20181217005229-5746a84fb25d h1:0s7Z1H0H+JlZb1tzCjTYlMOk92AtQsPsYfm10cJQdPs=
github.com/therecipe/qt/internal/binding/files/docs/5.8.0 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:fLn3mj9ZGgEDR+/Ork0sfteGWc31cjv8b4VXITvk/fs=
github.com/therecipe/qt/internal/binding/files/docs/5.9.0 v0.0.0-20181217005229-5746a84fb25d h1:bzKPfwmiYCJDX5lhWxCxR7EHovUdHwrwoRVmneB75Yg=
github.com/therecipe/qt/internal/binding/files/docs/5.9.0 v0.0.0-20181217005229-5746a84fb25d/go.mod h1:6VuvmQeE7pyTjJ2zCaVqVNCqS6696NToUQSB+dKg5ts=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869 h1:kkXA53yGe04D0adEYJwEVQjeBppL01Exg+fnMjfUraU=
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/image v0.0.0-20181115061151-d9c2484c482e/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09 h1:QJFxMApN9XdBRwtqXfOidB2azUCA4ziuiMTrQ1uBGxw=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
2 changes: 1 addition & 1 deletion cmd/qtdeploy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func main() {
}
}

if target == "js" || target == "wasm" || strings.HasPrefix(target, "ios") {
if target == "js" || target == "wasm" { //TODO: remove for module support + resolve dependencies
os.Setenv("GOCACHE", "off")
}

Expand Down
17 changes: 1 addition & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
module github.com/therecipe/qt

require (
github.com/fsnotify/fsnotify v1.4.7 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect
github.com/kisielk/gotool v1.0.0 // indirect
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86 // indirect
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab // indirect
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371 // indirect
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v0.0.3 // indirect
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.2.2
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869
golang.org/x/image v0.0.0-20181115061151-d9c2484c482e // indirect
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09
)
require github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e
35 changes: 0 additions & 35 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,37 +1,2 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86 h1:D6paGObi5Wud7xg83MaEFyjxQB1W5bz5d0IFppr+ymk=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab h1:eFXv9Nu1lGbrNbj619aWwZfVF5HBrm9Plte8aNptuTI=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371 h1:SWV2fHctRpRrp49VXJ6UZja7gU9QLHwRpIPBN89SKEo=
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869 h1:kkXA53yGe04D0adEYJwEVQjeBppL01Exg+fnMjfUraU=
golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/image v0.0.0-20181115061151-d9c2484c482e/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/tools v0.0.0-20181115011154-2a3f5192be2e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09 h1:QJFxMApN9XdBRwtqXfOidB2azUCA4ziuiMTrQ1uBGxw=
golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
9 changes: 3 additions & 6 deletions internal/binding/templater/template_cgo_qmake.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,11 @@ func cgoFileNames(module, path, target string, mode int) []string {
case "linux":
sFixes = []string{"linux_" + utils.GOARCH()}
case "windows":
if utils.QT_MXE_ARCH() == "amd64" || (utils.QT_MSYS2() && utils.QT_MSYS2_ARCH() == "amd64") {
if utils.QT_MXE_ARCH() == "amd64" || (utils.QT_MSYS2() && utils.QT_MSYS2_ARCH() == "amd64") ||
(!utils.QT_MXE() && !utils.QT_MSYS2() && utils.QT_VERSION_NUM() >= 5120) {
sFixes = []string{"windows_amd64"}
} else {
if utils.QT_VERSION_NUM() >= 5120 {
sFixes = []string{"windows_amd64"}
} else {
sFixes = []string{"windows_386"}
}
sFixes = []string{"windows_386"}
}
case "android":
sFixes = []string{"linux_arm"}
Expand Down
4 changes: 4 additions & 0 deletions internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,10 @@ func BuildEnv(target, name, depPath string) (map[string]string, []string, []stri
env["CGO_CXXFLAGS_ALLOW"] = utils.CGO_CXXFLAGS_ALLOW()
env["CGO_LDFLAGS_ALLOW"] = utils.CGO_LDFLAGS_ALLOW()

if flags := utils.GOFLAGS(); len(flags) != 0 {
env["GOFLAGS"] = flags
}

for _, e := range os.Environ() {
es := strings.Split(e, "=")
if _, ok := env[es[0]]; !ok {
Expand Down
9 changes: 9 additions & 0 deletions internal/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package deploy

import (
"os"
"os/exec"
"path/filepath"
"runtime"

Expand Down Expand Up @@ -47,6 +48,14 @@ func Deploy(mode, target, path string, docker bool, ldFlags, tags string, fast b
if err != nil {
utils.Log.WithError(err).Panic("failed to remove deploy folder")
}

if utils.UseGOMOD(path) {
if !utils.ExistsDir(filepath.Join(path, "vendor")) {
cmd := exec.Command("go", "mod", "vendor")
cmd.Dir = path
utils.RunCmd(cmd, "go mod vendor")
}
}
}

if utils.ExistsDir(depPath + "_obj") {
Expand Down
11 changes: 11 additions & 0 deletions internal/cmd/minimal/minimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ import (
)

func Minimal(path, target, tags string) {
if utils.UseGOMOD(path) {
if !utils.ExistsDir(filepath.Join(path, "vendor")) {
cmd := exec.Command("go", "mod", "vendor")
cmd.Dir = path
utils.RunCmd(cmd, "go mod vendor")
}
}

env, tagsEnv, _, _ := cmd.BuildEnv(target, "", "")
scmd := exec.Command("go", "list")
Expand Down Expand Up @@ -249,6 +256,10 @@ func Minimal(path, target, tags string) {
continue
}

if utils.UseGOMOD("") {
utils.MkdirAll(utils.GoQtPkgPath(strings.ToLower(m)))
}

utils.SaveBytes(utils.GoQtPkgPath(strings.ToLower(m), strings.ToLower(m)+"-minimal.cpp"), templater.CppTemplate(m, templater.MINIMAL, target, ""))
utils.SaveBytes(utils.GoQtPkgPath(strings.ToLower(m), strings.ToLower(m)+"-minimal.h"), templater.HTemplate(m, templater.MINIMAL, ""))
utils.SaveBytes(utils.GoQtPkgPath(strings.ToLower(m), strings.ToLower(m)+"-minimal.go"), templater.GoTemplate(m, false, templater.MINIMAL, m, target, ""))
Expand Down
8 changes: 8 additions & 0 deletions internal/cmd/moc/moc.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ var (
)

func Moc(path, target, tags string, fast, slow bool) {
if utils.UseGOMOD(path) {
if !utils.ExistsDir(filepath.Join(path, "vendor")) {
cmd := exec.Command("go", "mod", "vendor")
cmd.Dir = path
utils.RunCmd(cmd, "go mod vendor")
}
}

moc(path, target, tags, fast, slow, true, -1, false)
}

Expand Down
8 changes: 8 additions & 0 deletions internal/cmd/rcc/rcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ var (
)

func Rcc(path, target, tagsCustom, output_dir string) {
if utils.UseGOMOD(path) {
if !utils.ExistsDir(filepath.Join(path, "vendor")) {
cmd := exec.Command("go", "mod", "vendor")
cmd.Dir = path
utils.RunCmd(cmd, "go mod vendor")
}
}

rcc(path, target, tagsCustom, output_dir, true)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/docker/js/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install python2
RUN ln -s /usr/bin/python2.7 /usr/bin/python
RUN git clone -q --depth 1 https://github.com/juj/emsdk.git $HOME/emsdk && cd $HOME/emsdk && ./emsdk install latest && ./emsdk activate latest

RUN git clone -q --depth 1 -b 5.12 --recursive https://code.qt.io/qt/qt5.git /opt/qt5
RUN git clone -q --depth 1 -b 5.12.0 --recursive https://code.qt.io/qt/qt5.git /opt/qt5

RUN echo "#!/bin/bash\nsource $HOME/emsdk/emsdk_env.sh \
&& cd /opt/qt5 && ./configure -xplatform wasm-emscripten -optimize-size -nomake tests -nomake examples -skip qtpim -skip qtfeedback -skip qtwinextras -skip qttools -confirm-license -opensource && make && make install" > $HOME/build.sh \
Expand Down
2 changes: 1 addition & 1 deletion internal/docker/linux/Dockerfile.59
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN GO=go1.11.2.linux-amd64.tar.gz && curl -sL --retry 10 --retry-delay 60 -O ht
RUN /usr/local/go/bin/go get github.com/therecipe/qt/cmd/...

RUN apt-get -qq update && apt-get --no-install-recommends -qq -y install dbus fontconfig libx11-6 libx11-xcb1
RUN QT=qt-unified-linux-x64-online.run && curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/official_releases/online_installers/$QT && chmod +x $QT && QT_QPA_PLATFORM=minimal ./$QT --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true VERSION=596
RUN QT=qt-unified-linux-x64-online.run && curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/official_releases/online_installers/$QT && chmod +x $QT && QT_QPA_PLATFORM=minimal ./$QT --script $GOPATH/src/github.com/therecipe/qt/internal/ci/iscript.qs LINUX=true VERSION=597
RUN find /opt/Qt/5.9.7 -type f -name "*.debug" -delete
RUN find /opt/Qt/Docs -type f ! -name "*.index" -delete

Expand Down
2 changes: 1 addition & 1 deletion internal/docker/wine/Dockerfile.59
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM therecipe/qt:wine_base as base

RUN QT=qt-opensource-windows-x86-5.9.7.exe && curl -sL --retry 10 --retry-delay 60 -O https://download.qt.io/official_releases/qt/5.9/5.9.7/$QT \
&& QT_QPA_PLATFORM=minimal xvfb-run wine Z:\\$QT --script=C:\\gopath\\src\\github.com\\therecipe\\qt\\internal\\ci\\iscript.qs WINDOWS=true VERSION=596 && rm -f $QT
&& QT_QPA_PLATFORM=minimal xvfb-run wine Z:\\$QT --script=C:\\gopath\\src\\github.com\\therecipe\\qt\\internal\\ci\\iscript.qs WINDOWS=true VERSION=597 && rm -f $QT
RUN rm -f $(find $HOME/.wine/drive_c/Qt/Qt5.9.7/5.9.7/mingw53_32 -name "*d.a" -exec grep -l "gnu_debug" {} \+)
RUN rm -f $(find $HOME/.wine/drive_c/Qt/Qt5.9.7/5.9.7/mingw53_32 -name "*d.dll" -exec grep -l "gnu_debug" {} \+)
RUN rm -f $(find $HOME/.wine/drive_c/Qt/Qt5.9.7/5.9.7/mingw53_32 -name "*d.dll.a" -exec grep -l "gnu_debug" {} \+)
Expand Down
35 changes: 35 additions & 0 deletions internal/utils/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"runtime"
"strconv"
"strings"
"sync"
)

var qT_VERSION_CACHE string
Expand Down Expand Up @@ -250,3 +251,37 @@ func GOARCH() string {
func QT_DYNAMIC_SETUP() bool {
return os.Getenv("QT_DYNAMIC_SETUP") == "true"
}

func GOFLAGS() string {
if flags, ok := os.LookupEnv("GOFLAGS"); ok {
return flags
}
if (strings.Contains(runtime.Version(), "1.11") || strings.Contains(runtime.Version(), "devel")) && UseGOMOD("") {
return "-mod=vendor"
}
return ""
}

func GOMOD(path string) string {
if mod, ok := os.LookupEnv("GOMOD"); ok {
return mod
}
cmd := exec.Command("go", "env", "GOMOD")
cmd.Dir = path
return strings.TrimSpace(RunCmd(cmd, "GOMOD"))
}

var (
useGOMOD bool
useGOMODMutex = new(sync.Mutex)
)

func UseGOMOD(path string) (r bool) {
useGOMODMutex.Lock()
if !useGOMOD && len(GOMOD(path)) != 0 {
useGOMOD = true
}
r = useGOMOD
useGOMODMutex.Unlock()
return
}
3 changes: 3 additions & 0 deletions internal/utils/gopath.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func MustGoPath() string {
mustGoPathMutex.Lock()
if len(mustGoPath) == 0 {
mustGoPath = strings.TrimSpace(RunCmd(exec.Command("go", "list", "-f", "{{.Root}}", "github.com/therecipe/qt"), "get list gopath"))
if len(mustGoPath) == 0 {
mustGoPath = GOPATH()
}
}
mustGoPathMutex.Unlock()
return mustGoPath
Expand Down
Loading

0 comments on commit 8610850

Please sign in to comment.