Forráskód Böngészése

Added the custom and test scripts to the buildbot (#2658)

* Added the custom and test scripts to the buildbot

All scripts inside the custom and test npc directory are now parsed and executed automatically by the buildbot.
The only exceptions are the custom battleground scripts that would cause duplication warnings.

Thanks to @Jeybla for the Unix script!
Lemongrass3110 7 éve
szülő
commit
b3cfd12228
4 módosított fájl, 69 hozzáadás és 0 törlés
  1. 1 0
      .travis.yml
  2. 4 0
      appveyor.yml
  3. 52 0
      tools/ci/npc.bat
  4. 12 0
      tools/ci/npc.sh

+ 1 - 0
.travis.yml

@@ -34,6 +34,7 @@ before_script:
 
 script:
   - ./configure $CONFIGURE_FLAGS
+  - ./tools/ci/npc.sh
   - make clean
   - make server
   - ./map-server --run-once

+ 4 - 0
appveyor.yml

@@ -102,6 +102,10 @@ test_script:
     
     %MYSQL% -u %DB_ROOT% -p%DB_ROOTPW% -e "GRANT ALL ON *.* TO '%DB_USER%'@'%DB_HOST%' IDENTIFIED BY '%DB_USERPW%';"
     
+    rem Activate all custom and test scripts
+    
+    start /d tools\ci npc.bat
+    
     rem Start the map server
     
     map-server.exe --run-once

+ 52 - 0
tools/ci/npc.bat

@@ -0,0 +1,52 @@
+@echo off
+
+setlocal enabledelayedexpansion
+
+rem switch to the npc folder
+cd ..\..\npc\
+
+rem store the output destination
+set OUT=%CD%\scripts_custom.conf
+
+rem switch to the custom folder
+cd custom\
+
+rem newline
+echo. >> !OUT!
+rem header
+echo // Custom Scripts >> !OUT!
+
+rem store the current directory
+set C=%CD%
+rem make sure that no paranthesis close is unescaped inside the path
+set C=!C:^)=^^^)!
+
+for /R . %%f in (*.txt) do (
+	rem store it to allow delayed expansion
+	set B=%%f
+	rem store relative path for compare
+	set R=!B:%C%\=!
+	
+	rem all except the battleground scripts
+	if "!R:~0,12!" neq "battleground" (
+		echo npc: npc\custom\!R!>>!OUT!
+	)
+)
+
+rem switch to the test folder
+cd ..\test
+
+rem header
+echo // Test scripts >> !OUT!
+
+rem store the current directory
+set C=%CD%
+rem make sure that no paranthesis close is unescaped inside the path
+set C=!C:^)=^^^)!
+
+for /R . %%f in (*.txt) do (
+	rem store it to allow delayed expansion
+	set B=%%f
+
+	echo npc: npc\test\!B:%C%\=!>>!OUT!
+)

+ 12 - 0
tools/ci/npc.sh

@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+out=npc/scripts_custom.conf
+
+printf "\n" >> $out
+echo "// Custom Scripts" >> $out
+
+find npc/custom \( -name "*.txt" -and -not -wholename "*/battleground/*" \) | xargs -I % echo "npc: %" >> $out
+
+echo "// Test Scripts" >> $out
+
+find npc/test \( -name "*.txt" \) | xargs -I % echo "npc: %" >> $out