Move generated part of Program.cs to its own file

This way editors/tools will understand that it's a c sharp file
This commit is contained in:
Andrew Noyes 2022-02-03 15:54:33 -08:00 committed by Jingyu Zhou
parent 6dc5921575
commit 00ceaeb1b3
3 changed files with 20 additions and 14 deletions

View File

@ -1,5 +1,6 @@
set(SRCS
${CMAKE_CURRENT_BINARY_DIR}/Program.cs
${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.cs
${CMAKE_CURRENT_SOURCE_DIR}/Program.cs
Properties/AssemblyInfo.cs)
set(TEST_HARNESS_REFERENCES
@ -7,7 +8,7 @@ set(TEST_HARNESS_REFERENCES
set(out_file ${CMAKE_BINARY_DIR}/packages/bin/TestHarness.exe)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Program.cs.cmake ${CMAKE_CURRENT_BINARY_DIR}/Program.cs)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/VersionInfo.cs.cmake ${CMAKE_CURRENT_BINARY_DIR}/VersionInfo.cs)
add_custom_command(OUTPUT ${out_file}
COMMAND ${MCS_EXECUTABLE} ARGS ${TEST_HARNESS_REFERENCES} ${SRCS} "-target:exe" "-out:${out_file}"

View File

@ -160,7 +160,7 @@ namespace SummarizeTest
}
else if (args[0] == "version")
{
return VersionInfo();
return VersionInfo.Show();
}
return UsageMessage();
@ -1633,16 +1633,6 @@ namespace SummarizeTest
}
}
private static int VersionInfo()
{
Console.WriteLine("Version: 1.02");
Console.WriteLine("FDB Project Ver: " + "${FDB_VERSION}");
Console.WriteLine("FDB Version: " + "${FDB_VERSION_MAJOR}" + "." + "${FDB_VERSION_MINOR}");
Console.WriteLine("Source Version: " + "${CURRENT_GIT_VERSION}");
return 1;
}
private static int UsageMessage()
{
Console.WriteLine("Usage:");
@ -1653,7 +1643,7 @@ namespace SummarizeTest
Console.WriteLine(" TestHarness remote [queue folder] [root foundation folder] [duration in hours] [amount of tests] [all/fast/<test_path>] [scope]");
Console.WriteLine(" TestHarness extract-errors [summary-file] [error-summary-file]");
Console.WriteLine(" TestHarness joshua-run <useValgrind> <maxTries>");
VersionInfo();
VersionInfo.Show();
return 1;
}
}

View File

@ -0,0 +1,15 @@
using System;
namespace SummarizeTest {
static class VersionInfo {
public static int Show()
{
Console.WriteLine("Version: 1.02");
Console.WriteLine("FDB Project Ver: " + "${FDB_VERSION}");
Console.WriteLine("FDB Version: " + "${FDB_VERSION_MAJOR}" + "." + "${FDB_VERSION_MINOR}");
Console.WriteLine("Source Version: " + "${CURRENT_GIT_VERSION}");
return 1;
}
}
}