Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- 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 3a32843
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 28 deletions.
4 changes: 2 additions & 2 deletions Host/Source/Pandion.rc
Expand Up @@ -53,10 +53,10 @@ BEGIN
BEGIN BEGIN
BLOCK "040904e3" BLOCK "040904e3"
BEGIN BEGIN
VALUE "Comments", "http://www.pandion.be" VALUE "Comments", "http://pandion.im/"
VALUE "CompanyName", "Pandion" VALUE "CompanyName", "Pandion"
VALUE "FileDescription", "Pandion Instant Messenger" 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) #if defined(MAJOR_VERSION) && defined(MINOR_VERSION) && defined(BUILD_NUMBER)
VALUE "FileVersion", "" VALUE "FileVersion", ""
VALUE "ProductVersion", "" VALUE "ProductVersion", ""
Expand Down
17 changes: 17 additions & 0 deletions Host/build_host.bat
@@ -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
36 changes: 21 additions & 15 deletions Installer/Appcaster/build_feed.bat
Expand Up @@ -3,20 +3,26 @@
:: License: GNU General Public License version 3 or later :: License: GNU General Public License version 3 or later


@ECHO OFF @ECHO OFF
SETLOCAL IF NOT DEFINED BUILD_CONFIG CALL "..\..\build_config.bat"


:: Hudson sets its environment variables but defaults are provided for manual builds. CScript.exe appcaster.wsf ^
:: TODO: This information should be centralized and automated. Perhaps using Ant or Maven2? //NoLogo ^
SET VERSION_MAJOR=2 /maxcount:3 ^
SET VERSION_MINOR=6 /source:"%APPCAST_FEED_URL%" ^
IF NOT DEFINED BUILD_NUMBER SET BUILD_NUMBER=0 /path:index.xml ^
IF NOT DEFINED HUDSON_URL SET HUDSON_URL=http://build.pandion.im/ /overwrite:false ^
IF NOT DEFINED JOB_NAME SET JOB_NAME=Pandion /application:"%JOB_NAME%" ^
SET VERSION=%VERSION_MAJOR%.%VERSION_MINOR%.%BUILD_NUMBER% /author:"%JOB_NAME% Team" ^
SET PACKAGE=%JOB_NAME%_%VERSION%.msi /description:"%JOB_NAME% software updates feed" ^
SET LOCAL_FILE=../WiX/%PACKAGE% /location:"%APPCAST_FEED_URL%" ^
SET DOWNLOAD_URL=http://downloads.sourceforge.net/project/pandion/builds/%PACKAGE% /history:"%HUDSON_URL%" ^
SET INFO_URL=%HUDSON_URL%job/%JOB_NAME%/%BUILD_NUMBER%/changes /arguments:"/passive LAUNCHAPP=yes" ^
SET FEED_URL=http://feeds.feedburner.com/pandionupdates /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
14 changes: 5 additions & 9 deletions Installer/WiX/build_msi.bat
Expand Up @@ -3,27 +3,20 @@
:: License: GNU General Public License version 3 or later :: License: GNU General Public License version 3 or later


@ECHO OFF @ECHO OFF
SETLOCAL IF NOT DEFINED BUILD_CONFIG CALL "..\..\build_config.bat"


:: This script creates an MSI package for Windows Installer. :: This script creates an MSI package for Windows Installer.
:: Dependency: WiX 3.5 http://wix.sf.net/ :: Dependency: WiX 3.5 http://wix.sf.net/
:: Note: heat/candle/light need to be accessible in the PATH. :: Note: heat/candle/light need to be accessible in the PATH.
:: Default location: :: Default location:
:: C:\Program Files (x86)\Windows Installer XML v3.5\bin :: 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... ECHO Creating temporary copy...
:: The XCOPY command is deprecated since Vista and replaced by ROBOCOPY. :: The XCOPY command is deprecated since Vista and replaced by ROBOCOPY.
:: MKDIR "Temp" :: MKDIR "Temp"
:: XCOPY "../../Client" "./Temp" /E /EXCLUDE:filter.txt :: XCOPY "../../Client" "./Temp" /E /EXCLUDE:filter.txt
ROBOCOPY "../../Client" "./Temp" /MIR /XF ".gitignore" "pandion.pdb" "pandiond.exe" "pandiond.pdb" /NFL /NDL /NJH 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. :: Inject the build number into the installed files.
ECHO Build number %BUILD_NUMBER% ECHO Build number %BUILD_NUMBER%
Expand All @@ -32,14 +25,17 @@ ECHO %BUILD_NUMBER% > "./Temp/settings/build.txt"
:: Generate a list of files as a component group. :: Generate a list of files as a component group.
ECHO Harvesting components... ECHO Harvesting components...
heat.exe dir "./Temp" -nologo -cg "CoreFiles" -dr "DESTINATION" -srd -template fragment -ke -gg -out "./components.wxs" 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. :: Transform the XML.
ECHO Compiling installer... ECHO Compiling installer...
candle.exe -nologo -sw1077 "./product.wxs" "./components.wxs" "./WixUI_ZeroClick.wxs" 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. :: Create the MSI distributable.
ECHO Linking installer... 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" 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... ECHO Cleaning up...
:: RMDIR /S /Q "./Temp" :: RMDIR /S /Q "./Temp"
Expand Down
4 changes: 2 additions & 2 deletions Installer/WiX/version.wxs
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
This file is part of Pandion instant messenger 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 License: GNU General Public License version 3 or later
--> -->
<Include> <Include>
Expand All @@ -10,7 +10,7 @@
--> -->
<?define AppHelpLink="http://pandion.im/support" ?> <?define AppHelpLink="http://pandion.im/support" ?>
<?define AppUrlInfoAbout="http://pandion.im/about" ?> <?define AppUrlInfoAbout="http://pandion.im/about" ?>
<?define Manufacturer="Pandion Project" ?> <?define Manufacturer="Pandion Team" ?>
<?define Name="Pandion" ?> <?define Name="Pandion" ?>


<!-- <!--
Expand Down
28 changes: 28 additions & 0 deletions build_all.bat
@@ -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 "..\.."
25 changes: 25 additions & 0 deletions build_config.bat
@@ -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.