Updated to work on Linux, redesigned core
This commit is contained in:
@ -1,34 +1,100 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace AMXXRelease
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Config.
|
||||
/// </summary>
|
||||
//Reads in config file info
|
||||
public class Config
|
||||
{
|
||||
private string m_SourceTree;
|
||||
private string m_OutputPath;
|
||||
private string m_DevenvPath;
|
||||
private string m_PathToCompress;
|
||||
private string m_ReleaseName;
|
||||
private string m_MakeOpts;
|
||||
|
||||
public Config()
|
||||
{
|
||||
}
|
||||
|
||||
public string GetSourceTree()
|
||||
{
|
||||
return "C:\\real\\code\\amxmodx";
|
||||
return m_SourceTree;
|
||||
}
|
||||
|
||||
public string OutputPath()
|
||||
{
|
||||
return "C:\\real\\done";
|
||||
return m_OutputPath;
|
||||
}
|
||||
|
||||
public string DevenvPath()
|
||||
{
|
||||
return "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\IDE\\devenv.com";
|
||||
return m_DevenvPath;
|
||||
}
|
||||
|
||||
public string PathToZip()
|
||||
public string CompressPath()
|
||||
{
|
||||
return "C:\\Windows\\zip.exe";
|
||||
return m_PathToCompress;
|
||||
}
|
||||
|
||||
public string GetReleaseName()
|
||||
{
|
||||
return m_ReleaseName;
|
||||
}
|
||||
|
||||
public string MakeOpts()
|
||||
{
|
||||
return m_MakeOpts;
|
||||
}
|
||||
|
||||
public bool ReadFromFile(string file)
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader sr = new StreamReader(file);
|
||||
|
||||
string line;
|
||||
string delim = "\t \n\r\v";
|
||||
string splt = "=";
|
||||
while ( (line = sr.ReadLine()) != null )
|
||||
{
|
||||
line = line.Trim(delim.ToCharArray());
|
||||
if (line.Length < 1 || line[0] == ';')
|
||||
continue;
|
||||
string [] s = line.Split(splt.ToCharArray());
|
||||
string key, val="";
|
||||
if (s.GetLength(0) >= 1)
|
||||
{
|
||||
key = s[0];
|
||||
if (s.GetLength(0) >= 2)
|
||||
{
|
||||
for(int i=1; i<s.GetLength(0); i++)
|
||||
val += s[i];
|
||||
}
|
||||
key = key.Trim(delim.ToCharArray());
|
||||
val = val.Trim(delim.ToCharArray());
|
||||
if (key.CompareTo("compress")==0)
|
||||
m_PathToCompress = val;
|
||||
if (key.CompareTo("devenv")==0)
|
||||
m_DevenvPath = val;
|
||||
if (key.CompareTo("output")==0)
|
||||
m_OutputPath = val;
|
||||
if (key.CompareTo("source")==0)
|
||||
m_SourceTree = val;
|
||||
if (key.CompareTo("release")==0)
|
||||
m_ReleaseName = val;
|
||||
if (key.CompareTo("makeopts")==0)
|
||||
m_MakeOpts = val;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch {
|
||||
Console.WriteLine("Unable to read file: " + file);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user