Flatten create structure

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2021-05-21 12:46:33 +02:00
parent 9ed395d04b
commit 78be428e7d
198 changed files with 257 additions and 3526 deletions

7
.gitmodules vendored
View File

@@ -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

View File

@@ -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",
]

View 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"

View File

@@ -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 = []

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 220 B

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 123 B

View File

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 289 B

View File

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

View File

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

View File

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 130 B

View File

Before

Width:  |  Height:  |  Size: 193 B

After

Width:  |  Height:  |  Size: 193 B

View File

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 452 B

View File

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 131 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 768 B

After

Width:  |  Height:  |  Size: 768 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 455 KiB

After

Width:  |  Height:  |  Size: 455 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 237 KiB

After

Width:  |  Height:  |  Size: 237 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View 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()?
}
}

View 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!");
// }
// }

View 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"

View 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();
}

Some files were not shown because too many files have changed in this diff Show More