@@ -37,15 +37,15 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
37
37
panic (err )
38
38
}
39
39
40
- copyTo (filepath . Join ( ".." , " changelog.txt") , filepath .Join (baseDir , "changelog.txt" ))
40
+ copyTo (" changelog.txt" , filepath .Join (baseDir , "changelog.txt" ))
41
41
42
42
if forMac {
43
43
baseDir = filepath .Join (baseDir , "MasterPlan.app" , "Contents" , "MacOS" )
44
44
}
45
45
46
46
// Copy the assets folder to the bin directory
47
47
48
- copyTo (filepath . Join ( ".." , " assets") , filepath .Join (baseDir , "assets" ))
48
+ copyTo (" assets" , filepath .Join (baseDir , "assets" ))
49
49
50
50
fmt .Println ("<Assets copied.>" )
51
51
@@ -57,7 +57,7 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
57
57
58
58
// Copy the resources.syso so the executable has the generated icon and executable properties compiled in.
59
59
// This is done using go generate with goversioninfo downloaded and "// go:generate goversioninfo -64=true" in main.go.
60
- copyTo (filepath .Join (".." , " other_sources" , "resource.syso" ), filepath .Join (".." , "resource.syso" ))
60
+ copyTo (filepath .Join ("other_sources" , "resource.syso" ), filepath .Join (".." , "resource.syso" ))
61
61
62
62
// Copy in the SDL requirements (.dll files)
63
63
filepath .Walk (filepath .Join ("other_sources" ), func (path string , info fs.FileInfo , err error ) error {
@@ -96,9 +96,9 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
96
96
97
97
// Also note that I know it's weird that I'm joining the build script directory here because baseDir is already a folder up; this makes it so
98
98
// bin is the running directory
99
- c = exec .Command (`go` , `build` , `-C` , `..` , `- ldflags` , `-s -w -H windowsgui` , `-tags` , releaseMode , `-o` , filepath . Join ( "build_script" , outputFilepath ) , `.` )
99
+ c = exec .Command (`go` , `build` , `-ldflags` , `-s -w -H windowsgui` , `-tags` , releaseMode , `-o` , outputFilepath , `.` )
100
100
} else {
101
- c = exec .Command (`go` , `build` , `-C` , `..` , `- ldflags` , `-s -w` , `-tags` , releaseMode , `-o` , filepath . Join ( "build_script" , outputFilepath ) , `.` )
101
+ c = exec .Command (`go` , `build` , `-ldflags` , `-s -w` , `-tags` , releaseMode , `-o` , outputFilepath , `.` )
102
102
}
103
103
104
104
fmt .Println ("<Building binary with args: " , c .Args , ".>" )
@@ -113,8 +113,8 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
113
113
// Add the stuff for Mac
114
114
if forMac {
115
115
baseDir = filepath .Clean (filepath .Join (baseDir , ".." ))
116
- copyTo (filepath .Join (".." , " other_sources" , "Info.plist" ), filepath .Join (baseDir , "Info.plist" ))
117
- copyTo (filepath .Join (".." , " other_sources" , "macicons.icns" ), filepath .Join (baseDir , "Resources" , "macicons.icns" ))
116
+ copyTo (filepath .Join ("other_sources" , "Info.plist" ), filepath .Join (baseDir , "Info.plist" ))
117
+ copyTo (filepath .Join ("other_sources" , "macicons.icns" ), filepath .Join (baseDir , "Resources" , "macicons.icns" ))
118
118
}
119
119
120
120
// The final executable should be, well, executable for everybody. 0777 should do it for Mac and Linux.
@@ -127,7 +127,7 @@ func build(baseDir string, releaseMode string, targetOS, targetArch string) {
127
127
128
128
if forWin {
129
129
// Remove Resources; we don't need it in the root directory anymore after building.
130
- os .Remove (filepath .Join (".." , " resource.syso" ))
130
+ os .Remove (filepath .Join ("resource.syso" ))
131
131
}
132
132
133
133
}
@@ -255,8 +255,8 @@ func main() {
255
255
targetArch = * archFlag
256
256
}
257
257
258
- build (filepath .Join (".." , " bin" , targetName + "-0.9-Release-" + targetArch ), "release" , targetName , targetArch )
259
- build (filepath .Join (".." , " bin" , targetName + "-0.9-Demo-" + targetArch ), "demo" , targetName , targetArch )
258
+ build (filepath .Join ("bin" , targetName + "-0.9-Release-" + targetArch ), "release" , targetName , targetArch )
259
+ build (filepath .Join ("bin" , targetName + "-0.9-Demo-" + targetArch ), "demo" , targetName , targetArch )
260
260
}
261
261
if * compressMP {
262
262
compress () // Compresses all built binary folders in the ./bin folder
0 commit comments