A PowerShell module for compiling SourceMod (.sp
) and AMX Mod X (.sma
) plugin source files for Source / Goldsource games.
Compile-SourceScript
is a wrapper to ease development of each of the mod's plugins. Specified plugins are compiled and subsequently copied into the mod's plugins
directory if found to be new or have been changed.
- Windows with PowerShell 4.0 or later, or *nix with PowerShell Core.
The module can either be installed, or imported from a local copy of this git repository.
# Latest version
Install-Module -Name Compile-SourceScript -Repository PSGallery -Scope CurrentUser -Verbose
# Or, for specific version
Install-Module -Name Compile-SourceScript -Repository PSGallery -RequiredVersion x.x.x -Scope CurrentUser -Verbose
If prompted to trust the repository, type Y
and enter
.
# Clone the git repository
git clone https://github.com/startersclan/Compile-SourceScript.git
cd Compile-SourceScript/
# Checkout version to use
git checkout vx.x.x
# Import the module
Import-Module ./src/Compile-SourceScript/Compile-SourceScript.psm1 -Force -Verbose
The module is now ready for use.
Compile-SourceScript [-File] <String> [-SkipWrapper] [-Force] [<CommonParameters>]
Compiles the SourceMod plugin source file plugin1.sp
, and installs the compiled plugin with user confirmation for the game Counter-Strike: Global Offensive.
Compile-SourceScript -File ~/server/csgo/addons/sourcemod/scripting/plugin1.sp
Compiles the AMX Mod X plugin source file plugin2.sma
without using the mod's compiler wrapper, and installs the compiled plugin without user confirmation for the game Counter-Strike 1.6.
Compile-SourceScript -File ~/server/cstrike/addons/amxmodx/scripting/plugin2.sma -SkipWrapper -Force
Compile-SourceScript
can be invoked via Build Tasks in VSCode.
Sample tasks files can be found here.
-
bash: /path/to/scripting/amxxpc: No such file or directory
Install dependencies for the compiler.
-
compiler failed to instantiate: amxxpc32.so: cannot open shared object file: No such file or directory
Invoke the compiler from within the directory where the compiler is located:
cd /path/to/scripting ./amxxpc
See here for more details.