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

SW5 #16

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

SW5 #16

Show file tree
Hide file tree
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
56 changes: 56 additions & 0 deletions .github/workflows/build_artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Artifacts

on:
workflow_dispatch:
push:

jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install deps
run: |
git submodule update --init --recursive
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
yarn
npm i -g vite
cd Ecdar-GUI-Web
npm install
git submodule update --init --recursive
cd ..
cargo install tauri-cli
cargo tauri build
- name: cargo build --release
uses: clechasseur/rs-cargo@v1
with:
command: build
args: --release
- uses: actions/upload-artifact@v3
with:
name: ecdar_app
path: target/release/ecdar_app
if-no-files-found: error
retention-days: 7
54 changes: 54 additions & 0 deletions .github/workflows/check_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Check formatting

on:
workflow_dispatch:
push:

jobs:
fmt:
name: cargo fmt & Clippy lint and check
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install llvm protobuf-compiler
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install deps
run: |
git submodule update --init --recursive
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
yarn
npm i -g vite
cd Ecdar-GUI-Web
npm install
git submodule update --init --recursive
cd ..
cargo install tauri-cli
cargo tauri build
- name: cargo fmt --all
uses: clechasseur/rs-cargo@v1
with:
command: fmt
args: --all -- --check
- name: clippy --all-targets --all-features
uses: clechasseur/rs-clippy-check@v3
with:
args: --all-targets --all-features -- -D warnings
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Tests

on:
workflow_dispatch:
push:

jobs:
test-linux:
name: Tests Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install deps
run: |
git submodule update --init --recursive
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
npm i -g vite
cd Ecdar-GUI-Web
npm install
git submodule update --init --recursive
cd ..
cargo install tauri-cli
- name: cargo test
uses: clechasseur/rs-cargo@v1
with:
command: test
56 changes: 0 additions & 56 deletions .github/workflows/test_format.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

.idea
6 changes: 5 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "Ecdar-GUI-Web"]
path = Ecdar-GUI-Web
url = https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-Web.git
url = https://github.com/Ecdar/Ecdar-GUI-Web
[submodule "Ecdar-ProtoBuf"]
path = Ecdar-ProtoBuf
url = https://github.com/Ecdar/Ecdar-ProtoBuf
branch = SW5
45 changes: 39 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
[workspace]
resolver = "2"
members = [
"src-tauri",
"ecdar-gui-macros"
]
[package]
name = "ecdar_app"
version = "0.1.0"
description = "A Tauri App"
authors = ["Thomas Krogh Lohse"]
build = "src/build.rs"
license = ""
repository = ""
default-run = "ecdar_app"
edition = "2021"


[lib]
proc-macro = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.4.0", features = [ ] }
tonic-build = "0.11.0"

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.4.0", features = [ "dialog-confirm", "dialog-save", "dialog-open", "fs-read-dir", "fs-create-dir", "fs-remove-dir", "fs-read-file", "fs-write-file", "fs-remove-file", "path-all" ] }
tauri-plugin-persisted-scope = "0.1.3"
tonic = "0.11.0"
prost = "0.12.3"
rand = "0.8.5"
tokio = "1.33.0"
ecdar-protobuf-transpiler = { git = "https://github.com/ECDAR-AAU-SW-P5/Ecdar-ProtoBuf-Transpiler-rs", version = "0.1.0" }
proc-macro2 = "1.0.69"
quote = "1.0.33"


[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
# DO NOT REMOVE!!
custom-protocol = [ "tauri/custom-protocol" ]
2 changes: 1 addition & 1 deletion Ecdar-GUI-Web
Submodule Ecdar-GUI-Web updated 75 files
+2 −0 .eslintignore
+10 −2 .eslintrc.cjs
+3 −0 .gitignore
+6 −0 .gitmodules
+2 −0 .prettierignore
+1 −0 Ecdar-ProtoBuf
+4 −1 bundleProjectExamples.ts
+75 −0 compileProtobuffers.ts
+5 −1 package.json
+16 −0 playwright.config.ts
+101 −4 src/lib/GlobalCssProperties.json
+1 −1 src/lib/classes/automaton/IdMap.ts
+55 −0 src/lib/classes/communication.ts
+31 −0 src/lib/classes/communication/ecdar-web.ts
+23 −0 src/lib/classes/communication/tauri.ts
+270 −34 src/lib/classes/styling/GlobalCssSchemesLoader.ts
+156 −0 src/lib/classes/styling/GlobalFontLoader.ts
+11 −0 src/lib/classes/styling/ZodSchemas/AttributeSchemas/FontAttribute.ts
+27 −0 src/lib/classes/styling/ZodSchemas/CSSVariables.ts
+13 −2 src/lib/classes/styling/ZodSchemas/MediaScheme.ts
+15 −3 src/lib/classes/styling/ZodSchemas/MediaSchemes.ts
+21 −10 src/lib/components/buttons/SvgButton.svelte
+15 −3 src/lib/components/contextMenu/contentTypes/locationMenu/LocationMenu.svelte
+66 −0 src/lib/components/modal/Modal.svelte
+9 −2 src/lib/components/overlayMenu/OverlayMenu.svelte
+9 −3 src/lib/components/overlayMenu/elements/Button.svelte
+50 −48 src/lib/components/project/ProjectItem.svelte
+3 −3 src/lib/components/project/ProjectItemDropDownMenu.svelte
+5 −1 src/lib/components/project/globalDeclaration/GlobalDeclaration.svelte
+517 −0 src/lib/components/settings/ColorSettings.svelte
+92 −0 src/lib/components/settings/FontSettings.svelte
+52 −0 src/lib/components/settings/SettingsView.svelte
+3 −0 src/lib/components/settings/showSettings.ts
+115 −43 src/lib/components/startScreen/StartScreen.svelte
+39 −0 src/lib/components/startScreen/TimeStamp.svelte
+0 −0 src/lib/components/svgView/DraggableSVG.svelte
+0 −0 src/lib/components/svgView/Edge.svelte
+0 −0 src/lib/components/svgView/Label.svelte
+0 −0 src/lib/components/svgView/Location.svelte
+2 −1 src/lib/components/svgView/Nail.svelte
+0 −0 src/lib/components/svgView/Node.svelte
+2 −2 src/lib/components/svgView/SvgView.svelte
+9 −0 src/lib/components/svgView/panzoom/css.ts
+9 −0 src/lib/components/svgView/panzoom/isExcluded.ts
+0 −0 src/lib/components/svgView/panzoom/panzoom.ts
+9 −0 src/lib/components/svgView/panzoom/pointers.ts
+9 −0 src/lib/components/svgView/panzoom/types.ts
+0 −0 src/lib/components/svgView/state.ts
+6 −0 src/lib/components/tabs/Tab.ts
+48 −0 src/lib/components/tabs/Tabs.svelte
+1 −2 src/lib/components/topBar/DropDownButton.svelte
+28 −11 src/lib/components/topBar/TopBar.svelte
+39 −0 src/lib/components/topBar/aboutUI/AboutUI.svelte
+3 −0 src/lib/components/topBar/aboutUI/showAboutUI.ts
+1 −1 src/lib/globalState/activeProject.ts
+3 −0 src/lib/interfaces/IAboutUI.ts
+4 −0 src/lib/interfaces/IModalComponent.ts
+10 −7 src/routes/+layout.svelte
+3 −2 src/routes/+page.svelte
+1 −1 src/tests/lib/classes/console/success.test.ts
+1 −1 src/tests/lib/classes/styling/GlobalCssSchemesLoader.test.ts
+1 −0 tests/lib/classes/styling/GlobalCssSchemesLoader.test.ts
+62 −11 tests/lib/components/project/project.test.ts
+34 −5 tests/lib/components/query/query.test.ts
+230 −0 tests/lib/components/settings/colorSettings.test.ts
+163 −0 tests/lib/components/settings/fontSettings.test.ts
+87 −0 tests/lib/components/settings/settings.test.ts
+ tests/lib/components/settings/testfiles/Lobster-Regular.ttf
+0 −0 tests/lib/components/settings/testfiles/emptyNonFontFile.ttf
+1 −0 tests/lib/components/settings/testfiles/hello.txt
+5 −0 tests/lib/components/sidePanel/sidePanel.test.ts
+20 −0 tests/lib/components/topBar/aboutUI/about.test.ts
+29 −0 tests/lib/components/topBar/topbar.test.ts
+2 −1 vite.config.ts
+706 −412 yarn.lock
1 change: 1 addition & 0 deletions Ecdar-ProtoBuf
Submodule Ecdar-ProtoBuf added at f5ae95
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ git clone https://github.com/ECDAR-AAU-SW-P5/Ecdar-GUI-Web.git

#### Linux

Install `node`, `npm` and `cargo`
Install `node`, `npm` and `cargo`, along with [this guide for Tauri](https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux)
###### Arch
```
$ sudo pacman -S cargo nodejs npm
Expand All @@ -32,8 +32,9 @@ $ sudo apt install cargo node npm
### Npm Dependencies
```
$ npm i -g vite
$ cd Ecdar-GUI-WEB
$ cd Ecdar-GUI-Web
$ npm install
$ git submodule update --init --recursive
$ cd ..
```
### Cargo dependencies
Expand Down
14 changes: 0 additions & 14 deletions ecdar-gui-macros/Cargo.toml

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
3 changes: 0 additions & 3 deletions src-tauri/.gitignore

This file was deleted.

32 changes: 0 additions & 32 deletions src-tauri/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions src-tauri/build.rs

This file was deleted.

7 changes: 7 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main() {
tonic_build::compile_protos("Ecdar-ProtoBuf/services.proto").unwrap();
// Tell cargo to invalidate the crate when the protobuf repository changes
println!("cargo:rerun-if-changed=Ecdar-ProtoBuf");

tauri_build::build()
}
File renamed without changes.
Loading