diff --git a/plugins/xpad/vsprops/postBuild.tmpl b/plugins/xpad/vsprops/postBuild.tmpl new file mode 100644 index 0000000000..e5581989b0 --- /dev/null +++ b/plugins/xpad/vsprops/postBuild.tmpl @@ -0,0 +1,24 @@ +@echo off +rem +rem Usage: postBuild.cmd SourcePath DestDir DestFile DestExt +rem +rem SourcePath - $(TargetPath) - Fully qualified path of the generated target file. +rem DestDir - $(SolutionDir) - Directory of the destination, usually the same as the solution. +rem DestFile - Base filename of the target/dest, without extension! +rem DestExt - Extension of the target/dest! + +set pcsxoutdir=%2\bin\plugins +set pcsxoutname=%pcsxoutdir%\%3%4 +set pcsxnewname=%pcsxoutdir%\%3-r$WCREV$$WCMODS?m:$%4 + +IF NOT EXIST %pcsxoutdir% ( + md %pcsxoutdir% +) + +copy /Y %1 %pcsxoutname% +copy /Y %1 %pcsxnewname% + +if ERRORLEVEL 0 ( + echo Target copied to %pcsxnewname% +) +exit 0 diff --git a/plugins/xpad/vsprops/postBuild.unknown b/plugins/xpad/vsprops/postBuild.unknown new file mode 100644 index 0000000000..360b05cad5 --- /dev/null +++ b/plugins/xpad/vsprops/postBuild.unknown @@ -0,0 +1,21 @@ +@echo off +rem +rem Usage: postBuild.cmd SourcePath DestDir DestFile DestExt +rem +rem SourcePath - $(TargetPath) - Fully qualified path of the generated target file. +rem DestDir - $(SolutionDir) - Directory of the destination, usually the same as the solution. +rem DestFile - Base filename of the target/dest, without extension! +rem DestExt - Extension of the target/dest! + +set pcsxoutdir=%2\bin\plugins +set pcsxoutname=%pcsxoutdir%%3%4 + +IF NOT EXIST %pcsxoutdir% ( + md %pcsxoutdir% +) + +copy /Y %1 %pcsxoutname% +if ERRORLEVEL 0 ( + echo Target copied to %pcsxoutname% +) +set ERRORLEVEL=0 diff --git a/plugins/xpad/vsprops/preBuild.cmd b/plugins/xpad/vsprops/preBuild.cmd new file mode 100644 index 0000000000..9047b6e29a --- /dev/null +++ b/plugins/xpad/vsprops/preBuild.cmd @@ -0,0 +1,20 @@ +@echo off + +rem Usage: preBuild.cmd ProjectSrcDir VspropsDir +rem +rem ProjectSrcDir - $(ProjectDir)\.. - Directory of project source code. +rem VspropsDir - $(PrjectDir)\vsprops - Directory of this script and its counterparts. + +SubWCRev.exe %1 %2\svnrev_template.h %1\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 %2\svnrev_unknown.h %1\svnrev.h + copy /Y %2\postBuild.unknown %2\postBuild.cmd +) else ( + SubWCRev.exe %1 %2\postBuild.tmpl %2\postBuild.cmd +) + +rem Always return an errorlevel of 0 -- this allows compilation to continue if SubWCRev failed. + +exit 0 diff --git a/plugins/xpad/vsprops/svnrev_template.h b/plugins/xpad/vsprops/svnrev_template.h new file mode 100644 index 0000000000..f2656ef1e8 --- /dev/null +++ b/plugins/xpad/vsprops/svnrev_template.h @@ -0,0 +1,18 @@ +// 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$ \ No newline at end of file diff --git a/plugins/xpad/vsprops/svnrev_unknown.h b/plugins/xpad/vsprops/svnrev_unknown.h new file mode 100644 index 0000000000..4872e23b20 --- /dev/null +++ b/plugins/xpad/vsprops/svnrev_unknown.h @@ -0,0 +1,23 @@ +// 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 "" \ No newline at end of file