Skip to content

Commit

Permalink
Optional build with GUI introduced (default) (#84)
Browse files Browse the repository at this point in the history
* - Features added (so no GUID version exists)

* - Fix to workflow file after features introductions
  • Loading branch information
jczaja authored Nov 9, 2023
1 parent 28f83c9 commit 790d293
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/building.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Up @@ -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"
Expand All @@ -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;
Expand Down
12 changes: 8 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 790d293

Please sign in to comment.