Skip to content

Commit

Permalink
Implement all feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kestred committed Dec 16, 2019
1 parent 1b0d378 commit 54d7a1b
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 190 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ script:
- rustup component add rustfmt
- cargo fmt -- --check
- cargo build --verbose --all
- cargo build --verbose --all --features async
- cargo test --verbose --all
- cargo test --verbose --features async --example async_create_charge
- cargo build --verbose --all --features async
- cargo test --verbose --features async --example async_create_charge
- cargo build --verbose --all --no-default-features
26 changes: 11 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,23 @@ full = [
# Stripe feature groups
#core = [] # N.B. always enabled for now
#payment-methods = [] # N.B. always enabled for now
checkout = ["unstable-everything-else"]
billing = ["unstable-everything-else"]
connect = ["unstable-everything-else"]
fraud = ["unstable-everything-else"]
issuing = ["unstable-everything-else"]
orders = ["unstable-everything-else"]
sigma = ["unstable-everything-else"]
webhook-endpoints = ["unstable-everything-else"]

# Deprecated. Use either `webhook-events` or `webhook-endpoints` instead.
webhooks = ["webhook-endpoints", "webhook-events"]
checkout = []
billing = []
connect = []
fraud = []
issuing = []
orders = []
sigma = []
webhook-endpoints = []

# Deserialize events from webhooks
webhook-events = ["events", "hmac", "sha2"]
events = []

# Feature groups that haven't been broken out yet.
unstable-everything-else = [] # NOTE: Do not depend on this feature directly.
# Deprecated. Use either `webhook-events` or `webhook-endpoints` instead.
webhooks = ["webhook-endpoints", "webhook-events"]

# TODO: Deprecate `async` after we can use Generic Associated Types
# (see https://github.com/rust-lang/rust/issues/44265)
# Replace the sync client with an async client
async = []

[dependencies]
Expand Down
29 changes: 29 additions & 0 deletions bench/dependecy_weight.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
##
## Example
##

# [[benchmark]]
# commit = "d3be971826d775e7506352f2e63c59cd2a354525"
# profile = "debug"
# features = ["full"]
# hardware = "MacBook Air (13-inch, 2018)"
# time = { debug = "_m __s" } # as reported by `cargo build`
# size = { release = "___M" } # size of `.rlib`

##
## Version: 0.12.0-alpha.1
##

[[benchmark]]
commit = "ce0ec0d2959f846808026c14f8ebbe8c26818c85"
hardware = "MacBook Air (13-inch, 2018)"
features = []
time = { release = "10m 01s" }
size = { release = "43M", debug = "87M" }

[[benchmark]]
commit = "d3be971826d775e7506352f2e63c59cd2a354525"
hardware = "MacBook Air (13-inch, 2018)"
features = ["full"]
time = { release = "12m 18s", debug = "4m 39s" }
size = { release = "92M", debug = "207M"}
16 changes: 7 additions & 9 deletions openapi/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ pub fn feature_groups() -> BTreeMap<&'static str, &'static str> {
("account", "connect"),
("application", "connect"),
("application_fee", "connect"),
("connect_collection_transfer", "connect"),
("fee_refund", "connect"),
("person", "connect"),
("recipient", "connect"),
("topup", "connect"),
("transfer", "connect"),
("transfer_reversal", "connect"),
Expand All @@ -75,13 +78,8 @@ pub fn feature_groups() -> BTreeMap<&'static str, &'static str> {

// Webhooks Endpoints
("webhook_endpoint", "webhook-endpoints"),

// Etc.
("connect_collection_transfer", "unstable-everything-else"),
("fee_refund", "unstable-everything-else"),
("recipient", "unstable-everything-else"),
("source_transaction", "unstable-everything-else"), ]
.into_iter()
.copied()
.collect()
]
.into_iter()
.copied()
.collect()
}
Loading

0 comments on commit 54d7a1b

Please sign in to comment.