|
static void | Main (string[] args) |
|
Definition at line 6 of file make_config_h.cs.
◆ Main()
static void Program.Main |
( |
string [] |
args | ) |
|
|
inlinestatic |
Definition at line 35 of file make_config_h.cs.
References StartGitRevParse(), and VW.version().
40 string[] lines = File.ReadAllLines(
"..\\version.txt");
44 throw new Exception(
"version.txt first line should contain the version number.");
47 string version = lines[0].Trim();
49 string gitCommit = String.Empty;
53 gitCommit = p.StandardOutput.ReadToEnd().Trim();
59 string config =
"#define PACKAGE_VERSION \"" + version +
"\"\n" 60 +
"#define COMMIT_VERSION \"" + gitCommit +
"\"\n";
62 if (!File.Exists(
"config.h") ||
63 string.CompareOrdinal(File.ReadAllText(
"config.h"), config) != 0)
65 File.WriteAllText(
"config.h", config);
70 Console.Error.WriteLine(e.ToString());
const version_struct version(PACKAGE_VERSION)
static Process StartGitRevParse()
◆ StartGitRevParse()
static Process Program.StartGitRevParse |
( |
| ) |
|
|
inlinestaticprivate |
Definition at line 10 of file make_config_h.cs.
Referenced by Main().
12 Process gitProcess =
new Process();
16 gitProcess.StartInfo.FileName =
"git";
17 gitProcess.StartInfo.Arguments =
"rev-parse --short HEAD";
18 gitProcess.StartInfo.WorkingDirectory = Path.GetDirectoryName(
VersionFilePath);
19 gitProcess.StartInfo.UseShellExecute =
false;
20 gitProcess.StartInfo.CreateNoWindow =
true;
22 gitProcess.StartInfo.RedirectStandardOutput =
true;
27 catch (Win32Exception)
const string VersionFilePath
◆ VersionFilePath
const string Program.VersionFilePath = @"..\version.txt" |
|
private |
The documentation for this class was generated from the following file: