Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional build with GUI introduced (default) #84

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/building.yaml
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ jobs:
path: etradeTaxReturnHelper

build_and_test:
name: etradeTaxReturnHelper building
name: etradeTaxReturnHelper GUI building
runs-on: ubuntu-latest
steps:
- name: Install system dependencies
@@ -61,3 +61,24 @@ jobs:
run: |
cargo test

build_and_test_no_gui:
name: etradeTaxReturnHelper building
runs-on: ubuntu-latest
steps:
- name: Install system dependencies
run: |
sudo apt-get update
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Cargo build
env:
LIBRARY_PATH: ./
run: |
cargo build --release --no-default-features
- name: Cargo test
env:
LIBRARY_PATH: ./
run: |
cargo test --no-default-features
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -10,6 +10,10 @@ repository = "https://github.com/jczaja/e-trade-tax-return-pl-helper"
homepage = "https://github.com/jczaja/e-trade-tax-return-pl-helper"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["gui"]
gui = ["fltk"]

[dependencies]
pdf = "0.7.2"
chrono = "0.4"
@@ -21,4 +25,4 @@ clap = "~2.27.0"
regex = "1.3.3"
calamine = "0.22.1"
wild = "2.2.0"
fltk = {version = "=1.3.24", features = ["fltk-bundled"]}
fltk = {version = "=1.3.24", features = ["fltk-bundled"], optional = true}
1 change: 1 addition & 0 deletions src/gui.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg(feature = "gui")]
pub mod gui {

pub use crate::logging::ResultExt;
12 changes: 8 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -2,15 +2,16 @@ use clap::{App, AppSettings, Arg};
use std::env;

mod de;
mod gui;
mod logging;
mod pl;
mod us;

mod gui;

use etradeTaxReturnHelper::run_taxation;
use logging::ResultExt;

// TODO: GUI : Error messages section (Redirecting to GUI the errors)
// TODO: Make GUI optional e.g. not needed for Linux if not available
// TODO: GUI : choosing residency
// TODO: Drag&Drop to work on MultiBrowser field

@@ -40,8 +41,11 @@ fn main() {
// If there is no arguments then start GUI
let args: Vec<String> = env::args().collect();
if args.len() <= 1 {
gui::gui::run_gui();
return;
#[cfg(feature = "gui")]
{
gui::gui::run_gui();
return;
}
}

let myapp = App::new("etradeTaxHelper ".to_string() + VERSION)