Merge pull request #1604 from ethcore/noui

ui compilation feature
This commit is contained in:
Robert Habermeier 2016-07-13 19:20:10 +02:00 committed by GitHub
commit 4226c0f631
10 changed files with 40 additions and 18 deletions

View File

@ -17,27 +17,27 @@ env_logger = "0.3"
rustc-serialize = "0.3"
docopt = "0.6"
time = "0.1"
ctrlc = { git = "https://github.com/ethcore/rust-ctrlc.git" }
fdlimit = { path = "util/fdlimit" }
num_cpus = "0.2"
number_prefix = "0.2"
rpassword = "0.2.1"
clippy = { version = "0.0.79", optional = true}
semver = "0.2"
ansi_term = "0.7"
lazy_static = "0.2"
regex = "0.1"
ctrlc = { git = "https://github.com/ethcore/rust-ctrlc.git" }
fdlimit = { path = "util/fdlimit" }
ethcore = { path = "ethcore" }
ethcore-util = { path = "util" }
ethsync = { path = "sync" }
ethcore-devtools = { path = "devtools" }
ethcore-rpc = { path = "rpc" }
ethcore-signer = { path = "signer" }
ethcore-dapps = { path = "dapps", optional = true }
semver = "0.2"
ethcore-ipc-nano = { path = "ipc/nano" }
ethcore-ipc = { path = "ipc/rpc" }
ethcore-ipc-hypervisor = { path = "ipc/hypervisor" }
json-ipc-server = { git = "https://github.com/ethcore/json-ipc-server.git" }
ansi_term = "0.7"
lazy_static = "0.2"
regex = "0.1"
ethcore-dapps = { path = "dapps", optional = true }
clippy = { version = "0.0.79", optional = true}
[target.'cfg(windows)'.dependencies]
winapi = "0.2"
@ -50,7 +50,7 @@ version = "0.8"
default-features = false
[features]
default = ["dapps"]
default = ["dapps", "ethcore-signer/ui"]
dapps = ["ethcore-dapps"]
dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev",
"ethcore-dapps/dev", "ethcore-signer/dev"]

View File

@ -31,10 +31,10 @@ install:
build: off
test_script:
- cargo test --verbose --release
- cargo test --verbose --release --no-default-features
after_test:
- cargo build --verbose --release
- cargo build --verbose --release --no-default-features
- ps: if($env:cert) { Start-FileDownload $env:cert -FileName $env:keyfile }
- ps: if($env:cert) { signtool sign /f $env:keyfile /p $env:certpass target\release\parity.exe }
- makensis.exe nsis\installer.nsi

View File

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

View File

@ -21,7 +21,7 @@ if ! type $KCOV > /dev/null; then
fi
. ./scripts/targets.sh
cargo test $TARGETS --no-run || exit $?
cargo test $TARGETS --no-default-features --no-run || exit $?

View File

@ -3,5 +3,5 @@
. ./scripts/targets.sh
cargo doc --no-deps --verbose $TARGETS &&
cargo doc --no-deps --verbose --no-default-features $TARGETS &&
echo '<meta http-equiv=refresh content=0;url=ethcore/index.html>' > target/doc/index.html

View File

@ -9,6 +9,6 @@ export TARGETS="
-p ethsync \
-p ethcore-rpc \
-p ethcore-signer \
-p ethcore-dapps \
-p parity \
-p bigint"
# TODO [ToDr] add ethcore-dapps back

View File

@ -18,9 +18,11 @@ env_logger = "0.3"
ws = { git = "https://github.com/ethcore/ws-rs.git", branch = "stable" }
ethcore-util = { path = "../util" }
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}
[features]
default = ["ui"]
dev = ["clippy"]
ui = ["parity-dapps-signer"]

View File

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

View File

@ -17,7 +17,6 @@
//! Session handlers factory.
use ws;
use signer;
use authcode_store::AuthCodes;
use std::path::{PathBuf, Path};
use std::sync::Arc;
@ -25,6 +24,26 @@ use std::str::FromStr;
use jsonrpc_core::IoHandler;
use util::H256;
#[cfg(feature = "ui")]
mod signer {
use signer;
pub fn handle(req: &str) -> Option<signer::File> {
signer::handle(req)
}
}
#[cfg(not(feature = "ui"))]
mod signer {
pub struct File {
pub content: String,
pub mime: String,
}
pub fn handle(_req: &str) -> Option<File> {
None
}
}
fn origin_is_allowed(self_origin: &str, header: Option<&[u8]>) -> bool {
match header {
None => false,

View File

@ -14,5 +14,5 @@ case $1 in
esac
. ./scripts/targets.sh
cargo test $FEATURES $TARGETS $1 \
cargo test --no-default-features $FEATURES $TARGETS $1 \