add "built" crate
parent
8ebb3f7aef
commit
768a608b02
|
@ -530,6 +530,15 @@ dependencies = [
|
||||||
"bytes 0.5.6",
|
"bytes 0.5.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "built"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4f346b6890a0dfa7266974910e7df2d5088120dd54721b9b0e5aae1ae5e05715"
|
||||||
|
dependencies = [
|
||||||
|
"cargo-lock",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
version = "3.8.0"
|
version = "3.8.0"
|
||||||
|
@ -575,6 +584,18 @@ dependencies = [
|
||||||
"bytes 1.1.0",
|
"bytes 1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cargo-lock"
|
||||||
|
version = "7.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7fb04b88bd5b2036e30704f95c6ee16f3b5ca3b4ca307da2889d9006648e5c88"
|
||||||
|
dependencies = [
|
||||||
|
"semver 1.0.4",
|
||||||
|
"serde",
|
||||||
|
"toml",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.72"
|
version = "1.0.72"
|
||||||
|
@ -2066,6 +2087,9 @@ name = "semver"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
|
checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver-parser"
|
name = "semver-parser"
|
||||||
|
@ -2437,6 +2461,15 @@ dependencies = [
|
||||||
"tokio 0.2.25",
|
"tokio 0.2.25",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "toml"
|
||||||
|
version = "0.5.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing"
|
name = "tracing"
|
||||||
version = "0.1.29"
|
version = "0.1.29"
|
||||||
|
@ -2603,6 +2636,7 @@ dependencies = [
|
||||||
"actix_derive",
|
"actix_derive",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bs58",
|
"bs58",
|
||||||
|
"built",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"diesel",
|
"diesel",
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
[package]
|
[package]
|
||||||
name = "upend"
|
name = "upend"
|
||||||
description = "A user-oriented all-purpose graph database."
|
description = "A user-oriented all-purpose graph database."
|
||||||
|
version = "0.0.24"
|
||||||
homepage = "https://upendproject.net/"
|
homepage = "https://upendproject.net/"
|
||||||
repository = "https://gitlab.com/tmladek/upend/"
|
repository = "https://gitlab.com/tmladek/upend/"
|
||||||
authors = ["Tomáš Mládek <t@mldk.cz>"]
|
authors = ["Tomáš Mládek <t@mldk.cz>"]
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
version = "0.0.24"
|
build = "build.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "2.33.0"
|
clap = "2.33.0"
|
||||||
|
@ -67,6 +68,9 @@ actix-multipart = "0.3.0"
|
||||||
image = { version = "0.23.14", optional = true }
|
image = { version = "0.23.14", optional = true }
|
||||||
webp = { version = "0.2.0", optional = true }
|
webp = { version = "0.2.0", optional = true }
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
built = "0.5.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["desktop", "previews", "previews-image"]
|
default = ["desktop", "previews", "previews-image"]
|
||||||
desktop = ["webbrowser", "opener", "is_executable"]
|
desktop = ["webbrowser", "opener", "is_executable"]
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
built::write_built_file().expect("Failed to acquire build-time information");
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/built.rs"));
|
11
src/main.rs
11
src/main.rs
|
@ -15,23 +15,22 @@ use clap::{App as ClapApp, Arg};
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
|
||||||
use crate::database::UpEndDatabase;
|
use crate::{common::PKG_VERSION, database::UpEndDatabase};
|
||||||
|
|
||||||
mod addressing;
|
mod addressing;
|
||||||
|
mod common;
|
||||||
mod database;
|
mod database;
|
||||||
mod filesystem;
|
mod filesystem;
|
||||||
mod previews;
|
mod previews;
|
||||||
mod routes;
|
mod routes;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let env = env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info");
|
let env = env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "info");
|
||||||
env_logger::init_from_env(env);
|
env_logger::init_from_env(env);
|
||||||
|
|
||||||
let app = ClapApp::new("upend")
|
let app = ClapApp::new("upend")
|
||||||
.version(VERSION)
|
.version(PKG_VERSION)
|
||||||
.author("Tomáš Mládek <t@mldk.cz>")
|
.author("Tomáš Mládek <t@mldk.cz>")
|
||||||
.arg(Arg::with_name("DIRECTORY").required(true).index(1))
|
.arg(Arg::with_name("DIRECTORY").required(true).index(1))
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -45,7 +44,7 @@ fn main() -> Result<()> {
|
||||||
Arg::with_name("DB_PATH")
|
Arg::with_name("DB_PATH")
|
||||||
.long("db-path")
|
.long("db-path")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("path to sqlite db file (\"$VAULT_PATH/upend.sqlite\" by default)"),
|
.help("path to sqlite db file (\"$VAULT_PATH/.upend\" by default)"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("NO_BROWSER")
|
Arg::with_name("NO_BROWSER")
|
||||||
|
@ -81,7 +80,7 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
let matches = app.get_matches();
|
let matches = app.get_matches();
|
||||||
|
|
||||||
info!("Starting UpEnd {}...", VERSION);
|
info!("Starting UpEnd {}...", PKG_VERSION);
|
||||||
let sys = actix::System::new("upend");
|
let sys = actix::System::new("upend");
|
||||||
|
|
||||||
let job_container = Arc::new(RwLock::new(util::jobs::JobContainer::default()));
|
let job_container = Arc::new(RwLock::new(util::jobs::JobContainer::default()));
|
||||||
|
|
|
@ -29,8 +29,6 @@ use tempfile::NamedTempFile;
|
||||||
#[cfg(feature = "desktop")]
|
#[cfg(feature = "desktop")]
|
||||||
use is_executable::IsExecutable;
|
use is_executable::IsExecutable;
|
||||||
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct State {
|
pub struct State {
|
||||||
pub upend: Arc<UpEndDatabase>,
|
pub upend: Arc<UpEndDatabase>,
|
||||||
|
@ -416,7 +414,7 @@ pub async fn get_info(state: web::Data<State>) -> Result<HttpResponse, Error> {
|
||||||
Ok(HttpResponse::Ok().json(json!({
|
Ok(HttpResponse::Ok().json(json!({
|
||||||
"name": state.vault_name,
|
"name": state.vault_name,
|
||||||
"location": &*state.upend.vault_path,
|
"location": &*state.upend.vault_path,
|
||||||
"version": VERSION
|
"version": crate::common::PKG_VERSION
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue