File:  [mozdev] / foxfm / make.bat
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Mon May 24 12:08:24 2010 UTC (9 years, 6 months ago) by kabeleced
Branches: MAIN
CVS tags: HEAD
- made this batch more error resistant
- user is asked which cvs tag shall be used

@ECHO OFF
REM This script checks out the sources of the defined TAG and creates a 
REM firefox .xpi file. The scripts expects the tools 'cvs' and '7za' in 
REM TOOLDIR folder.

REM Remember current directory
set CURRDIR=%cd%
REM Remember current directory
set BUILDDIR=build
REM Folder containing the required tools
set TOOLDIR=tools
REM Add path of 'tools' directory
set PATH=%PATH%;%CURRDIR%\%TOOLDIR%
REM Name of the CVS module
set MODULE=foxfm
REM CVS TAG used to checkout
set TAG=foxfm_0-4-0
set USERTAG=
REM CVS user
set CVSUSER=kabeleced
REM CVSROOT
set CVSROOT=:pserver:%CVSUSER%@mozdev.org:/cvs
REM Directory where the releases shall be saved
set REALEASEDIR=downloads
REM Tool for zipping
set ZIPTOOL=7za

set /P USERTAG="Enter %MODULE% Tag to be checked out[%TAG%]: "
if not "%USERTAG%X"=="X" (
	set TAG=%USERTAG%
)

REM Extract all .zip files
cd %TOOLDIR%
if errorlevel 1 (
	echo ERROR: folder not available: %TOOLDIR%
) else (
	%ZIPTOOL% e -y *.zip
	if errorlevel 1 (
		echo ERROR: %ZIPTOOL%: %errorlevel%
	) else (
		cd %CURRDIR%
		REM Remove old building directory of current CVS TAG and its content (/S)
		REM without any furhter question (/Q)
		if exist %BUILDDIR%\%TAG% (
			rd %BUILDDIR%\%TAG% /S/Q
		)
		REM create BUILDDIR if not exists
		if not exist %BUILDDIR% (
			md %BUILDDIR%
		)
		REM Checkout the source code files of the given tag based for the setup file
		REM Save the files of the 'src' directory in a new directory (option '-d %TAG%')
		echo.Check out %MODULE% sources of tag %TAG%:
		echo.
		@ECHO ON
		cvs -d%CVSROOT% co -r %TAG% -d %BUILDDIR%\%TAG% %MODULE%/src
		@ECHO OFF
		if errorlevel 1 (
			echo ERROR: cvs co: %errorlevel%
		) else (
			cd %BUILDDIR%\%TAG%
			REM Create setup file named like the CVS tag
			REM Exclude all CVS stuff
			%ZIPTOOL% a -tzip %TAG%.xpi * -r -mx=9 -x!CVS*
			if errorlevel 1 (
				echo ERROR: %ZIPTOOL%: %errorlevel%
			) else (
				REM Move the setup file
				move %TAG%.xpi %CURRDIR%\%REALEASEDIR%
				if errorlevel 1 (
					echo ERROR: move: %errorlevel%
				)
			)			
		)
	)
)

cd %CURRDIR%
REM Finished building .xpi file for foxfm CVS tag %TAG%.
echo.&pause&goto:eof
@ECHO ON

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>