sm-plugins/compile.py
BotoX 11aefe731b Added python scripts for easier compiling
Fixed bunch of includes and a warnings
Added ip addresses for admins to status
KnifeAlert prints to everyone now if someone gets infected due to a knifed zombie
Fixed WeaponCleaner not registering weapons if somebody disconnects
Refactored custom-chatcolors to new syntax, added autoreplace and some fixes
Added GFLClan.ru support to immunityreservedslots
added nominate_removemap to mapchooser_extended and fixed a bug for recently played maps
2016-04-26 12:46:45 +02:00

37 lines
1022 B
Python
Executable File

#!/usr/bin/python3
import os
import sys
import subprocess
SM_INCLUDES = "includes"
SPCOMP = "./spcomp"
if __name__ == "__main__":
Plugins = []
for Directory in sys.argv[1:]:
if Directory != ".git" and Directory != "include" and Directory != "includes" and Directory != "plugins":
Plugins.append(Directory)
for Plugin in Plugins:
print("Compiling {0}".format(Plugin))
SourcePath = os.path.join(Plugin, "scripting")
Path, Directories, Files = next(os.walk(SourcePath))
for File in Files:
if File.endswith(".sp"):
SourcePath = os.path.join(Path, File)
IncludePath = os.path.join(Path, "include")
OutDir = "plugins"
OutPath = os.path.join(OutDir, os.path.splitext(os.path.basename(SourcePath))[0] + ".smx")
Compiler = [SPCOMP, "-i" + SM_INCLUDES]
if os.path.isdir(IncludePath):
Compiler.append("-i" + IncludePath)
Compiler.append(SourcePath)
Compiler.append("-o" + OutPath)
try:
subprocess.run(Compiler, check=True)
except Exception:
sys.exit(1)