UI feature

This commit is contained in:
Tomasz Drwięga 2016-07-13 11:10:43 +02:00
parent 11cae70cdd
commit 29076da4b7
7 changed files with 14 additions and 14 deletions

View File

@ -29,13 +29,13 @@ ethsync = { path = "sync" }
ethcore-devtools = { path = "devtools" } ethcore-devtools = { path = "devtools" }
ethcore-rpc = { path = "rpc" } ethcore-rpc = { path = "rpc" }
ethcore-signer = { path = "signer" } ethcore-signer = { path = "signer" }
ethcore-dapps = { path = "dapps", optional = true }
semver = "0.2" semver = "0.2"
ethcore-ipc-nano = { path = "ipc/nano" } ethcore-ipc-nano = { path = "ipc/nano" }
ethcore-ipc = { path = "ipc/rpc" } ethcore-ipc = { path = "ipc/rpc" }
ethcore-ipc-hypervisor = { path = "ipc/hypervisor" } ethcore-ipc-hypervisor = { path = "ipc/hypervisor" }
json-ipc-server = { git = "https://github.com/ethcore/json-ipc-server.git" } json-ipc-server = { git = "https://github.com/ethcore/json-ipc-server.git" }
ansi_term = "0.7" ansi_term = "0.7"
ethcore-dapps = { path = "dapps", optional = true }
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = "0.2" winapi = "0.2"
@ -48,8 +48,7 @@ version = "0.8"
default-features = false default-features = false
[features] [features]
default = ["dapps"] default = ["dapps", "ethcore-signer/ui"]
no-ui = ["ethcore-signer/no-ui"]
dapps = ["ethcore-dapps"] dapps = ["ethcore-dapps"]
dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev", dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev",
"ethcore-dapps/dev", "ethcore-signer/dev"] "ethcore-dapps/dev", "ethcore-signer/dev"]

View File

@ -561,7 +561,7 @@ impl Configuration {
} }
pub fn dapps_enabled(&self) -> bool { pub fn dapps_enabled(&self) -> bool {
!self.args.flag_dapps_off && !self.args.flag_no_dapps && cfg!(not(feature = "no-ui")) !self.args.flag_dapps_off && !self.args.flag_no_dapps && cfg!(feature = "dapps")
} }
pub fn signer_enabled(&self) -> bool { pub fn signer_enabled(&self) -> bool {

View File

@ -21,9 +21,9 @@ use util::panics::PanicHandler;
use die::*; use die::*;
use rpc_apis; use rpc_apis;
#[cfg(all(feature = "dapps", not(feature = "no-ui")))] #[cfg(feature = "dapps")]
pub use ethcore_dapps::Server as WebappServer; pub use ethcore_dapps::Server as WebappServer;
#[cfg(any(not(feature = "dapps"), feature = "no-ui"))] #[cfg(not(feature = "dapps"))]
pub struct WebappServer; pub struct WebappServer;
pub struct Configuration { pub struct Configuration {
@ -62,7 +62,7 @@ pub fn new(configuration: Configuration, deps: Dependencies) -> Option<WebappSer
Some(setup_dapps_server(deps, configuration.dapps_path, &addr, auth)) Some(setup_dapps_server(deps, configuration.dapps_path, &addr, auth))
} }
#[cfg(any(not(feature = "dapps"), feature = "no-ui"))] #[cfg(not(feature = "dapps"))]
pub fn setup_dapps_server( pub fn setup_dapps_server(
_deps: Dependencies, _deps: Dependencies,
_dapps_path: String, _dapps_path: String,
@ -72,7 +72,7 @@ pub fn setup_dapps_server(
die!("Your Parity version has been compiled without WebApps support.") die!("Your Parity version has been compiled without WebApps support.")
} }
#[cfg(all(feature = "dapps", not(feature = "no-ui")))] #[cfg(feature = "dapps")]
pub fn setup_dapps_server( pub fn setup_dapps_server(
deps: Dependencies, deps: Dependencies,
dapps_path: String, dapps_path: String,

View File

@ -51,7 +51,7 @@ extern crate ethcore_rpc;
extern crate ethcore_signer; extern crate ethcore_signer;
extern crate ansi_term; extern crate ansi_term;
#[cfg(all(feature = "dapps", not(feature = "no-ui")))] #[cfg(feature = "dapps")]
extern crate ethcore_dapps; extern crate ethcore_dapps;
#[macro_use] #[macro_use]

View File

@ -18,10 +18,11 @@ env_logger = "0.3"
ws = { git = "https://github.com/ethcore/ws-rs.git", branch = "stable" } ws = { git = "https://github.com/ethcore/ws-rs.git", branch = "stable" }
ethcore-util = { path = "../util" } ethcore-util = { path = "../util" }
ethcore-rpc = { path = "../rpc" } ethcore-rpc = { path = "../rpc" }
parity-dapps-signer = { git = "https://github.com/ethcore/parity-ui.git", version = "0.2.0" } parity-dapps-signer = { git = "https://github.com/ethcore/parity-ui.git", version = "0.2.0", optional = true}
clippy = { version = "0.0.79", optional = true} clippy = { version = "0.0.79", optional = true}
[features] [features]
default = ["ui"]
dev = ["clippy"] dev = ["clippy"]
no-ui = [] ui = ["parity-dapps-signer"]

View File

@ -51,7 +51,7 @@ extern crate ethcore_util as util;
extern crate ethcore_rpc as rpc; extern crate ethcore_rpc as rpc;
extern crate jsonrpc_core; extern crate jsonrpc_core;
extern crate ws; extern crate ws;
#[cfg(not(feature = "no-ui"))] #[cfg(feature = "ui")]
extern crate parity_dapps_signer as signer; extern crate parity_dapps_signer as signer;
mod authcode_store; mod authcode_store;

View File

@ -24,7 +24,7 @@ use std::str::FromStr;
use jsonrpc_core::IoHandler; use jsonrpc_core::IoHandler;
use util::H256; use util::H256;
#[cfg(not(feature = "no-ui"))] #[cfg(feature = "ui")]
mod signer { mod signer {
use signer; use signer;
@ -32,7 +32,7 @@ mod signer {
signer::handle(req) signer::handle(req)
} }
} }
#[cfg(feature = "no-ui")] #[cfg(not(feature = "ui"))]
mod signer { mod signer {
pub struct File { pub struct File {
pub content: String, pub content: String,