# Build from source

Source: https://aot.titan.tf/docs/build/
Description: Compile aot.smx with SourceMod's compiler, or build and package a release with one command.



## With SourceMod's compiler only [#with-sourcemods-compiler-only]

```txt
cd addons/sourcemod/scripting
spcomp aot.sp -i include -i <sourcemod>/scripting/include -o aot.smx
```

## With Bun [#with-bun]

With [Bun](https://bun.sh), one command downloads the SourceMod compilers AOT supports (1.12 and 1.13), builds with each (warnings fail the build), checks the line limit and writes the release zip to `dist/`:

```txt
bun tools/ci.ts
```

## The repo [#the-repo]

The repo is laid out like a server's `tf/` folder, so a checkout can be copied straight onto a server once `aot.smx` is built.

| Folder                                | What is in it                                                   |
| ------------------------------------- | --------------------------------------------------------------- |
| `addons/sourcemod/scripting`          | `aot.sp` and its parts in `aot/`                                |
| `addons/sourcemod/scripting/include`  | `aot.inc` and `aot_popfiles.inc`, the [Plugin API](/plugin-api) |
| `addons/sourcemod/scripting/examples` | An example plugin built on the API                              |
| `addons/sourcemod/configs/aot/maps`   | One [map file](/maps) per map                                   |
| `cfg/sourcemod`                       | `aot.cfg`, the [settings](/settings)                            |
| `scripts/population`                  | The missions                                                    |
| `assets/_popfiles/popfiles`           | The original hand-made AOT templates                            |
| `examples/map-pack`                   | An example map pack                                             |
| `tools`                               | The build, the release and the checks                           |
| `site`, `docs`                        | This website                                                    |

## Check it on a server [#check-it-on-a-server]

A build shows that AOT compiles. That a wave really runs is shown in the game. Point the check at a stopped test server, never a live one:

```txt
bun tools/host-check.ts --server <srcds folder>
```

It installs this checkout, starts the server and goes through every map whose file lists a mission. On each one a stand-in player readies up and the check watches wave 1:

```txt
pass  ctf_2fort: mission ctf_2fort_adv_overclock, wave 1 started, 6 of 6 robots left their spawn (farthest 2964 units)
```

Afterwards the server's files are back as they were. `--maps ctf_2fort,pl_upward` checks only those maps, and `--pack <folder>` checks a map pack on top. A map takes about 90 seconds.

## Releases [#releases]

Push a tag `v<AOT_VERSION>`, the version in `aot.sp`. The release workflow builds and publishes the zip.

## License [#license]

GNU General Public License v3.0 or later, as SourceMod plugins are. You may host, change and share AOT. A changed version you share stays under the same license, with its source.
