Page 1 of 1

Batch file for new releases

Posted: Sat Jul 12, 2003 8:10 pm
by compuboy
Now, i dunno if this would be of any use to anyone, but i made a simple little batchfile that compiles and copies the macroquest files fo another place. I dont have any CVS commands in there casue my experence with SF and their server has been sketchy at best and dosent always work the first time, so feel free to edit as you wish.

Code: Select all

@echo off
echo Starting compile
cd c:\MQproject\macroquest\eqlib
nmake
cd ..
nmake
echo Starting copy
xcopy c:\MQproject\macroquest\release C:\MQ /ecifhry
The xcopy command is simple, just <source> <destination> and some options at the end that make it all work nice. Any questions see your local command prompt for answers. (help xcopy)

Posted: Sat Jul 12, 2003 9:12 pm
by YKW-28983
:roll:

G/J I guess.. good luck with the consant pms of "what do I do with this"...

Posted: Sat Jul 12, 2003 9:45 pm
by compuboy
oh ya never know, that would explain the part
Now, i dunno if this would be of any use to anyone
but its here if ya want it.

Posted: Sat Jul 12, 2003 10:12 pm
by kagonis
Due to the problem with Unix CVS Server > Windows CVS Client problem, where the CVS Client makes both a carriage return and a new line, wich screws the source up, I have decided to use a linux box for fetching the source.


The Windows Batch file:
Please note that this batch files uses several Unix exported commandline tools, use google to find those.

Code: Select all

@echo off
cls
echo MacroQuest Quick Compiler
echo.
pause
for /F "tokens=1-4 delims=/- " %%A in ('date/T') do set MYDATE=%%D%%C%%B
:cvs
cls
echo [MQ] Starting remote CVS commands
putty -load "getmq"

cls
echo [MQ] Getting sources from remote machine
pscp -q -unsafe -r -i "C:\path\to\key" username@host:/path/to/macroquest/* src

cls
echo [MQ] Fixing paths temporarely
set OLDPATH=%PATH%
call "C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\vsvars32.bat"

cls
echo [MQ] Compiling eqlib.dll
cd src\eqlib
nmake /NOLOGO /C

cls
echo [MQ] Compiling MacroQuest.exe
cd ..
nmake /NOLOGO /C

echo.
echo [MQ] MacroQuest compilation is complete.
set Path=%OLDPATH%
set INCLUDE=
set LIB=

:zip
cls
echo [MQ] Zipping the binary
zip -r -q mq-%MYDATE%.zip Release
mv -f mq-%MYDATE%.zip ..\mq-%MYDATE%.zip

:end
cls
echo [MQ] Binary zipped, process done, cleaning up sources.
rm -rf *
cd ..
The Linux Bash Script:
This is the script that is run by the >putty -load "getmq"< command. Read the documentation for Putty for further information.

Code: Select all

#!/bin/sh
if [ ! -d /path/to/macroquest ]; then
        mkdir /path/to/macroquest
fi
cd /path/to/macroquest
rm -rf *
cd /path/to
while [ ! -r /path/to/macroquest/EQLib/MQ.h ]; do
        cvs -n -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/macroquest login
        cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/macroquest co macroquest
done
Use at own risk.

Thanks to Travan for the basic idea behind the Windows Batch.

Posted: Sat Jul 12, 2003 11:13 pm
by dont_know_at_all
Of course, you could just install Cygwin and run the linux script.