Permalink
Browse files

- Build scripts refactoring

- Inject version and build number into Host exe
- Updated project info in RC file
  • Loading branch information...
sebdeckers committed Mar 31, 2010
1 parent 9db4ad4 commit 3a32843841a38997880f48e49dabf95f966db280
Showing with 100 additions and 28 deletions.
  1. +2 −2 Host/Source/Pandion.rc
  2. +17 −0 Host/build_host.bat
  3. +21 −15 Installer/Appcaster/build_feed.bat
  4. +5 −9 Installer/WiX/build_msi.bat
  5. +2 −2 Installer/WiX/version.wxs
  6. +28 −0 build_all.bat
  7. +25 −0 build_config.bat
View
@@ -53,10 +53,10 @@ BEGIN
BEGIN
BLOCK "040904e3"
BEGIN
- VALUE "Comments", "http://www.pandion.be"
+ VALUE "Comments", "http://pandion.im/"
VALUE "CompanyName", "Pandion"
VALUE "FileDescription", "Pandion Instant Messenger"
- VALUE "LegalCopyright", "Created by Sebastiaan Deckers and Dries Staelens."
+ VALUE "LegalCopyright", "Created by the Pandion Team"
#if defined(MAJOR_VERSION) && defined(MINOR_VERSION) && defined(BUILD_NUMBER)
VALUE "FileVersion", ""
VALUE "ProductVersion", ""
View
@@ -0,0 +1,17 @@
+:: This file is part of Pandion instant messenger
+:: Copyright (c) 2009-2010 Sebastiaan Deckers
+:: License: GNU General Public License version 3 or later
+
+@ECHO OFF
+IF NOT DEFINED BUILD_CONFIG CALL "..\build_config.bat"
+
+ECHO #define FILEVER %VERSION_MAJOR%,%VERSION_MINOR%,%BUILD_NUMBER%,0 > ".\Source\VersionNo.h"
+ECHO #define PRODUCTVER %VERSION_MAJOR%,%VERSION_MINOR%,%BUILD_NUMBER%,0 >> ".\Source\VersionNo.h"
+ECHO #define FILEVERSTR "%VERSION_MAJOR%,%VERSION_MINOR%,%BUILD_NUMBER%,0\0" >> ".\Source\VersionNo.h"
+ECHO #define PRODUCTVERSTR "%VERSION_MAJOR%,%VERSION_MINOR%,%BUILD_NUMBER%,0\0" >> ".\Source\VersionNo.h"
+
+CALL "%VS90COMNTOOLS%\vsvars32.bat"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Cannot set environment build variables && EXIT /B 1
+
+VCBUILD /useenv /rebuild "host.sln" "Release|Win32"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Failed to compile Host && EXIT /B 1
@@ -3,20 +3,26 @@
:: License: GNU General Public License version 3 or later
@ECHO OFF
-SETLOCAL
+IF NOT DEFINED BUILD_CONFIG CALL "..\..\build_config.bat"
-:: Hudson sets its environment variables but defaults are provided for manual builds.
-:: TODO: This information should be centralized and automated. Perhaps using Ant or Maven2?
-SET VERSION_MAJOR=2
-SET VERSION_MINOR=6
-IF NOT DEFINED BUILD_NUMBER SET BUILD_NUMBER=0
-IF NOT DEFINED HUDSON_URL SET HUDSON_URL=http://build.pandion.im/
-IF NOT DEFINED JOB_NAME SET JOB_NAME=Pandion
-SET VERSION=%VERSION_MAJOR%.%VERSION_MINOR%.%BUILD_NUMBER%
-SET PACKAGE=%JOB_NAME%_%VERSION%.msi
-SET LOCAL_FILE=../WiX/%PACKAGE%
-SET DOWNLOAD_URL=http://downloads.sourceforge.net/project/pandion/builds/%PACKAGE%
-SET INFO_URL=%HUDSON_URL%job/%JOB_NAME%/%BUILD_NUMBER%/changes
-SET FEED_URL=http://feeds.feedburner.com/pandionupdates
+CScript.exe appcaster.wsf ^
+ //NoLogo ^
+ /maxcount:3 ^
+ /source:"%APPCAST_FEED_URL%" ^
+ /path:index.xml ^
+ /overwrite:false ^
+ /application:"%JOB_NAME%" ^
+ /author:"%JOB_NAME% Team" ^
+ /description:"%JOB_NAME% software updates feed" ^
+ /location:"%APPCAST_FEED_URL%" ^
+ /history:"%HUDSON_URL%" ^
+ /arguments:"/passive LAUNCHAPP=yes" ^
+ /changes:"Development build" ^
+ /info:"%APPCAST_INFO_URL%" ^
+ /mime:application/x-msi ^
+ /size:"%APPCAST_LOCAL_FILE%" ^
+ /track:development ^
+ /version:"%VERSION%" ^
+ /url:"%APPCAST_DOWNLOAD_URL%"
-CScript.exe //NoLogo appcaster.wsf /maxcount:25 /source:"%FEED_URL%" /path:index.xml /overwrite:false /application:"%JOB_NAME%" /author:"%JOB_NAME% Team" /description:"%JOB_NAME% software updates feed" /location:"%FEED_URL%" /history:"%HUDSON_URL%" /arguments:"/passive LAUNCHAPP=yes" /changes:"Development build" /info:"%INFO_URL%" /mime:application/x-msi /size:"%LOCAL_FILE%" /track:development /version:"%VERSION%" /url:"%DOWNLOAD_URL%"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Failed to generate appcasting feed && EXIT /B 1
@@ -3,27 +3,20 @@
:: License: GNU General Public License version 3 or later
@ECHO OFF
-SETLOCAL
+IF NOT DEFINED BUILD_CONFIG CALL "..\..\build_config.bat"
:: This script creates an MSI package for Windows Installer.
:: Dependency: WiX 3.5 http://wix.sf.net/
:: Note: heat/candle/light need to be accessible in the PATH.
:: Default location:
:: C:\Program Files (x86)\Windows Installer XML v3.5\bin
-:: Hudson sets its environment variables but defaults are provided for manual builds.
-:: TODO: This information should be centralized and automated. Perhaps using Ant or Maven2?
-SET VERSION_MAJOR=2
-SET VERSION_MINOR=6
-IF NOT DEFINED BUILD_NUMBER SET BUILD_NUMBER=0
-IF NOT DEFINED JOB_NAME SET JOB_NAME=Pandion
-SET PACKAGE=%JOB_NAME%_%VERSION_MAJOR%.%VERSION_MINOR%.%BUILD_NUMBER%.msi
-
ECHO Creating temporary copy...
:: The XCOPY command is deprecated since Vista and replaced by ROBOCOPY.
:: MKDIR "Temp"
:: XCOPY "../../Client" "./Temp" /E /EXCLUDE:filter.txt
ROBOCOPY "../../Client" "./Temp" /MIR /XF ".gitignore" "pandion.pdb" "pandiond.exe" "pandiond.pdb" /NFL /NDL /NJH
+IF ERRORLEVEL 8 ECHO Error: Cannot create temporary copy && EXIT /B 1
:: Inject the build number into the installed files.
ECHO Build number %BUILD_NUMBER%
@@ -32,14 +25,17 @@ ECHO %BUILD_NUMBER% > "./Temp/settings/build.txt"
:: Generate a list of files as a component group.
ECHO Harvesting components...
heat.exe dir "./Temp" -nologo -cg "CoreFiles" -dr "DESTINATION" -srd -template fragment -ke -gg -out "./components.wxs"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Failed to harvest components && EXIT /B 1
:: Transform the XML.
ECHO Compiling installer...
candle.exe -nologo -sw1077 "./product.wxs" "./components.wxs" "./WixUI_ZeroClick.wxs"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Failed to compile installer && EXIT /B 1
:: Create the MSI distributable.
ECHO Linking installer...
light.exe -nologo -b "./Temp" -ext "WixUIExtension" -ext "WixUtilExtension" -cultures:en-us -sice:ICE38 -sice:ICE64 -sice:ICE91 -out "./%PACKAGE%" "./product.wixobj" "./components.wixobj" "./WixUI_ZeroClick.wixobj"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Failed to link installer && EXIT /B 1
ECHO Cleaning up...
:: RMDIR /S /Q "./Temp"
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is part of Pandion instant messenger
- Copyright (c) 2009 Sebastiaan Deckers
+ Copyright (c) 2009-2010 Sebastiaan Deckers
License: GNU General Public License version 3 or later
-->
<Include>
@@ -10,7 +10,7 @@
-->
<?define AppHelpLink="http://pandion.im/support" ?>
<?define AppUrlInfoAbout="http://pandion.im/about" ?>
- <?define Manufacturer="Pandion Project" ?>
+ <?define Manufacturer="Pandion Team" ?>
<?define Name="Pandion" ?>
<!--
View
@@ -0,0 +1,28 @@
+:: This file is part of Pandion instant messenger
+:: Copyright (c) 2010 Sebastiaan Deckers
+:: License: GNU General Public License version 3 or later
+
+@ECHO OFF
+IF NOT DEFINED BUILD_CONFIG CALL "build_config.bat"
+
+:: Compile Host
+ECHO Compiling Host...
+CD ".\Host"
+CALL "build_host.bat"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Cannot compile Host && EXIT /B 1
+CD ..
+
+:: Build MSI package
+ECHO Building MSI package...
+CD ".\Installer\WiX"
+DEL "*.msi" /Q
+CALL "build_msi.bat"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Cannot build MSI package && EXIT /B 1
+CD "..\.."
+
+:: Generating appcasting feed
+ECHO Generate appcasting feed...
+CD ".\Installer\Appcaster"
+CALL "build_feed.bat"
+IF %ERRORLEVEL% NEQ 0 ECHO Error: Cannot generate appcasting feed && EXIT /B 1
+CD "..\.."
View
@@ -0,0 +1,25 @@
+:: This file is part of Pandion instant messenger
+:: Copyright (c) 2010 Sebastiaan Deckers
+:: License: GNU General Public License version 3 or later
+
+@ECHO OFF
+SET BUILD_CONFIG=1
+
+:: Versioning settings
+SET VERSION_MAJOR=2
+SET VERSION_MINOR=6
+
+:: Hudson sets its environment variables but defaults are provided for manual builds.
+IF NOT DEFINED BUILD_NUMBER SET BUILD_NUMBER=0
+IF NOT DEFINED HUDSON_URL SET HUDSON_URL=http://build.pandion.im/
+IF NOT DEFINED JOB_NAME SET JOB_NAME=Pandion
+
+:: WiX settings
+SET VERSION=%VERSION_MAJOR%.%VERSION_MINOR%.%BUILD_NUMBER%
+SET PACKAGE=%JOB_NAME%_%VERSION%.msi
+
+:: Appcast settings
+SET APPCAST_LOCAL_FILE=../WiX/%PACKAGE%
+SET APPCAST_DOWNLOAD_URL=http://downloads.sourceforge.net/project/pandion/builds/%PACKAGE%
+SET APPCAST_INFO_URL=%HUDSON_URL%job/%JOB_NAME%/%BUILD_NUMBER%/changes
+SET APPCAST_FEED_URL=http://feeds.feedburner.com/pandionupdates

0 comments on commit 3a32843

Please sign in to comment.