Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 1.95 KB

BUILD.md

File metadata and controls

68 lines (44 loc) · 1.95 KB

Development: How to Run/Compile Retro AIM Server

This guide explains how to set up a development environment for Retro AIM Server and build/run the application. It assumes that you have little to no experience with golang.

Dependencies

Before you can run Retro AIM Server, set up the following software dependencies.

Golang

Since Retro AIM Server is written in go, install the latest version of golang.

If you're new to go, try Visual Studio Code wth the go plugin as your first IDE.

Mockery (optional)

Mockery is used to generate test mocks. Install this dependency and regenerate the mocks if you change any interfaces.

go install github.com/vektra/mockery/v2@latest

Run the following command in a terminal from the root of the repository in order to regenerate test mocks,

mockery

Run the Server

To run the server using go run, run the following script from the root of the repository. The default settings can be modified in config/settings.env.

scripts/run_dev.sh

Build the Server

To build the server binary:

go build -o retro_aim_server ./cmd/server

To run the binary with the settings file:

./retro_aim_server -config config/settings.env

Testing

Retro AIM Server includes a test suite that must pass before merging new code. To run the unit tests, run the following command from the root of the repository in a terminal:

go test -race ./...

Config File Generation

The config file config/settings.env is generated programmatically from the Config struct using go generate. If you want to add or remove application configuration options, first edit the Config struct and then generate the configuration files by running make config from the project root. Do not edit the config files by hand.