Tooth/src/Build.vala.in

42 lines
1.2 KiB
Vala

public class Build {
public const string NAME = "@NAME@";
public const string VERSION = "@VERSION@";
public const string DOMAIN = "@EXEC_NAME@";
public const string RESOURCES = "@RESOURCES@";
public const string WEBSITE = "@WEBSITE@";
public const string SUPPORT_WEBSITE = "@SUPPORT_WEBSITE@";
public const string COPYRIGHT = "@COPYRIGHT@";
public const string PREFIX = "@PREFIX@";
public const string PROFILE = "@PROFILE@";
public static string SYSTEM_INFO;
// Please do not remove the credits below. You may add your own, but keep the existing ones intact.
// TRANSLATORS: Replace this with your name. It will be displayed in the About dialog.
public const string TRANSLATOR = _(" ");
public static string print_info () {
var os_name = get_os_info ("NAME");
var os_ver = get_os_info ("VERSION");
SYSTEM_INFO = @"$NAME $VERSION";
SYSTEM_INFO += @"\nRunning on: $os_name $os_ver";
SYSTEM_INFO += @"\nBuild prefix: \"$PREFIX\"";
SYSTEM_INFO += @"\nBuild profile: \"$PROFILE\"";
var lines = SYSTEM_INFO.split ("\n");
foreach (unowned string line in lines) {
message (line);
}
return SYSTEM_INFO;
}
static string get_os_info (string key) {
return GLib.Environment.get_os_info (key) ?? "Unknown";
}
}