Batch file for new releases

A forum for the general posts relating to MacroQuest. *DEPRECATED: This forum is no longer in public use, but remains here for your reading pleasure. Enjoy

Moderator: MacroQuest Developers

compuboy
a ghoul
a ghoul
Posts: 108
Joined: Thu Apr 24, 2003 8:19 am
Location: Good Question, if anyone finds out, let me know

Batch file for new releases

Post by compuboy » Sat Jul 12, 2003 8:10 pm

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)
ya know, i cant think of anything profound to say here, so....

GO DEVS

YKW-28983
a hill giant
a hill giant
Posts: 252
Joined: Sun Dec 01, 2002 11:37 pm

Post by YKW-28983 » Sat Jul 12, 2003 9:12 pm

:roll:

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

compuboy
a ghoul
a ghoul
Posts: 108
Joined: Thu Apr 24, 2003 8:19 am
Location: Good Question, if anyone finds out, let me know

Post by compuboy » Sat Jul 12, 2003 9:45 pm

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.
ya know, i cant think of anything profound to say here, so....

GO DEVS

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Sat Jul 12, 2003 10:12 pm

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.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sat Jul 12, 2003 11:13 pm

Of course, you could just install Cygwin and run the linux script.