Travis now checks templates

This commit is contained in:
Jack Edge
2016-06-22 19:28:55 +01:00
parent 4872623507
commit 676106ba92
4 changed files with 40 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ env:
- DM_MAPFILE="dreamstation"
- DM_MAPFILE="birdstation"
- DM_MAPFILE="efficiencystation"
- DM_MAPFILE="templates"
cache:
@@ -43,4 +44,4 @@ before_script:
script:
- tools/travis/check_filedirs.sh tgstation.dme
- tools/travis/build_tools.sh
- tools/travis/build_byond.sh
- tools/travis/build_byond.sh

3
_maps/.gitignore vendored
View File

@@ -1 +1,2 @@
backup/
backup/
templates.dm

View File

@@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ "$BUILD_TOOLS" = true ]; then
cd tgui && source ~/.nvm/nvm.sh && npm install && cd ..
if [ "$BUILD_TOOLS" = true ]; then
cd tgui && source ~/.nvm/nvm.sh && npm install && cd ..
fi;
if [ "$DM_MAPFILE" = "templates" ]; then
python tools/travis/template_dm_generator.py
fi;

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env python
import os
import os.path
import sys
folders = ["_maps/RandomRuins", "_maps/RandomZLevels", "_maps/shuttles",
"_maps/templates"]
generated = "_maps/templates.dm"
template_filenames = []
def find_dm(path):
L = []
for dirpath, dirnames, filenames in os.walk(path):
for name in filenames:
if name.endswith(".dmm"):
s = os.path.join(dirpath, name)
s = s.replace("_maps/","")
L.append(s)
return L
for folder in folders:
template_filenames.extend(find_dm(folder))
with open(generated, 'w') as f:
for template in template_filenames:
f.write('''#include "{}"\n'''.format(template))