Merge branch 'rustls' into master

master
Damir Jelić 2020-08-24 10:00:21 +02:00
commit a5f06f772f
4 changed files with 25 additions and 7 deletions

View File

@ -31,17 +31,23 @@ jobs:
- os: windows
script:
- cd matrix_sdk
- cargo test --no-default-features --features "messages"
- cargo test --no-default-features --features "messages, native-tls"
- cd ../matrix_sdk_base
- cargo test --no-default-features --features "messages"
- os: osx
- os: linux
name: Minimal build
name: native-tls build
script:
- cd matrix_sdk
- cargo build --no-default-features
- cargo build --no-default-features --features "native-tls"
- os: linux
name: rustls-tls build
script:
- cd matrix_sdk
- cargo build --no-default-features --features "rustls-tls"
- os: osx
name: macOS 10.15

View File

@ -15,11 +15,13 @@ features = ["docs"]
rustdoc-args = ["--cfg", "feature=\"docs\""]
[features]
default = ["encryption", "sqlite_cryptostore", "messages"]
default = ["encryption", "sqlite_cryptostore", "messages", "native-tls"]
messages = ["matrix-sdk-base/messages"]
encryption = ["matrix-sdk-base/encryption", "dashmap"]
sqlite_cryptostore = ["matrix-sdk-base/sqlite_cryptostore"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]
docs = ["encryption", "sqlite_cryptostore", "messages"]
@ -27,8 +29,6 @@ docs = ["encryption", "sqlite_cryptostore", "messages"]
async-trait = "0.1.38"
dashmap = { version = "3.11.10", optional = true }
http = "0.2.1"
# FIXME: Revert to regular dependency once 0.10.8 or 0.11.0 is released
reqwest = { git = "https://github.com/seanmonstar/reqwest", rev = "cff487ff58630cf0ac59f3e46cbf20cf50a28b3f" }
serde_json = "1.0.57"
thiserror = "1.0.20"
tracing = "0.1.19"
@ -42,6 +42,12 @@ version = "0.1.0"
path = "../matrix_sdk_base"
default_features = false
# FIXME: Revert to regular dependency once 0.10.8 or 0.11.0 is released
[dependencies.reqwest]
git = "https://github.com/seanmonstar/reqwest"
rev = "cff487ff58630cf0ac59f3e46cbf20cf50a28b3f"
default_features = false
[dependencies.tracing-futures]
version = "0.2.4"
default-features = false

View File

@ -10,7 +10,7 @@ edition = "2018"
crate-type = ["cdylib"]
[dependencies]
matrix-sdk = { path = "../..", default-features = false }
matrix-sdk = { path = "../..", default-features = false, features = ["native-tls"] }
url = "2.1.1"
wasm-bindgen = { version = "0.2.62", features = ["serde-serialize"] }
wasm-bindgen-futures = "0.4.12"

View File

@ -37,6 +37,12 @@
)]
#![cfg_attr(feature = "docs", feature(doc_cfg))]
#[cfg(not(any(feature = "native-tls", feature = "rustls-tls",)))]
compile_error!("one of 'native-tls' or 'rustls-tls' features must be enabled");
#[cfg(all(feature = "native-tls", feature = "rustls-tls",))]
compile_error!("only one of 'native-tls' or 'rustls-tls' features can be enabled");
#[cfg(not(target_arch = "wasm32"))]
pub use matrix_sdk_base::JsonStore;
#[cfg(feature = "encryption")]