Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dirs crate from use in UWP builds. #23559

Merged
merged 1 commit into from Jun 14, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Remove dirs crate from use in UWP builds.

  • Loading branch information
jdm committed Jun 13, 2019
commit 3e22b52b479edf9d0169538971d204f1eeef54c6
@@ -6,6 +6,9 @@ license = "MPL-2.0"
edition = "2018"
publish = false

[features]
uwp = []

[lib]
name = "servo_config"
path = "lib.rs"
@@ -29,5 +32,5 @@ servo_config_plugins = { path = "../config_plugins" }
env_logger = "0.6"
std_test_override = { path = "../std_test_override" }

[target.'cfg(not(target_os = "android"))'.dependencies]
[target.'cfg(not(any(target_os = "android", feature = "uwp")))'.dependencies]
dirs = "1.0"
@@ -35,9 +35,14 @@ pub fn default_config_dir() -> Option<PathBuf> {
Some(config_dir)
}

#[cfg(target_os = "windows")]
#[cfg(all(target_os = "windows", not(feature = "uwp")))]
pub fn default_config_dir() -> Option<PathBuf> {
let mut config_dir = ::dirs::config_dir().unwrap();
config_dir.push("Servo");
Some(config_dir)
}

#[cfg(all(target_os = "windows", feature = "uwp"))]
pub fn default_config_dir() -> Option<PathBuf> {
None
}
@@ -58,7 +58,7 @@ pub fn pref_map() -> &'static Preferences<'static, Prefs> {
&PREFS
}

pub fn add_user_prefs() {
pub(crate) fn add_user_prefs() {
if let Some(path) = user_prefs_path() {
init_user_prefs(path);
}
@@ -244,7 +244,7 @@ fn test_set_all_error_on_unknown_field() -> Result<(), Box<dyn Error>> {
Ok(())
}

#[cfg(not(target_os = "android"))]
#[cfg(not(any(target_os = "android", feature = "uwp")))]
#[test]
fn test_default_config_dir_create_read_write() {
let json_str = "{\
@@ -21,6 +21,7 @@ js_backtrace = ["script/js_backtrace"]
max_log_level = ["log/release_max_level_info"]
native-bluetooth = ["bluetooth/native-bluetooth"]
raqote_backend = ["canvas/raqote_backend"]
uwp = ["servo_config/uwp"]
webrender_debugger = ["webrender/debugger"]
no_static_freetype = ["webrender/no_static_freetype"]
oculusvr = ["webvr/oculusvr"]
@@ -40,4 +40,5 @@ oculusvr = ["libservo/oculusvr"]
raqote_backend = ["libservo/raqote_backend"]
webdriver = ["libservo/webdriver"]
unstable = ["libservo/unstable"]
uwp = ["libservo/uwp"]
webgl_backtrace = ["libservo/webgl_backtrace"]
@@ -33,5 +33,6 @@ native-bluetooth = ["simpleservo/native-bluetooth"]
oculusvr = ["simpleservo/oculusvr"]
raqote_backend = ["simpleservo/raqote_backend"]
unstable = ["simpleservo/unstable"]
uwp = ["simpleservo/uwp"]
webdriver = ["simpleservo/webdriver"]
webgl_backtrace = ["simpleservo/webgl_backtrace"]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.