Flatten create structure
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
7
.gitmodules
vendored
@@ -1,6 +1,9 @@
|
||||
[submodule "advotrackerdb"]
|
||||
path = crates/advotrackerdb
|
||||
path = advotrackerdb
|
||||
url = https://gitea.networkx.de:50443/rzerres/advotrackerdb
|
||||
[submodule "advotrackerd"]
|
||||
path = crates/advotrackerd
|
||||
path = advotrackerd
|
||||
url = https://gitea.networkx.de:50443/rzerres/advotrackerd
|
||||
[submodule "advotracker_db"]
|
||||
path = advotracker_db
|
||||
url = https://gitea.networkx.de:50443/rzerres/advotracker_db
|
||||
|
||||
20
Cargo.toml
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "advotracker"
|
||||
version = "0.1.0"
|
||||
version = "0.1.0-alpha1"
|
||||
authors = ["Ralf Zerres <ralf.zerres@networkx.de>"]
|
||||
description = "Supports lawyers to capture relevant data encountered during an online legal advice\n"
|
||||
repository = "https://gitea.networkx.de:50443/rzerres/advotracker"
|
||||
@@ -14,20 +14,20 @@ keywords = [
|
||||
]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
#default-run = "crates/advotracker_client"
|
||||
#default-run = "advotracker_client"
|
||||
|
||||
[dependencies]
|
||||
advotrackerdb = { version = "0.1.0-alpha1", path = "crates/advotrackerdb" }
|
||||
advotrackerd = { version = "0.1.0-alpha1", path = "crates/advotrackerd", default-features = false }
|
||||
advotracker_client = { version = "0.1.5-alpha2", path = "crates/advotracker_client", default-features = false }
|
||||
advotracker_db = { version = "0.1.0-alpha1", path = "advotracker_db" }
|
||||
advotrackerd = { version = "0.1.0-alpha1", path = "advotrackerd", default-features = false }
|
||||
advotracker_client = { version = "0.1.5-alpha2", path = "advotracker_client", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["sqlite"]
|
||||
|
||||
# enable optional db backends
|
||||
sqlite = []
|
||||
#sqlite = ["advotrackerdb_sqlite"]
|
||||
#postgresql = ["advotrackerdb_pstgresql"]
|
||||
#sqlite = ["advotracker_db_sqlite"]
|
||||
#postgresql = ["advotracker_db_pstgresql"]
|
||||
|
||||
[profile.dev]
|
||||
#opt-level = 0
|
||||
@@ -63,7 +63,7 @@ overflow-checks = true
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"crates/advotrackerd",
|
||||
"crates/advotrackerdb",
|
||||
"crates/advotracker_client",
|
||||
"advotrackerd",
|
||||
"advotracker_db",
|
||||
"advotracker_client",
|
||||
]
|
||||
|
||||
6
advotracker_client/.cargo/config
Normal file
@@ -0,0 +1,6 @@
|
||||
#[target.x86_64-pc-windows-msvc]
|
||||
#linker = "lld-link"
|
||||
#linker = "/usr/local/msvc-wine-rust/linker-scripts/linkx64.sh"
|
||||
|
||||
#[target.i686-pc-windows-msvc]
|
||||
#linker = "/usr/local/msvc-wine-rust/linker-scripts/linkx32.sh"
|
||||
@@ -40,7 +40,7 @@ viperus = { git = "https://github.com/maurocordioli/viperus", features = ["cach
|
||||
[build-dependencies]
|
||||
winres = { version = "0.1.11" }
|
||||
#twine = { version = "0.3.8" }
|
||||
twine = { path = "../../../twine", features = ["serde"] }
|
||||
#twine = { path = "../../../twine", features = ["serde"] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 289 B |
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 452 B After Width: | Height: | Size: 452 B |
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 768 B After Width: | Height: | Size: 768 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 455 KiB After Width: | Height: | Size: 455 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 237 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
24
advotracker_client/build.rs-windres
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2021 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
#[cfg(target_os = "windows")]
|
||||
use windres::Build;
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
if env::var("CARGO_CFG_TARGET_FAMILY")? == "windows" {
|
||||
let mut res = Build::new();
|
||||
let target_env = std::env::var("CARGO_CFG_TARGET_ENV")?;
|
||||
match target_env.as_str() {
|
||||
"gnu" => res.set_icon("advotracker.rc"),
|
||||
"msvc" => res.set_icon("advotracker.rc"),
|
||||
_ => panic!("Unsupported env: {}", target_env),
|
||||
};
|
||||
res.compile()?
|
||||
}
|
||||
}
|
||||
52
advotracker_client/build.rs-winres
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2021 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: (0BSD or MIT)
|
||||
*/
|
||||
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use winres::{WindowsResource, VersionInfo};
|
||||
|
||||
fn add_icon_to_bin_when_building_for_win(icon_path: &str) -> Result<(), Box<dyn Error>> {
|
||||
if env::var("CARGO_CFG_TARGET_FAMILY")? == "windows" {
|
||||
let mut res = WindowsResource::new();
|
||||
let target_env = std::env::var("CARGO_CFG_TARGET_ENV")?;
|
||||
match target_env.as_str() {
|
||||
"gnu" => res
|
||||
.set_ar_path("x86_64-w64-mingw32-ar")
|
||||
.set_windres_path("x86_64-w64-mingw32-windres")
|
||||
.set_toolkit_path(".")
|
||||
.set_icon(icon_path)
|
||||
.set_version_info(VersionInfo::PRODUCTVERSION, 0x0000000100050003),
|
||||
"msvc" => res.set_icon(icon_path),
|
||||
_ => panic!("Unsupported env: {}", target_env),
|
||||
};
|
||||
res.compile()?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
add_icon_to_bin_when_building_for_win("./assets/icons/advotracker/advotracker.ico")
|
||||
}
|
||||
|
||||
// // only build for windows
|
||||
// fn main() {
|
||||
// if cfg!(target_os = "windows") {
|
||||
// println!("You are building for windows!");
|
||||
// // only build the resource for release builds
|
||||
// // as calling rc.exe might be slow
|
||||
// //if std::env::var("PROFILE").unwrap() == "release" { ]
|
||||
// let mut res = winres::WindowsResource::new();
|
||||
// res.set_icon("advotracker.ico")
|
||||
// .set("InternalName", "ADVOTRACKER.EXE")
|
||||
// // manually set version 0.1.5.2
|
||||
// .set_version_info(winres::VersionInfo::PRODUCTVERSION, 0x0000000100050003);
|
||||
// res.compile().unwrap();
|
||||
// } else {
|
||||
// println!("not windows, so no resource icon needed!");
|
||||
// }
|
||||
// }
|
||||
5
advotracker_client/config
Normal file
@@ -0,0 +1,5 @@
|
||||
[target.x86_64-pc-windows-msvc]
|
||||
linker = "/path/to/msvc-wine-rust/linker-scripts/linkx64.sh"
|
||||
|
||||
[target.i686-pc-windows-msvc]
|
||||
linker = "/path/to/msvc-wine-rust/linker-scripts/linkx32.sh"
|
||||
27
advotracker_client/examples/windows_test.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
#[cfg(windows)] extern crate winapi;
|
||||
use std::io::Error;
|
||||
|
||||
#[cfg(windows)]
|
||||
fn print_message(msg: &str) -> Result<i32, Error> {
|
||||
use std::ffi::OsStr;
|
||||
use std::iter::once;
|
||||
use std::os::windows::ffi::OsStrExt;
|
||||
use std::ptr::null_mut;
|
||||
use winapi::um::winuser::{MB_OK, MessageBoxW};
|
||||
let wide: Vec<u16> = OsStr::new(msg).encode_wide().chain(once(0)).collect();
|
||||
let ret = unsafe {
|
||||
MessageBoxW(null_mut(), wide.as_ptr(), wide.as_ptr(), MB_OK)
|
||||
};
|
||||
if ret == 0 { Err(Error::last_os_error()) }
|
||||
else { Ok(ret) }
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn print_message(msg: &str) -> Result<(), Error> {
|
||||
println!("{}", msg);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {
|
||||
print_message("Hello, world!").unwrap();
|
||||
}
|
||||