Fixed vs2010 SVNRevGen project. (Also changed "make_svnrev.h.vbs" to jscript and gave it some comments :p) Removed some old plugin stuff.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7030 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Jordan Woyak 2011-02-01 04:20:51 +00:00
parent 1b288dcdde
commit 53ae9e9e8f
6 changed files with 95 additions and 114 deletions

View File

@ -6,6 +6,17 @@
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="make_svnrev.h.js">
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cscript /nologo /E:JScript "make_svnrev.h.js"</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Updating svnrev.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">dummy</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Src\svnrev.h" />
<ClInclude Include="Src\svnrev_template.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{69F00340-5C3D-449F-9A80-958435C6CF06}</ProjectGuid>
<RootNamespace>SVNRevGen</RootNamespace>
@ -43,17 +54,14 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>cscript /nologo /E:VBScript "make_svnrev.h.vbs"</Command>
</PreBuildEvent>
<CustomBuild>
<Command>
</Command>
<Outputs>dummy</Outputs>
</PreBuildEvent>
<CustomBuild>
<Outputs>
</Outputs>
</CustomBuild>
</ItemDefinitionGroup>
<ItemGroup>
<CustomBuild Include="make_svnrev.h.vbs" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -21,35 +21,10 @@
// Make sure we pick up USER_DIR if set in config.h
#include "Common.h"
// Library suffix/prefix
#ifdef _WIN32
#define PLUGIN_PREFIX ""
#define PLUGIN_SUFFIX ".dll"
#elif defined __APPLE__
#define PLUGIN_PREFIX "lib"
#define PLUGIN_SUFFIX ".dylib"
#else
#define PLUGIN_PREFIX "lib"
#define PLUGIN_SUFFIX ".so"
#endif
// Directory seperators, do we need this?
#define DIR_SEP "/"
#define DIR_SEP_CHR '/'
// Location of the plugins
#ifdef _WIN32
#define PLUGINS_DIR "Plugins"
#elif defined __APPLE__
#define PLUGINS_DIR "Contents/PlugIns"
#else
#ifdef LIBS_DIR
#define PLUGINS_DIR LIBS_DIR
#else
#define PLUGINS_DIR "plugins"
#endif
#endif
// The user data dir
#define ROOT_DIR "."
#ifdef _WIN32
@ -131,11 +106,6 @@
#define RAM_DUMP "ram.raw"
#define ARAM_DUMP "aram.raw"
// Plugin files
#define DEFAULT_GFX_PLUGIN PLUGIN_PREFIX "Plugin_VideoOGL" PLUGIN_SUFFIX
#define DEFAULT_DSP_PLUGIN PLUGIN_PREFIX "Plugin_DSP_HLE" PLUGIN_SUFFIX
#define DEFAULT_WIIMOTE_PLUGIN PLUGIN_PREFIX "Plugin_Wiimote" PLUGIN_SUFFIX
// Sys files
#define TOTALDB "totaldb.dsy"

View File

@ -603,23 +603,6 @@ std::string GetBundleDirectory()
}
#endif
std::string GetPluginsDirectory()
{
std::string pluginsDir;
#if defined (__APPLE__)
pluginsDir = GetBundleDirectory();
pluginsDir += DIR_SEP;
pluginsDir += PLUGINS_DIR;
#else
pluginsDir = PLUGINS_DIR;
#endif
pluginsDir += DIR_SEP;
INFO_LOG(COMMON, "GetPluginsDirectory: Setting to %s:", pluginsDir.c_str());
return pluginsDir;
}
std::string GetSysDirectory()
{
std::string sysDir;

View File

@ -0,0 +1,79 @@
var wshShell = new ActiveXObject("WScript.Shell")
var oFS = new ActiveXObject("Scripting.FileSystemObject");
var outfile = "./Src/svnrev.h";
var svncmd = "SubWCRev ../../.. ./Src/svnrev_template.h " + outfile;
var svntestcmd = "SubWCRev ../../..";
var hgcmd = "hg svn info";
var SVN = 1, HG = 2;
var file_rev = 0, cur_rev = 0, cur_cms = 0;
function RunCmdGetMatch(cmd, regex)
{
// run the command
try
{
var cmdexec = wshShell.Exec(cmd);
}
catch (e)
{
// catch "the system cannot find the file specified" error
return 0;
}
// ReadLine is synchronous
while (!cmdexec.StdOut.AtEndOfStream)
{
var reg_exec = regex.exec(cmdexec.StdOut.ReadLine())
if (reg_exec)
return reg_exec[1]; // return first capture group
}
// failed
return 0;
}
if (oFS.FileExists(outfile))
{
// file exists, read the value of SVN_REV_STR
file_rev = oFS.OpenTextFile(outfile).ReadLine().match(/\d+/);
}
else
{
// file doesn't exist, create it
oFS.CreateTextFile(outfile);
}
// get the "Last commited at revision" from SubWCRev's output
cur_rev = RunCmdGetMatch(svntestcmd, /^Last .*?(\d+)/);
if (cur_rev)
cur_cms = SVN;
else
{
// SubWCRev failed, so use hg
cur_rev = RunCmdGetMatch(hgcmd, /Revision.*?(\d+)/);
if (cur_rev)
cur_cms = HG;
else
{
WScript.Echo("Neither SVN or Hg revision info found!");
WScript.Quit(1);
}
}
// check if svnrev.h needs updating
if (cur_rev == file_rev)
{
WScript.Echo("svnrev.h doesn't need updating (already at " + cur_rev + ")");
WScript.Quit(0);
}
else if (cur_cms == SVN)
{
// update using SubWCRev and template file
var ret = wshShell.run(svncmd, 0, true);
}
else
{
// manually create the file
oFS.CreateTextFile(outfile, true).WriteLine("#define SVN_REV_STR \"" + cur_rev + "\"");
}
WScript.Echo("svnrev.h updated (" + cur_rev + ")");

View File

@ -1,55 +0,0 @@
set wshShell = CreateObject("WScript.Shell")
outfile = "./Src/svnrev.h"
svncmd = "SubWCRev ../../.. ./Src/svnrev_template.h " & outfile
svntestcmd = "SubWCRev ../../.."
hgcmd = "hg svn info"
const svn = 0
const hg = 1
set oFS = CreateObject("Scripting.fileSystemObject")
if not oFS.FileExists(outfile) then
oFS.CreateTextFile(outfile)
file_rev = 0
else
set oFile = oFS.OpenTextFile(outfile)
set re = new regexp
re.pattern = "[0-9]+"
file_rev = re.execute(oFile.readline)(0)
end if
set testexec = wshShell.exec(svntestcmd)
do while testexec.status = 0 : wscript.sleep 100 : loop
if testexec.exitcode = 0 then
testout = testexec.stdout.readall
set re = new regexp
re.pattern = "Last committed at revision [0-9]+"
cur_rev = split(re.execute(testout)(0))(4)
cur_cms = svn
else
set hgexec = wshShell.exec(hgcmd)
do while hgexec.status = 0 : wscript.sleep 100 : loop
do while true
line = hgexec.stdout.readline
if instr(line, "Revision") then
cur_rev = split(line)(1)
cur_cms = hg
exit do
end if
if hgexec.stdout.atEndofStream then
wscript.echo "Neither SVN or Hg revision info found!"
wscript.quit 1
end if
loop
end if
if file_rev = cur_rev then
wscript.echo "svnrev.h doesn't need updating"
wscript.quit 0
elseif cur_cms = svn then
ret = wshShell.run(svncmd, 0, true)
elseif cur_cms = hg then
set oFile = CreateObject("Scripting.fileSystemObject").CreateTextFile(outfile, true)
oFile.writeline("#define SVN_REV_STR """ & cur_rev & """")
else
wscript.echo "WTF, shouldn't be here!"
end if

View File

@ -197,10 +197,6 @@ void SConfig::LoadSettings()
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
// Hard coded defaults
m_DefaultGFXPlugin = DEFAULT_GFX_PLUGIN;
m_DefaultDSPPlugin = DEFAULT_DSP_PLUGIN;
// General
{
ini.Get("General", "LastFilename", &m_LastFilename);
@ -319,7 +315,7 @@ void SConfig::LoadSettings()
// Plugins
// TODO: change key name, it's no longer a plugin
ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str());
ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, "");
}
m_SYSCONF = new SysConf();