Prerequisites
Before building FG Character Extractor, ensure you have the following installed:Go 1.25.7+
Download from go.dev
Task
Install from taskfile.dev
Optional: devbox provides a consistent development environment. Install with:
Building for Your Platform
The project uses Task for build automation. All build outputs are placed in thedist/ directory.
Build for your current platform
dist/fg-char-extract for your current OS and architecture.Cross-Platform Builds
Build for all supported platforms in one command:- macOS Intel (darwin/amd64):
dist/fg-char-extract-darwin-amd64 - macOS Apple Silicon (darwin/arm64):
dist/fg-char-extract-darwin-arm64 - Windows (windows/amd64):
dist/fg-char-extract-windows-amd64.exe
The
build-all task automatically runs clean first to ensure a fresh build.Available Task Commands
The project’sTaskfile.yml defines several useful commands:
task build
task build
Build the application for your current platform only. Creates
dist/fg-char-extract.Includes source tracking - only rebuilds if *.go files have changed.task build-all
task build-all
Build for all supported platforms (macOS amd64/arm64, Windows amd64).Automatically cleans the
dist/ directory first.task run
task run
Quick test run against the test database:Equivalent to:
go run main.go ./tests/db.xmltask test
task test
task clean
task clean
Remove build artifacts and generated files:Deletes:
dist/directory (all binaries)character_*.xml(generated output files)
Building for a Specific Platform
While not exposed as a public task, you can build for a specific platform using Go’s cross-compilation:Development with Devbox
Devbox provides an isolated, reproducible development environment. The project includes devbox configuration for consistent builds. All dependencies (Go, Task) are automatically available in the devbox environment without affecting your system installation.Output Structure
After building, your directory structure will look like:Build Troubleshooting
Go version mismatch
Go version mismatch
The project requires Go 1.25.7 or higher. Check your version:If needed, download the latest version from go.dev.
Task not found
Task not found
Install Task from taskfile.dev:
Build cache issues
Build cache issues
Clear Go’s build cache and start fresh:
Next Steps
Testing
Learn how to run tests and add new test cases
Contributing
Read the contribution guidelines before submitting changes