diff --git a/common/include/PluginCallbacks.h b/common/include/PluginCallbacks.h index 45df9a2cfa..136e97359a 100644 --- a/common/include/PluginCallbacks.h +++ b/common/include/PluginCallbacks.h @@ -442,7 +442,7 @@ typedef struct _PS2E_VersionInfo // Revision typically refers a revision control system (such as SVN). When displayed // by the emulator it will have an 'r' prefixed before it. - s32 Revision; + s64 Revision; } PS2E_VersionInfo; diff --git a/common/vsprops/postBuild.tmpl b/common/vsprops/postBuild.tmpl deleted file mode 100644 index 051ee6fc9d..0000000000 --- a/common/vsprops/postBuild.tmpl +++ /dev/null @@ -1,50 +0,0 @@ -::@echo off -:: -:: Usage: postBuild.cmd SourcePath DestFile DestExt {plugins} -:: -:: SourcePath - $(TargetPath) - Fully qualified path of the generated target file. -:: DestFile - Base filename of the target/dest, without extension! -:: DestExt - Extension of the target/dest! -:: plugins - optional parameter used to generate plugins into the /plugins folder -:: -:: The destination file is determined by the PCSX2_TARGET_DIR environment var. - -SETLOCAL ENABLEEXTENSIONS -if defined PCSX2_TARGET_COPY CALL :TestAndCopy "%PCSX2_TARGET_COPY%" %1 %2 %3 %4 -ENDLOCAL -exit 0 - - -:TestAndCopy -:: Subroutine. First parameter is our Target Dir. Since it's a parameter into -:: the subroutine, we can use tilda expansion to handle quotes correctly. :) - -if NOT EXIST "%~1" ( - md "%~1" -) - -:: Error checking. Try to change to the dir. If it fails, it means the dir is -:: actually a file, and we should cancel the script. - -set mycwd="%CD%" -cd "%~1" -if %ERRORLEVEL% NEQ 0 goto :eof -cd %mycwd% - -set pcsxoutdir=%~1\%~5 -set pcsxoutname=%pcsxoutdir%\%~3%4 -set pcsxnewname=%pcsxoutdir%\%~3-r$WCREV$$WCMODS?m:$%4 - -IF NOT EXIST "%pcsxoutdir%" ( - md "%pcsxoutdir%" -) - -copy /Y "%~2" "%pcsxoutname%" -copy /Y "%~2" "%pcsxnewname%" -if %ERRORLEVEL% EQU 0 ( - echo Target copied to %pcsxnewname% -) - -goto :eof - -:quit diff --git a/common/vsprops/postBuild.unknown b/common/vsprops/postBuild.unknown index 2164f4a47c..4bdb3f2f0d 100644 --- a/common/vsprops/postBuild.unknown +++ b/common/vsprops/postBuild.unknown @@ -14,6 +14,7 @@ if defined PCSX2_TARGET_COPY CALL :TestAndCopy "%PCSX2_TARGET_COPY%" %1 %2 %3 %4 ENDLOCAL exit 0 +if exists postBuild.inc.cmd call postBuild.inc.cmd :TestAndCopy :: Subroutine. First parameter is our Target Dir. Since it's a parameter into diff --git a/common/vsprops/preBuild.cmd b/common/vsprops/preBuild.cmd index 5e3b21b928..dfb15b1648 100644 --- a/common/vsprops/preBuild.cmd +++ b/common/vsprops/preBuild.cmd @@ -1,5 +1,12 @@ -@echo off - +::@echo off +:: This file GENERATES the automatic GIT revision/version tag. +:: It uses the git.exe program to create an "svnrev.h" file for whichever +:: project is being compiled, during the project's pre-build step. +:: +:: The git.exe program is part of the msysgit installation. +:: +:: MsysGit can be downloaded from http://msysgit.github.io/ +:: :: Usage: preBuild.cmd ProjectSrcDir VspropsDir :: :: ProjectSrcDir - $(ProjectDir)\.. - Top-level Directory of project source code. @@ -7,16 +14,40 @@ SETLOCAL ENABLEEXTENSIONS set mydir=%~dp0 -SubWCRev.exe "%~1" "%mydir%\svnrev_template.h" "%CD%\svnrev.h" -if %ERRORLEVEL% NEQ 0 ( - echo Automatic revision update unavailable, using generic template instead. - echo You can safely ignore this message - see svnrev.h for details. - copy /Y "%mydir%\svnrev_unknown.h" "%CD%\svnrev.h" - copy /Y "%mydir%\postBuild.unknown" "%CD%\postBuild.cmd" -) else ( - SubWCRev.exe "%~1" "%mydir%\postBuild.tmpl" "%CD%\postBuild.cmd" > NUL + +IF "%PROGRAMFILES(x86)%" == "" do ( + set PROGRAMFILES(x86)=%PROGRAMFILES% ) +set PATH=%PATH%;"%PROGRAMFILES(x86)%\Git\bin" + +FOR /F "delims=+" %%i IN ('"git show -s --format=%%%ci HEAD"') do ( + set REV3=%%i +) + +set REV2=%REV3: =% +set REV1=%REV2:-=% +set REV=%REV1::=% + +if %ERRORLEVEL% NEQ 0 ( + echo Automatic version detection unavailable. + echo If you want to have the version string print correctly, + echo make sure your Git.exe is in the default installation directory, + echo or in your PATH. + echo You can safely ignore this message - a dummy string will be printed. + + echo #define SVN_REV_UNKNOWN > "%CD%\svnrev.h" + echo #define SVN_REV 0 >> "%CD%\svnrev.h" + echo #define SVN_MODS 0 >> "%CD%\svnrev.h" + echo set SVN_REV=0 > "%CD%\postBuild.inc.cmd" +) else ( + echo #define SVN_REV %REV% > "%CD%\svnrev.h" + echo #define SVN_MODS 0 /* Not implemented at the moment. */ >> "%CD%\svnrev.h" + echo set SVN_REV=%REV% > "%CD%\postBuild.inc.cmd" +) + +copy /Y "%mydir%\postBuild.unknown" "%CD%\postBuild.cmd" + ENDLOCAL :: Always return an errorlevel of 0 -- this allows compilation to continue if SubWCRev failed. -exit 0 +exit /B 0 diff --git a/common/vsprops/svnrev_template.h b/common/vsprops/svnrev_template.h deleted file mode 100644 index 9e0f785e08..0000000000 --- a/common/vsprops/svnrev_template.h +++ /dev/null @@ -1,33 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs -* Copyright (C) 2002-2010 PCSX2 Dev Team -* -* PCSX2 is free software: you can redistribute it and/or modify it under the terms -* of the GNU Lesser General Public License as published by the Free Software Found- -* ation, either version 3 of the License, or (at your option) any later version. -* -* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; -* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -* PURPOSE. See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License along with PCSX2. -* If not, see . -*/ - -// svnrev_template.h --> svnrev.h -// -// This file acts as a template for the automatic SVN revision/version tag. -// It is used by the utility SubWCrev.exe to create an "svnrev.h" file for -// whichever project is being compiled (as indicated by command line options -// passed to SubWCRev.exe during the project's pre-build step). -// -// The SubWCRev.exe utility is part of TortoiseSVN and requires several DLLs -// installed by TortoiseSVN, so it will only be available if you have TortoiseSVN -// installed on your system. If you do not have it installed, a generic template -// is used instead (see svnrev_generic.h). Having TortoiseSVN is handy but not -// necessary. If you do not have it installed, everything will still compile -// fine except without the SVN revision tagged to the application/dll version. -// -// TortoiseSVN can be downloaded from http://tortoisesvn.tigris.org - -#define SVN_REV $WCREV$ -#define SVN_MODS $WCMODS?1:0$ diff --git a/common/vsprops/svnrev_unknown.h b/common/vsprops/svnrev_unknown.h deleted file mode 100644 index 8f46ed4f8b..0000000000 --- a/common/vsprops/svnrev_unknown.h +++ /dev/null @@ -1,39 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs -* Copyright (C) 2002-2010 PCSX2 Dev Team -* -* PCSX2 is free software: you can redistribute it and/or modify it under the terms -* of the GNU Lesser General Public License as published by the Free Software Found- -* ation, either version 3 of the License, or (at your option) any later version. -* -* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; -* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -* PURPOSE. See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License along with PCSX2. -* If not, see . -*/ - -// svnrev_genric.h --> svnrev.h -// -// This file acts as a placebo for people who do not have TortoiseSVN installed. -// It provides "empty" revision information to the Pcsx2 Playground projects in -// the absence of real revisions derived from the repository being built. -// -// This file does not affect application/dll builds in any significant manner, -// other than the lack of automatic revision tags inserted into the app (which -// is very convenient but hardly necessary). -// -// See svn_template.h for more information on how the process of revision -// templating works. -// -// If you would like to enable automatic revisin tagging, TortoiseSVN can be -// downloaded from http://tortoisesvn.tigris.org - -#define SVN_REV_UNKNOWN - -// The following defines are included so that code will still compile even if it -// doesn't check for the SVN_REV_UNKNOWN define. - -#define SVN_REV 0 -#define SVN_MODS 0 - diff --git a/pcsx2/System.cpp b/pcsx2/System.cpp index 5985da0a35..d28ae6682d 100644 --- a/pcsx2/System.cpp +++ b/pcsx2/System.cpp @@ -194,13 +194,13 @@ void SysLogMachineCaps() { if ( !PCSX2_isReleaseVersion ) { - Console.WriteLn(Color_StrongGreen, "PCSX2 %u.%u.%u.r%d %s - compiled on " __DATE__, + Console.WriteLn(Color_StrongGreen, "PCSX2 %u.%u.%u-%lld %s - compiled on " __DATE__, PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV, SVN_MODS ? "(modded)" : "" ); } else { // shorter release version string - Console.WriteLn(Color_StrongGreen, "PCSX2 %u.%u.%u.r%d - compiled on " __DATE__, + Console.WriteLn(Color_StrongGreen, "PCSX2 %u.%u.%u-%lld - compiled on " __DATE__, PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV ); } diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index f32a4af20a..823d03794f 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -357,7 +357,7 @@ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) else { // beta / development editions, which feature revision number and compile date. - wintitle.Printf( _("%s %d.%d.%d.%d%s (svn) %s"), pxGetAppName().c_str(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, + wintitle.Printf( _("%s %d.%d.%d-%lld%s (git) %s"), pxGetAppName().c_str(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV, SVN_MODS ? L"m" : wxEmptyString, fromUTF8(__DATE__).c_str() ); } diff --git a/plugins/CDVDnull/CDVD.cpp b/plugins/CDVDnull/CDVD.cpp index 7da9318d59..27f41d4713 100644 --- a/plugins/CDVDnull/CDVD.cpp +++ b/plugins/CDVDnull/CDVD.cpp @@ -29,7 +29,7 @@ const unsigned char build = 6; EXPORT_C_(char*) PS2EgetLibName() { - snprintf( libraryName, 255, "CDVDnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "CDVDnull Driver %lld%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; } diff --git a/plugins/FWnull/FW.cpp b/plugins/FWnull/FW.cpp index 86bcc643d1..2e9eccaf5f 100644 --- a/plugins/FWnull/FW.cpp +++ b/plugins/FWnull/FW.cpp @@ -66,7 +66,7 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - snprintf( libraryName, 255, "FWnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "FWnull Driver %lld%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; } diff --git a/plugins/GSdx/GSUtil.cpp b/plugins/GSdx/GSUtil.cpp index 69aba2fba9..2210d0e0e4 100644 --- a/plugins/GSdx/GSUtil.cpp +++ b/plugins/GSdx/GSUtil.cpp @@ -42,7 +42,7 @@ const char* GSUtil::GetLibName() str = "GSdx"; #ifdef _WINDOWS - str += format(" %d", SVN_REV); + str += format(" %lld", SVN_REV); if(SVN_MODS) str += "m"; #endif diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 4e35c62dfc..3704bf6b2e 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -64,7 +64,7 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { #ifdef _MSC_VER - sprintf_s( libraryName, "GSnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + sprintf_s( libraryName, "GSnull Driver %lld%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; #else return "GSnull Driver"; diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 72bf53b5d6..c693ec9130 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -655,11 +655,11 @@ u32 CALLBACK PS2EgetLibVersion2(u32 type) { // Used in about and config screens. void GetNameAndVersionString(wchar_t *out) { #ifdef NO_CRT - wsprintfW(out, L"LilyPad %i.%i.%i", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); + wsprintfW(out, L"LilyPad %i.%i.%i", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF); #elif defined(PCSX2_DEBUG) - wsprintfW(out, L"LilyPad Debug %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); + wsprintfW(out, L"LilyPad Debug %i.%i.%i (%lld)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); #else - wsprintfW(out, L"LilyPad svn %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); + wsprintfW(out, L"LilyPad %i.%i.%i (%lld)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); #endif } @@ -668,11 +668,11 @@ char* CALLBACK PSEgetLibName() { return "LilyPad"; #elif defined(PCSX2_DEBUG) static char version[50]; - sprintf(version, "LilyPad Debug (r%i)", SVN_REV); + sprintf(version, "LilyPad Debug (%lld)", SVN_REV); return version; #else static char version[50]; - sprintf(version, "LilyPad svn (r%i)", SVN_REV); + sprintf(version, "LilyPad (%lld)", SVN_REV); return version; #endif } diff --git a/plugins/PadNull/Pad.cpp b/plugins/PadNull/Pad.cpp index 51313027f3..c725a93ad1 100644 --- a/plugins/PadNull/Pad.cpp +++ b/plugins/PadNull/Pad.cpp @@ -44,7 +44,7 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - snprintf( libraryName, 255, "Padnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "Padnull Driver %lld%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; } diff --git a/plugins/SSSPSXPAD/PadSSSPSX.cpp b/plugins/SSSPSXPAD/PadSSSPSX.cpp index 883791bcf6..c5c1f07cf2 100644 --- a/plugins/SSSPSXPAD/PadSSSPSX.cpp +++ b/plugins/SSSPSXPAD/PadSSSPSX.cpp @@ -710,7 +710,7 @@ static void InitLibraryName() // Use TortoiseSVN's SubWCRev utility's output // to label the specific revision: - sprintf_s( LibraryName, SSSPSX_NAME " r%d%s" + sprintf_s( LibraryName, SSSPSX_NAME " %lld%s" #ifdef PCSX2_DEBUG "-Debug" #elif defined( PCSX2_DEVBUILD ) @@ -718,8 +718,7 @@ static void InitLibraryName() #else "" #endif - ,SVN_REV, - SVN_MODS ? "m" : "" + ,SVN_REV,SVN_MODS ? "m" : "" ); #endif #endif diff --git a/plugins/USBnull/USB.cpp b/plugins/USBnull/USB.cpp index c6561dd990..58ea4d6960 100644 --- a/plugins/USBnull/USB.cpp +++ b/plugins/USBnull/USB.cpp @@ -60,7 +60,7 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - snprintf( libraryName, 255, "USBnull Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "USBnull Driver %lld%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; } diff --git a/plugins/USBqemu/USB.cpp b/plugins/USBqemu/USB.cpp index acfeed7333..1d39ce97a7 100644 --- a/plugins/USBqemu/USB.cpp +++ b/plugins/USBqemu/USB.cpp @@ -92,7 +92,7 @@ static void InitLibraryName() // Use TortoiseSVN's SubWCRev utility's output // to label the specific revision: - sprintf_s( libraryName, "USBqemu r%d%s" + sprintf_s( libraryName, "USBqemu %lld%s" #ifdef DEBUG_FAST "-Debug" #elif defined( PCSX2_DEBUG ) @@ -102,8 +102,7 @@ static void InitLibraryName() #else "" #endif - ,SVN_REV, - SVN_MODS ? "m" : "" + ,SVN_REV,SVN_MODS ? "m" : "" ); #endif #endif diff --git a/plugins/cdvdGigaherz/src/CDVD.cpp b/plugins/cdvdGigaherz/src/CDVD.cpp index dec3683052..f050568a71 100644 --- a/plugins/cdvdGigaherz/src/CDVD.cpp +++ b/plugins/cdvdGigaherz/src/CDVD.cpp @@ -36,7 +36,7 @@ char *LibName = "cdvdGigaherz " #ifdef PCSX2_DEBUG " Debug " #endif - "(r" SFY(SVN_REV) + "(" SFY(SVN_REV) #if SVN_MODS "/modded" #endif diff --git a/plugins/dev9null/DEV9.cpp b/plugins/dev9null/DEV9.cpp index b05f088ab8..c4865e5b40 100644 --- a/plugins/dev9null/DEV9.cpp +++ b/plugins/dev9null/DEV9.cpp @@ -77,7 +77,7 @@ EXPORT_C_(u32) PS2EgetLibType() EXPORT_C_(char*) PS2EgetLibName() { - snprintf( libraryName, 255, "DEV9null Driver r%d%s",SVN_REV, SVN_MODS ? "m" : ""); + snprintf( libraryName, 255, "DEV9null Driver %lld%s",SVN_REV, SVN_MODS ? "m" : ""); return libraryName; } diff --git a/plugins/spu2-x/src/PS2E-spu2.cpp b/plugins/spu2-x/src/PS2E-spu2.cpp index 5ad89df53e..93c7e5ad3f 100644 --- a/plugins/spu2-x/src/PS2E-spu2.cpp +++ b/plugins/spu2-x/src/PS2E-spu2.cpp @@ -87,7 +87,7 @@ static void InitLibraryName() // Use TortoiseSVN's SubWCRev utility's output // to label the specific revision: - snprintf( libraryName, 255, "SPU2-X r%d%s" + snprintf( libraryName, 255, "SPU2-X %lld%s" #ifdef DEBUG_FAST "-Debug" #elif defined( PCSX2_DEBUG ) @@ -97,8 +97,7 @@ static void InitLibraryName() #else "" #endif - ,SVN_REV, - SVN_MODS ? "m" : "" + ,SVN_REV, SVN_MODS ? "m" : "" ); #endif #endif diff --git a/plugins/spu2-x/src/Windows/AboutBox.cpp b/plugins/spu2-x/src/Windows/AboutBox.cpp index c60b96b2b3..05be226f91 100644 --- a/plugins/spu2-x/src/Windows/AboutBox.cpp +++ b/plugins/spu2-x/src/Windows/AboutBox.cpp @@ -32,7 +32,7 @@ static LRESULT WINAPI AboutProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar wchar_t outstr[256]; if( IsDevBuild ) - swprintf_s( outstr, L"Build r%d -- Compiled on " _T(__DATE__), SVN_REV ); + swprintf_s( outstr, L"Build %lld -- Compiled on " _T(__DATE__), SVN_REV ); else swprintf_s( outstr, L"Release v%d.%d -- Compiled on " _T(__DATE__), VersionInfo::Release, VersionInfo::Revision ); diff --git a/plugins/spu2-x/src/Windows/Spu2-X.rc b/plugins/spu2-x/src/Windows/Spu2-X.rc index bacaf44405..7f71225deb 100644 --- a/plugins/spu2-x/src/Windows/Spu2-X.rc +++ b/plugins/spu2-x/src/Windows/Spu2-X.rc @@ -296,7 +296,7 @@ BEGIN BEGIN VALUE "Comments", "SPU2 Plugin for PS2 Emulators" VALUE "CompanyName", "PCSX2 Dev Team" - VALUE "FileDescription", "SPU2-X Plugin (svn build)" + VALUE "FileDescription", "SPU2-X Plugin (git build)" VALUE "FileVersion", "2.0.SVN" VALUE "InternalName", "SPU2-X" VALUE "LegalCopyright", "Copyright (C) 2011" diff --git a/plugins/zerospu2/zerospu2.cpp b/plugins/zerospu2/zerospu2.cpp index 8fae19f53d..265bc1785f 100644 --- a/plugins/zerospu2/zerospu2.cpp +++ b/plugins/zerospu2/zerospu2.cpp @@ -134,14 +134,13 @@ static void InitLibraryName() // Use TortoiseSVN's SubWCRev utility's output // to label the specific revision: - sprintf_s( libraryName, "ZeroSPU2 r%d%s" + sprintf_s( libraryName, "ZeroSPU2 %lld%s" # ifdef PCSX2_DEBUG "-Debug" # elif defined( ZEROSPU2_DEVBUILD ) "-Dev" # endif - ,SVN_REV, - SVN_MODS ? "m" : "" + ,SVN_REV,SVN_MODS ? "m" : "" ); #endif #else