Clean up feature flags on ruma crate

This commit is contained in:
Jonas Platte 2020-11-29 18:51:49 +01:00
parent d432598ae4
commit 4f11a5eb38
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 33 additions and 29 deletions

View File

@ -12,29 +12,6 @@ license = "MIT"
version = "0.0.1" version = "0.0.1"
edition = "2018" edition = "2018"
[features]
either = ["ruma-identifiers/either"]
rand = ["ruma-identifiers/rand"]
unstable-exhaustive-types = [
"ruma-events/unstable-exhaustive-types",
"ruma-appservice-api/unstable-exhaustive-types",
"ruma-client-api/unstable-exhaustive-types",
"ruma-federation-api/unstable-exhaustive-types",
"ruma-common/unstable-exhaustive-types",
]
unstable-pre-spec = ["ruma-client-api/unstable-pre-spec", "ruma-events/unstable-pre-spec", "ruma-federation-api/unstable-pre-spec"]
unstable-synapse-quirks = [
"ruma-client-api/unstable-synapse-quirks",
"ruma-common/unstable-synapse-quirks",
"ruma-events/unstable-synapse-quirks",
]
appservice-api = ["ruma-api", "ruma-appservice-api", "ruma-events"]
client-api = ["ruma-api", "ruma-client-api", "ruma-events"]
federation-api = ["ruma-api", "ruma-federation-api", "ruma-signatures"]
identity-service-api = ["ruma-api", "ruma-identity-service-api"]
push-gateway-api = ["ruma-api", "ruma-push-gateway-api"]
[dependencies] [dependencies]
assign = "1.1.0" assign = "1.1.0"
js_int = "0.1.9" js_int = "0.1.9"
@ -52,3 +29,30 @@ ruma-client-api = { version = "=0.10.0-alpha.1", path = "../ruma-client-api", op
ruma-federation-api = { version = "0.0.3", path = "../ruma-federation-api", optional = true } ruma-federation-api = { version = "0.0.3", path = "../ruma-federation-api", optional = true }
ruma-identity-service-api = { version = "0.0.0", path = "../ruma-identity-service-api", optional = true } ruma-identity-service-api = { version = "0.0.0", path = "../ruma-identity-service-api", optional = true }
ruma-push-gateway-api = { version = "0.0.0", path = "../ruma-push-gateway-api", optional = true } ruma-push-gateway-api = { version = "0.0.0", path = "../ruma-push-gateway-api", optional = true }
[features]
either = ["ruma-identifiers/either"]
rand = ["ruma-identifiers/rand"]
events = ["ruma-events"]
signatures = ["ruma-signatures"]
appservice-api = ["ruma-api", "ruma-appservice-api", "events"]
client-api = ["ruma-api", "ruma-client-api", "events"]
federation-api = ["ruma-api", "ruma-federation-api", "signatures"]
identity-service-api = ["ruma-api", "ruma-identity-service-api"]
push-gateway-api = ["ruma-api", "ruma-push-gateway-api"]
unstable-exhaustive-types = [
"ruma-events/unstable-exhaustive-types",
"ruma-appservice-api/unstable-exhaustive-types",
"ruma-client-api/unstable-exhaustive-types",
"ruma-federation-api/unstable-exhaustive-types",
"ruma-common/unstable-exhaustive-types",
]
unstable-pre-spec = ["ruma-client-api/unstable-pre-spec", "ruma-events/unstable-pre-spec", "ruma-federation-api/unstable-pre-spec"]
unstable-synapse-quirks = [
"ruma-client-api/unstable-synapse-quirks",
"ruma-common/unstable-synapse-quirks",
"ruma-events/unstable-synapse-quirks",
]

View File

@ -32,10 +32,10 @@ pub use ruma_identifiers::{
RoomIdOrAliasId, RoomVersionId, ServerName, ServerSigningKeyId, SigningKeyAlgorithm, UserId, RoomIdOrAliasId, RoomVersionId, ServerName, ServerSigningKeyId, SigningKeyAlgorithm, UserId,
}; };
#[cfg(feature = "ruma-events")] #[cfg(feature = "events")]
#[doc(inline)] #[doc(inline)]
pub use ruma_events as events; pub use ruma_events as events;
#[cfg(feature = "ruma-signatures")] #[cfg(feature = "signatures")]
#[doc(inline)] #[doc(inline)]
pub use ruma_signatures as signatures; pub use ruma_signatures as signatures;
@ -45,19 +45,19 @@ pub use ruma_signatures as signatures;
pub mod api { pub mod api {
pub use ruma_api::*; pub use ruma_api::*;
#[cfg(feature = "ruma-appservice-api")] #[cfg(feature = "appservice-api")]
#[doc(inline)] #[doc(inline)]
pub use ruma_appservice_api as appservice; pub use ruma_appservice_api as appservice;
#[cfg(feature = "ruma-client-api")] #[cfg(feature = "client-api")]
#[doc(inline)] #[doc(inline)]
pub use ruma_client_api as client; pub use ruma_client_api as client;
#[cfg(feature = "ruma-federation-api")] #[cfg(feature = "federation-api")]
#[doc(inline)] #[doc(inline)]
pub use ruma_federation_api as federation; pub use ruma_federation_api as federation;
#[cfg(feature = "identity-service-api")] #[cfg(feature = "identity-service-api")]
#[doc(inline)] #[doc(inline)]
pub use ruma_identity_service_api as identity_service; pub use ruma_identity_service_api as identity_service;
#[cfg(feature = "identity-service-api")] #[cfg(feature = "push-gateway-api")]
#[doc(inline)] #[doc(inline)]
pub use ruma_push_gateway_api as push_gateway; pub use ruma_push_gateway_api as push_gateway;
} }