Create a config.vapi for config.h
Currently, a lot of our build variables that are defined at configuration time, are spread out across the code base, often declared as `extern` which can break when moving around sections of the code across files. This commit introduces a "Config" namespace which basically maps to the definitions in `config.h`, but allows us to properly access them too from the Vala source code. By doing so, it helps us to more explicitly see where we rely on a build variable from this file (which should be obvious from the `Config' namespace). To make it ourselves a bit easier in Meson too, we can declare an internal dependency, which helps ensure that we pull in the dependency where needed.
This commit is contained in:
parent
dc14aa091c
commit
6ce2373a75
39 changed files with 126 additions and 131 deletions
26
bindings/vapi/config.vapi
Normal file
26
bindings/vapi/config.vapi
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* This VAPI describes the contents of the config.h file, which is
|
||||
* autogenerated by the build system. It contains the values for the specific
|
||||
* build configuration.
|
||||
*/
|
||||
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
|
||||
namespace Config
|
||||
{
|
||||
// Keep this list in sync with the config.h configuration_data() in meson
|
||||
public const string GETTEXT_PACKAGE;
|
||||
public const string G_LOG_DOMAIN;
|
||||
public const string APP_ID;
|
||||
public const string BUILD_ROOT_DIR;
|
||||
public const string GSETTINGS_DIR;
|
||||
public const string INSTALL_PREFIX;
|
||||
public const string ISO_CODE_3166_XML;
|
||||
public const string ISO_CODE_639_XML;
|
||||
public const string LANGUAGE_SUPPORT_DIRECTORY;
|
||||
public const string NAME_SUFFIX;
|
||||
public const string PLUGINS_DIR;
|
||||
public const string PROFILE;
|
||||
public const string REVNO;
|
||||
public const string SOURCE_ROOT_DIR;
|
||||
public const string VERSION;
|
||||
public const string WEB_EXTENSIONS_DIR;
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ internal class Accounts.EditorListPane : Gtk.Grid, EditorPane, CommandPane {
|
|||
|
||||
public EditorListPane(Editor editor) {
|
||||
this.editor = editor;
|
||||
this.welcome_icon.icon_name = Application.Client.APP_ID;
|
||||
this.welcome_icon.icon_name = Config.APP_ID;
|
||||
|
||||
// keep our own copy of this so we can disconnect from its signals
|
||||
// without worrying about the editor's lifecycle
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class Accounts.Editor : Gtk.Dialog {
|
|||
public Editor(Application.Client application, Gtk.Window parent) {
|
||||
this.application = application;
|
||||
this.transient_for = parent;
|
||||
this.icon_name = Application.Client.APP_ID;
|
||||
this.icon_name = Config.APP_ID;
|
||||
|
||||
this.accounts = application.controller.account_manager;
|
||||
this.certificates = application.controller.certificate_manager;
|
||||
|
|
|
|||
|
|
@ -6,28 +6,13 @@
|
|||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
// Defined by CMake build script.
|
||||
extern const string GETTEXT_PACKAGE;
|
||||
public extern const string _APP_ID;
|
||||
public extern const string _BUILD_ROOT_DIR;
|
||||
public extern const string _GSETTINGS_DIR;
|
||||
public extern const string _INSTALL_PREFIX;
|
||||
public extern const string _NAME_SUFFIX;
|
||||
extern const string _PLUGINS_DIR;
|
||||
extern const string _PROFILE;
|
||||
extern const string _REVNO;
|
||||
public extern const string _SOURCE_ROOT_DIR;
|
||||
public extern const string _VERSION;
|
||||
extern const string _WEB_EXTENSIONS_DIR;
|
||||
|
||||
|
||||
/**
|
||||
* The client application's main point of entry and desktop integration.
|
||||
*/
|
||||
public class Application.Client : Gtk.Application {
|
||||
|
||||
public const string NAME = "Geary" + _NAME_SUFFIX;
|
||||
public const string APP_ID = _APP_ID;
|
||||
public const string NAME = "Geary" + Config.NAME_SUFFIX;
|
||||
public const string RESOURCE_BASE_PATH = "/org/gnome/Geary";
|
||||
public const string SCHEMA_ID = "org.gnome.Geary";
|
||||
public const string DESCRIPTION = _("Send and receive email");
|
||||
|
|
@ -37,12 +22,6 @@ public class Application.Client : Gtk.Application {
|
|||
public const string WEBSITE_LABEL = _("Visit the Geary web site");
|
||||
public const string BUGREPORT = "https://wiki.gnome.org/Apps/Geary/ReportingABug";
|
||||
|
||||
public const string VERSION = _VERSION;
|
||||
public const string INSTALL_PREFIX = _INSTALL_PREFIX;
|
||||
public const string GSETTINGS_DIR = _GSETTINGS_DIR;
|
||||
public const string SOURCE_ROOT_DIR = _SOURCE_ROOT_DIR;
|
||||
public const string BUILD_ROOT_DIR = _BUILD_ROOT_DIR;
|
||||
|
||||
// keep these in sync with meson_options.txt
|
||||
public const string PROFILE_RELEASE = "release";
|
||||
public const string PROFILE_BETA = "beta";
|
||||
|
|
@ -240,7 +219,7 @@ public class Application.Client : Gtk.Application {
|
|||
|
||||
/** Returns the compile-time configured installation directory. */
|
||||
internal GLib.File install_prefix {
|
||||
get; private set; default = GLib.File.new_for_path(INSTALL_PREFIX);
|
||||
get; private set; default = GLib.File.new_for_path(Config.INSTALL_PREFIX);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -264,9 +243,9 @@ public class Application.Client : Gtk.Application {
|
|||
new Gee.LinkedList<RuntimeDetail?>();
|
||||
|
||||
/// Application runtime information label
|
||||
info.add({ _("Geary version"), VERSION });
|
||||
info.add({ _("Geary version"), Config.VERSION });
|
||||
/// Application runtime information label
|
||||
info.add({ _("Geary revision"), _REVNO });
|
||||
info.add({ _("Geary revision"), Config.REVNO });
|
||||
/// Application runtime information label
|
||||
info.add({ _("GTK version"),
|
||||
"%u.%u.%u".printf(
|
||||
|
|
@ -307,7 +286,7 @@ public class Application.Client : Gtk.Application {
|
|||
});
|
||||
|
||||
/// Application runtime information label
|
||||
info.add({ _("Installation prefix"), INSTALL_PREFIX });
|
||||
info.add({ _("Installation prefix"), Config.INSTALL_PREFIX });
|
||||
|
||||
return info;
|
||||
}
|
||||
|
|
@ -315,7 +294,7 @@ public class Application.Client : Gtk.Application {
|
|||
|
||||
public Client() {
|
||||
Object(
|
||||
application_id: APP_ID,
|
||||
application_id: Config.APP_ID,
|
||||
resource_base_path: RESOURCE_BASE_PATH,
|
||||
flags: (
|
||||
GLib.ApplicationFlags.HANDLES_OPEN |
|
||||
|
|
@ -350,7 +329,7 @@ public class Application.Client : Gtk.Application {
|
|||
}
|
||||
if (options.contains(OPTION_VERSION)) {
|
||||
GLib.stdout.printf(
|
||||
"%s: %s\n", this.binary, Client.VERSION
|
||||
"%s: %s\n", this.binary, Config.VERSION
|
||||
);
|
||||
ret = 0;
|
||||
}
|
||||
|
|
@ -359,11 +338,11 @@ public class Application.Client : Gtk.Application {
|
|||
|
||||
public override void startup() {
|
||||
Environment.set_application_name(NAME);
|
||||
Environment.set_prgname(APP_ID);
|
||||
Util.I18n.init(GETTEXT_PACKAGE, this.binary);
|
||||
Environment.set_prgname(Config.APP_ID);
|
||||
Util.I18n.init(Config.GETTEXT_PACKAGE, this.binary);
|
||||
Util.Date.init();
|
||||
|
||||
Configuration.init(this.is_installed, GSETTINGS_DIR);
|
||||
Configuration.init(this.is_installed, Config.GSETTINGS_DIR);
|
||||
|
||||
// Add application's actions before chaining up so they are
|
||||
// present when the application is first registered on the
|
||||
|
|
@ -381,7 +360,7 @@ public class Application.Client : Gtk.Application {
|
|||
this.autostart = new StartupManager(this);
|
||||
|
||||
// Ensure all geary windows have an icon
|
||||
Gtk.Window.set_default_icon_name(APP_ID);
|
||||
Gtk.Window.set_default_icon_name(Config.APP_ID);
|
||||
|
||||
// Application accels
|
||||
add_app_accelerators(Action.Application.COMPOSE, { "<Ctrl>N" });
|
||||
|
|
@ -562,8 +541,8 @@ public class Application.Client : Gtk.Application {
|
|||
"authors", AUTHORS,
|
||||
"copyright", string.join("\n", COPYRIGHT_1, COPYRIGHT_2),
|
||||
"license-type", Gtk.License.LGPL_2_1,
|
||||
"logo-icon-name", APP_ID,
|
||||
"version", _REVNO == "" ? VERSION : "%s (%s)".printf(VERSION, _REVNO),
|
||||
"logo-icon-name", Config.APP_ID,
|
||||
"version", Config.REVNO == "" ? Config.VERSION : "%s (%s)".printf(Config.VERSION, Config.REVNO),
|
||||
"website", WEBSITE,
|
||||
"website-label", WEBSITE_LABEL,
|
||||
"title", _("About %s").printf(NAME),
|
||||
|
|
@ -794,14 +773,14 @@ public class Application.Client : Gtk.Application {
|
|||
public GLib.File get_resource_directory() {
|
||||
return (is_installed)
|
||||
? this.install_prefix.get_child("share").get_child("geary")
|
||||
: GLib.File.new_for_path(SOURCE_ROOT_DIR);
|
||||
: GLib.File.new_for_path(Config.SOURCE_ROOT_DIR);
|
||||
}
|
||||
|
||||
/** Returns the location of the application's desktop files. */
|
||||
public GLib.File get_desktop_directory() {
|
||||
return (is_installed)
|
||||
? this.install_prefix.get_child("share").get_child("applications")
|
||||
: GLib.File.new_for_path(BUILD_ROOT_DIR).get_child("desktop");
|
||||
: GLib.File.new_for_path(Config.BUILD_ROOT_DIR).get_child("desktop");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -813,8 +792,8 @@ public class Application.Client : Gtk.Application {
|
|||
*/
|
||||
public GLib.File get_web_extensions_dir() {
|
||||
return (is_installed)
|
||||
? GLib.File.new_for_path(_WEB_EXTENSIONS_DIR)
|
||||
: GLib.File.new_for_path(BUILD_ROOT_DIR).get_child("src");
|
||||
? GLib.File.new_for_path(Config.WEB_EXTENSIONS_DIR)
|
||||
: GLib.File.new_for_path(Config.BUILD_ROOT_DIR).get_child("src");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -826,8 +805,8 @@ public class Application.Client : Gtk.Application {
|
|||
*/
|
||||
public GLib.File get_app_plugins_dir() {
|
||||
return (is_installed)
|
||||
? GLib.File.new_for_path(_PLUGINS_DIR)
|
||||
: GLib.File.new_for_path(BUILD_ROOT_DIR)
|
||||
? GLib.File.new_for_path(Config.PLUGINS_DIR)
|
||||
: GLib.File.new_for_path(Config.BUILD_ROOT_DIR)
|
||||
.get_child("src").get_child("client").get_child("plugin");
|
||||
}
|
||||
|
||||
|
|
@ -909,7 +888,7 @@ public class Application.Client : Gtk.Application {
|
|||
GLib.Notification error = new GLib.Notification(summary);
|
||||
error.set_body(body);
|
||||
error.set_icon(
|
||||
new GLib.ThemedIcon("%s-symbolic".printf(Client.APP_ID))
|
||||
new GLib.ThemedIcon("%s-symbolic".printf(Config.APP_ID))
|
||||
);
|
||||
send_notification(ERROR_NOTIFICATION_ID, error);
|
||||
this.error_notification = error;
|
||||
|
|
@ -966,9 +945,9 @@ public class Application.Client : Gtk.Application {
|
|||
message(
|
||||
"%s %s%s prefix=%s exec_dir=%s is_installed=%s",
|
||||
NAME,
|
||||
VERSION,
|
||||
_REVNO != "" ? " (%s)".printf(_REVNO) : "",
|
||||
INSTALL_PREFIX,
|
||||
Config.VERSION,
|
||||
Config.REVNO != "" ? " (%s)".printf(Config.REVNO) : "",
|
||||
Config.INSTALL_PREFIX,
|
||||
exec_dir.get_path(),
|
||||
this.is_installed.to_string()
|
||||
);
|
||||
|
|
@ -1159,9 +1138,9 @@ public class Application.Client : Gtk.Application {
|
|||
// separate directories since they have different app ids, and
|
||||
// hence don't need the suffix.
|
||||
return (
|
||||
_PROFILE == PROFILE_RELEASE || this.is_flatpak_sandboxed
|
||||
Config.PROFILE == PROFILE_RELEASE || this.is_flatpak_sandboxed
|
||||
? "geary"
|
||||
: "geary-" + _PROFILE
|
||||
: "geary-" + Config.PROFILE
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1227,7 +1206,7 @@ public class Application.Client : Gtk.Application {
|
|||
File exec_dir = this.exec_dir;
|
||||
string[] argv = new string[3];
|
||||
argv[0] = "yelp";
|
||||
argv[1] = Client.SOURCE_ROOT_DIR + "/help/C/";
|
||||
argv[1] = Config.SOURCE_ROOT_DIR + "/help/C/";
|
||||
argv[2] = null;
|
||||
if (!Process.spawn_async(
|
||||
exec_dir.get_path(),
|
||||
|
|
|
|||
|
|
@ -576,7 +576,7 @@ public class Application.MainWindow :
|
|||
load_config(application.config);
|
||||
restore_saved_window_state();
|
||||
|
||||
if (_PROFILE != Client.PROFILE_RELEASE) {
|
||||
if (Config.PROFILE != Client.PROFILE_RELEASE) {
|
||||
this.get_style_context().add_class("devel");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class Application.StartupManager : GLib.Object {
|
|||
options.insert("autostart", new GLib.Variant(
|
||||
"b", autostart));
|
||||
options.insert("commandline", new GLib.Variant.strv(cmdline));
|
||||
var handle = background.request_background(_APP_ID, options);
|
||||
var handle = background.request_background(Config.APP_ID, options);
|
||||
yield bus.get_proxy<portal.Request>(BUS_NAME, handle);
|
||||
} catch (GLib.Error error) {
|
||||
warning("Failed to request to run in background: %s", error.message);
|
||||
|
|
|
|||
|
|
@ -1318,7 +1318,7 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
// User-Agent
|
||||
email.mailer = Environment.get_prgname() + "/" + Application.Client.VERSION;
|
||||
email.mailer = Environment.get_prgname() + "/" + Config.VERSION;
|
||||
|
||||
return email;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ client_vala_sources = files(
|
|||
)
|
||||
|
||||
client_dependencies = [
|
||||
config_dep,
|
||||
enchant,
|
||||
folks,
|
||||
gck,
|
||||
|
|
@ -199,7 +200,6 @@ client_lib = shared_library(
|
|||
client_package,
|
||||
client_vala_sources + geary_resources,
|
||||
dependencies: client_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: client_vala_args,
|
||||
c_args: geary_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class Plugin.DesktopNotifications :
|
|||
}
|
||||
|
||||
private void notify_general(Folder folder, int total, int added) {
|
||||
GLib.Icon icon = new GLib.ThemedIcon("%s-symbolic".printf(global::Application.Client.APP_ID));
|
||||
GLib.Icon icon = new GLib.ThemedIcon("%s-symbolic".printf(Config.APP_ID));
|
||||
string title = to_notitication_title(folder.account, total);
|
||||
string body = ngettext(
|
||||
/// Notification body when multiple messages have been
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ shared_module(
|
|||
plugin_name,
|
||||
sources: plugin_src,
|
||||
dependencies: plugin_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ shared_module(
|
|||
plugin_name,
|
||||
sources: plugin_src,
|
||||
dependencies: plugin_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ shared_module(
|
|||
plugin_name,
|
||||
sources: plugin_src,
|
||||
dependencies: plugin_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ lib = static_library(
|
|||
'util',
|
||||
sources: lib_src,
|
||||
dependencies: plugin_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: false
|
||||
|
|
@ -34,7 +33,6 @@ plugin = shared_module(
|
|||
sources: plugin_src,
|
||||
dependencies: plugin_dependencies,
|
||||
link_with: lib,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
@ -56,7 +54,6 @@ plugin_test = executable(
|
|||
test_src,
|
||||
dependencies: plugin_dependencies + [ vala_unit_dep ],
|
||||
link_with: lib,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: false
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#
|
||||
|
||||
plugin_dependencies = [
|
||||
config_dep,
|
||||
folks,
|
||||
gdk,
|
||||
client_dep,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ if libmessagingmenu_dep.found()
|
|||
'unity-' + plugin_name,
|
||||
sources: plugin_src,
|
||||
dependencies: messaging_menu_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ shared_module(
|
|||
plugin_name,
|
||||
sources: plugin_src,
|
||||
dependencies: plugin_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class Plugin.NotificationBadge :
|
|||
this.entry = new UnityLauncherEntry(
|
||||
connection,
|
||||
path + "/plugin/notificationbadge",
|
||||
global::Application.Client.APP_ID + ".desktop"
|
||||
Config.APP_ID + ".desktop"
|
||||
);
|
||||
|
||||
FolderStore folder_store = yield this.folders.get_folder_store();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ shared_module(
|
|||
plugin_name,
|
||||
sources: plugin_src,
|
||||
dependencies: send_sound_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ shared_module(
|
|||
plugin_name,
|
||||
sources: plugin_src,
|
||||
dependencies: plugin_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: plugin_c_args,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@
|
|||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
extern const string _LANGUAGE_SUPPORT_DIRECTORY;
|
||||
extern const string _ISO_CODE_639_XML;
|
||||
extern const string _ISO_CODE_3166_XML;
|
||||
|
||||
/**
|
||||
* Internationalisation support functions.
|
||||
*/
|
||||
|
|
@ -29,7 +25,7 @@ namespace Util.I18n {
|
|||
|
||||
// TODO: Geary should be able to use langpacks from the build directory
|
||||
private string get_langpack_dir_path(string program_path) {
|
||||
return _LANGUAGE_SUPPORT_DIRECTORY;
|
||||
return Config.LANGUAGE_SUPPORT_DIRECTORY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -151,7 +147,7 @@ namespace Util.I18n {
|
|||
if (language_names == null) {
|
||||
language_names = new HashTable<string, string>(GLib.str_hash, GLib.str_equal);
|
||||
|
||||
unowned Xml.Doc doc = Xml.Parser.parse_file(_ISO_CODE_639_XML);
|
||||
unowned Xml.Doc doc = Xml.Parser.parse_file(Config.ISO_CODE_639_XML);
|
||||
if (doc == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -201,7 +197,7 @@ namespace Util.I18n {
|
|||
if (country_names == null) {
|
||||
country_names = new HashTable<string, string>(GLib.str_hash, GLib.str_equal);
|
||||
|
||||
unowned Xml.Doc doc = Xml.Parser.parse_file(_ISO_CODE_3166_XML);
|
||||
unowned Xml.Doc doc = Xml.Parser.parse_file(Config.ISO_CODE_3166_XML);
|
||||
|
||||
if (doc == null) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -248,9 +248,9 @@ namespace Util.Migrate {
|
|||
|
||||
public static void old_app_config(Settings newSettings, string old_app_id = OLD_APP_ID) {
|
||||
SettingsSchemaSource schemaSource = SettingsSchemaSource.get_default();
|
||||
if (Application.Client.GSETTINGS_DIR != null) {
|
||||
if (Config.GSETTINGS_DIR != null) {
|
||||
try {
|
||||
schemaSource = new SettingsSchemaSource.from_directory(Application.Client.GSETTINGS_DIR, null, false);
|
||||
schemaSource = new SettingsSchemaSource.from_directory(Config.GSETTINGS_DIR, null, false);
|
||||
} catch (Error e) {
|
||||
// If it didn't work, do nothing (i.e. use the default GSettings dir)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ n * Copyright 2016 Software Freedom Conservancy Inc.
|
|||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
extern const string _VERSION;
|
||||
|
||||
errordomain CommandException {
|
||||
USAGE,
|
||||
STATE
|
||||
|
|
@ -415,7 +413,7 @@ class ImapConsole : Gtk.Window {
|
|||
|
||||
Gee.HashMap<string, string> fields = new Gee.HashMap<string, string>();
|
||||
fields.set("name", "geary-console");
|
||||
fields.set("version", _VERSION);
|
||||
fields.set("version", Config.VERSION);
|
||||
|
||||
this.cx.send_command(
|
||||
new Geary.Imap.IdCommand(fields, null)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ console_sources = files(
|
|||
)
|
||||
|
||||
console_dependencies = [
|
||||
config_dep,
|
||||
gtk,
|
||||
gee,
|
||||
gmime,
|
||||
|
|
@ -13,7 +14,6 @@ console_dependencies = [
|
|||
console = executable('geary-console',
|
||||
console_sources,
|
||||
dependencies: console_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: geary_c_args,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -318,6 +318,7 @@ engine_sources = [
|
|||
]
|
||||
|
||||
engine_dependencies = [
|
||||
config_dep,
|
||||
gee,
|
||||
gio,
|
||||
glib,
|
||||
|
|
@ -374,7 +375,6 @@ endif
|
|||
engine_lib = static_library('geary-engine',
|
||||
engine_sources,
|
||||
dependencies: engine_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: engine_vala_args,
|
||||
c_args: engine_c_args,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ mailer_sources = files(
|
|||
)
|
||||
|
||||
mailer_dependencies = [
|
||||
config_dep,
|
||||
gee,
|
||||
gmime,
|
||||
webkit2gtk,
|
||||
|
|
@ -12,7 +13,6 @@ mailer_dependencies = [
|
|||
mailer = executable('geary-mailer',
|
||||
mailer_sources,
|
||||
dependencies: mailer_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: geary_c_args,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,24 +1,31 @@
|
|||
# Build source configuration
|
||||
config_h_dir = include_directories('.')
|
||||
|
||||
conf = configuration_data()
|
||||
# keep this in sync with config.vapi
|
||||
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
||||
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
|
||||
conf.set_quoted('_APP_ID', geary_id)
|
||||
conf.set_quoted('_BUILD_ROOT_DIR', meson.project_build_root())
|
||||
conf.set_quoted('_GSETTINGS_DIR', meson.project_build_root() / 'desktop')
|
||||
conf.set_quoted('_INSTALL_PREFIX', geary_prefix)
|
||||
conf.set_quoted('_ISO_CODE_3166_XML', iso_3166_xml)
|
||||
conf.set_quoted('_ISO_CODE_639_XML', iso_639_xml)
|
||||
conf.set_quoted('_LANGUAGE_SUPPORT_DIRECTORY', locale_dir)
|
||||
conf.set_quoted('_NAME_SUFFIX', name_suffix)
|
||||
conf.set_quoted('_PLUGINS_DIR', plugins_dir)
|
||||
conf.set_quoted('_PROFILE', profile)
|
||||
conf.set_quoted('_REVNO', revno)
|
||||
conf.set_quoted('_SOURCE_ROOT_DIR', meson.project_source_root())
|
||||
conf.set_quoted('_VERSION', geary_version)
|
||||
conf.set_quoted('_WEB_EXTENSIONS_DIR', web_extensions_dir)
|
||||
configure_file(output: 'config.h', configuration: conf)
|
||||
conf.set_quoted('APP_ID', geary_id)
|
||||
conf.set_quoted('BUILD_ROOT_DIR', meson.project_build_root())
|
||||
conf.set_quoted('GSETTINGS_DIR', meson.project_build_root() / 'desktop')
|
||||
conf.set_quoted('INSTALL_PREFIX', geary_prefix)
|
||||
conf.set_quoted('ISO_CODE_3166_XML', iso_3166_xml)
|
||||
conf.set_quoted('ISO_CODE_639_XML', iso_639_xml)
|
||||
conf.set_quoted('LANGUAGE_SUPPORT_DIRECTORY', locale_dir)
|
||||
conf.set_quoted('NAME_SUFFIX', name_suffix)
|
||||
conf.set_quoted('PLUGINS_DIR', plugins_dir)
|
||||
conf.set_quoted('PROFILE', profile)
|
||||
conf.set_quoted('REVNO', revno)
|
||||
conf.set_quoted('SOURCE_ROOT_DIR', meson.project_source_root())
|
||||
conf.set_quoted('VERSION', geary_version)
|
||||
conf.set_quoted('WEB_EXTENSIONS_DIR', web_extensions_dir)
|
||||
config_h = configure_file(output: 'config.h', configuration: conf)
|
||||
|
||||
config_dep = declare_dependency(
|
||||
sources: config_h,
|
||||
dependencies: [
|
||||
valac.find_library('config', dirs: vapi_dir),
|
||||
],
|
||||
include_directories: include_directories('.'),
|
||||
)
|
||||
|
||||
# Common valac options
|
||||
geary_vala_args = [
|
||||
|
|
@ -68,12 +75,12 @@ web_process_sources = files(
|
|||
web_process = library('geary-web-process',
|
||||
web_process_sources,
|
||||
dependencies: [
|
||||
config_dep,
|
||||
engine_dep,
|
||||
gee,
|
||||
gmime,
|
||||
webkit2gtk_web_extension,
|
||||
],
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: geary_c_args,
|
||||
install: true,
|
||||
|
|
@ -158,6 +165,7 @@ foreach dep : valadoc_dependencies
|
|||
valadoc_dep_args += 'libhandy-1'
|
||||
endif
|
||||
endforeach
|
||||
valadoc_dep_args += [ '--pkg', 'config' ]
|
||||
valadoc_dep_args += [ '--pkg', 'icu-uc' ]
|
||||
valadoc_dep_args += [ '--pkg', 'libstemmer' ]
|
||||
valadoc_dep_args += [ '--pkg', 'posix' ]
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class Application.ClientTest : TestCase {
|
|||
|
||||
public void paths_when_installed() throws GLib.Error {
|
||||
string[] args = new string[] {
|
||||
_INSTALL_PREFIX + "/bin/geary",
|
||||
Config.INSTALL_PREFIX + "/bin/geary",
|
||||
// Specify this so the app doesn't actually attempt
|
||||
// to start up
|
||||
"-v"
|
||||
|
|
@ -38,11 +38,11 @@ class Application.ClientTest : TestCase {
|
|||
|
||||
assert_equal(
|
||||
this.test_article.get_resource_directory().get_path(),
|
||||
_INSTALL_PREFIX + "/share/geary"
|
||||
Config.INSTALL_PREFIX + "/share/geary"
|
||||
);
|
||||
assert_equal(
|
||||
this.test_article.get_desktop_directory().get_path(),
|
||||
_INSTALL_PREFIX + "/share/applications"
|
||||
Config.INSTALL_PREFIX + "/share/applications"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public abstract class Components.WebViewTestCase<V> : TestCase {
|
|||
|
||||
WebView.init_web_context(
|
||||
this.config,
|
||||
File.new_for_path(_BUILD_ROOT_DIR).get_child("src"),
|
||||
File.new_for_path(Config.BUILD_ROOT_DIR).get_child("src"),
|
||||
File.new_for_path("/tmp"), // XXX use something better here
|
||||
false // https://bugs.webkit.org/show_bug.cgi?id=213174
|
||||
);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public class Components.WebViewTest : TestCase {
|
|||
config.enable_debug = true;
|
||||
WebView.init_web_context(
|
||||
config,
|
||||
File.new_for_path(_BUILD_ROOT_DIR).get_child("src"),
|
||||
File.new_for_path(Config.BUILD_ROOT_DIR).get_child("src"),
|
||||
File.new_for_path("/tmp"), // XXX use something better here
|
||||
false // https://bugs.webkit.org/show_bug.cgi?id=213174
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
// Defined by CMake build script.
|
||||
extern const string _SOURCE_ROOT_DIR;
|
||||
|
||||
class Geary.AttachmentTest : TestCase {
|
||||
|
||||
private const string CONTENT_TYPE = "image/svg+xml";
|
||||
|
|
@ -64,7 +61,7 @@ class Geary.AttachmentTest : TestCase {
|
|||
this.default_type = Mime.ContentType.ATTACHMENT_DEFAULT;
|
||||
this.content_disposition = new Mime.ContentDisposition("attachment", null);
|
||||
|
||||
File source = File.new_for_path(_SOURCE_ROOT_DIR);
|
||||
File source = File.new_for_path(Config.SOURCE_ROOT_DIR);
|
||||
this.file = source.get_child(FILE_PATH);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class Geary.ContactStoreImplTest : TestCase {
|
|||
|
||||
this.db = new ImapDB.Database(
|
||||
db_file,
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql"),
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql"),
|
||||
attachments_dir,
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_UPGRADE),
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_VACUUM)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class Geary.FtsSearchQueryTest : TestCase {
|
|||
this.account = new ImapDB.Account(
|
||||
config,
|
||||
this.tmp_dir,
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql")
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql")
|
||||
);
|
||||
this.account.open_async.begin(
|
||||
null,
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class Geary.ImapDB.AccountTest : TestCase {
|
|||
this.account = new Account(
|
||||
config,
|
||||
this.tmp_dir,
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql")
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql")
|
||||
);
|
||||
this.account.open_async.begin(
|
||||
null,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Geary.ImapDB.DatabaseTest : TestCase {
|
|||
public void open_new() throws Error {
|
||||
Database db = new Database(
|
||||
this.tmp_dir.get_child("test.db"),
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql"),
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql"),
|
||||
this.tmp_dir.get_child("attachments"),
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_UPGRADE),
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_VACUUM)
|
||||
|
|
@ -94,7 +94,7 @@ class Geary.ImapDB.DatabaseTest : TestCase {
|
|||
|
||||
Database db = new Database(
|
||||
db_file,
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql"),
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql"),
|
||||
attachments_dir,
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_UPGRADE),
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_VACUUM)
|
||||
|
|
@ -128,7 +128,7 @@ class Geary.ImapDB.DatabaseTest : TestCase {
|
|||
public void utf8_case_insensitive_collation() throws GLib.Error {
|
||||
Database db = new Database(
|
||||
this.tmp_dir.get_child("test.db"),
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql"),
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql"),
|
||||
this.tmp_dir.get_child("attachments"),
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_UPGRADE),
|
||||
new Geary.SimpleProgressMonitor(Geary.ProgressType.DB_VACUUM)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class Geary.ImapDB.FolderTest : TestCase {
|
|||
this.account = new Account(
|
||||
config,
|
||||
this.tmp_dir,
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql")
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql")
|
||||
);
|
||||
this.account.open_async.begin(
|
||||
null,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class Geary.ImapEngine.GenericAccountTest : TestCase {
|
|||
this.local_account = new ImapDB.Account(
|
||||
config,
|
||||
this.tmp_dir,
|
||||
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql")
|
||||
GLib.File.new_for_path(Config.SOURCE_ROOT_DIR).get_child("sql")
|
||||
);
|
||||
this.local_account.open_async.begin(null, this.async_completion);
|
||||
this.local_account.open_async.end(async_result());
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ test_integration_sources = [
|
|||
# Engine tests
|
||||
|
||||
test_engine_dependencies = [
|
||||
config_dep,
|
||||
engine_internal_dep,
|
||||
vala_unit_dep,
|
||||
]
|
||||
|
|
@ -142,7 +143,6 @@ endif
|
|||
test_engine_bin = executable('test-engine',
|
||||
test_engine_sources + libmock_sources,
|
||||
dependencies: test_engine_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: test_engine_vala_args,
|
||||
c_args: geary_c_args,
|
||||
)
|
||||
|
|
@ -150,6 +150,7 @@ test_engine_bin = executable('test-engine',
|
|||
# Client tests
|
||||
|
||||
test_client_dependencies = [
|
||||
config_dep,
|
||||
client_internal_dep,
|
||||
vala_unit_dep,
|
||||
]
|
||||
|
|
@ -158,13 +159,13 @@ test_client_dependencies += client_dependencies
|
|||
test_client_bin = executable('test-client',
|
||||
test_client_sources + libmock_sources,
|
||||
dependencies: test_client_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: geary_c_args,
|
||||
build_rpath: client_build_dir,
|
||||
)
|
||||
|
||||
test_js_dependencies = [
|
||||
config_dep,
|
||||
client_internal_dep,
|
||||
vala_unit_dep,
|
||||
]
|
||||
|
|
@ -173,7 +174,6 @@ test_js_dependencies += client_dependencies
|
|||
test_js_bin = executable('test-js',
|
||||
test_js_sources + libmock_sources,
|
||||
dependencies: test_js_dependencies,
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: geary_c_args,
|
||||
build_rpath: client_build_dir,
|
||||
|
|
@ -184,6 +184,7 @@ test_js_bin = executable('test-js',
|
|||
test_integration_bin = executable('test-integration',
|
||||
test_integration_sources,
|
||||
dependencies: [
|
||||
config_dep,
|
||||
engine_dep,
|
||||
gee,
|
||||
gio,
|
||||
|
|
@ -191,7 +192,6 @@ test_integration_bin = executable('test-integration',
|
|||
vala_unit_dep,
|
||||
webkit2gtk,
|
||||
],
|
||||
include_directories: config_h_dir,
|
||||
vala_args: geary_vala_args,
|
||||
c_args: geary_c_args,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ int main(string[] args) {
|
|||
Environment.set_variable("GSETTINGS_BACKEND", "memory", true);
|
||||
|
||||
// Let GSettings know where to find the dev schema
|
||||
Environment.set_variable("GSETTINGS_SCHEMA_DIR", _GSETTINGS_DIR, true);
|
||||
Environment.set_variable("GSETTINGS_SCHEMA_DIR", Config.GSETTINGS_DIR, true);
|
||||
|
||||
/*
|
||||
* Initialise all the things.
|
||||
|
|
@ -27,7 +27,7 @@ int main(string[] args) {
|
|||
Gtk.init(ref args);
|
||||
Test.init(ref args);
|
||||
|
||||
IconFactory.init(GLib.File.new_for_path(_SOURCE_ROOT_DIR));
|
||||
IconFactory.init(GLib.File.new_for_path(Config.SOURCE_ROOT_DIR));
|
||||
Geary.RFC822.init();
|
||||
Geary.HTML.init();
|
||||
Geary.Logging.init();
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ int main(string[] args) {
|
|||
Environment.set_variable("GSETTINGS_BACKEND", "memory", true);
|
||||
|
||||
// Let GSettings know where to find the dev schema
|
||||
Environment.set_variable("GSETTINGS_SCHEMA_DIR", _GSETTINGS_DIR, true);
|
||||
Environment.set_variable("GSETTINGS_SCHEMA_DIR", Config.GSETTINGS_DIR, true);
|
||||
|
||||
/*
|
||||
* Initialise all the things.
|
||||
|
|
@ -27,7 +27,7 @@ int main(string[] args) {
|
|||
Gtk.init(ref args);
|
||||
Test.init(ref args);
|
||||
|
||||
IconFactory.init(GLib.File.new_for_path(_SOURCE_ROOT_DIR));
|
||||
IconFactory.init(GLib.File.new_for_path(Config.SOURCE_ROOT_DIR));
|
||||
Geary.RFC822.init();
|
||||
Geary.HTML.init();
|
||||
Geary.Logging.init();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue