()
| 236 | } |
| 237 | |
| 238 | func main() { |
| 239 | |
| 240 | buildMP := flag.Bool("b", false, "Build MasterPlan into the bin directory.") |
| 241 | osFlag := flag.String("os", "", "What target OS to build MasterPlan for. Omitting this flag will build MasterPlan for the current operating system.") |
| 242 | archFlag := flag.String("arch", "", "What target arch to build MasterPlan for (either 'amd64' or 'arm64'). Omitting this flag will build MasterPlan for the current architecture.") |
| 243 | compressMP := flag.Bool("c", false, "Compress build output.") |
| 244 | itch := flag.Bool("i", false, "Upload build to itch.io.") |
| 245 | |
| 246 | flag.Parse() |
| 247 | |
| 248 | if *buildMP { |
| 249 | targetName := runtime.GOOS |
| 250 | targetArch := runtime.GOARCH |
| 251 | if *osFlag != "" { |
| 252 | targetName = *osFlag |
| 253 | } |
| 254 | if *archFlag != "" { |
| 255 | targetArch = *archFlag |
| 256 | } |
| 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) |
| 260 | } |
| 261 | if *compressMP { |
| 262 | compress() // Compresses all built binary folders in the ./bin folder |
| 263 | } |
| 264 | if *itch { |
| 265 | publishToItch() |
| 266 | } |
| 267 | |
| 268 | if !*buildMP && !*compressMP && !*itch { |
| 269 | |
| 270 | fmt.Println( |
| 271 | "MASTERPLAN BUILD SCRIPT:\n", |
| 272 | "To use this script, you can use the following arguments:\n", |
| 273 | "\n", |
| 274 | "-b to build MasterPlan for the current OS; cross-platform builds aren't fully supported yet. ", |
| 275 | "\n", |
| 276 | "Example to build for current OS, current architecture: go run . -b\n", |
| 277 | "Example to build for AMD64 Windows: go run . -b -os windows -arch amd64 \n", |
| 278 | "Example to build for ARM64 Mac: go run . -b -os darwin -arch arm64 \n", |
| 279 | "Example to build for Mac, current arch: go run . -b -os darwin\n", |
| 280 | "Example to build for Linux: go run . -b -os linux \n", |
| 281 | "\n", |
| 282 | "-c to compress the build output, as a .tar.gz file for Linux or Mac, or a .zip file for Windows.\n", |
| 283 | "\n", |
| 284 | "-i to publish the bin contents to itch.", |
| 285 | ) |
| 286 | |
| 287 | } |
| 288 | |
| 289 | } |
nothing calls this directly
no test coverage detected