diff options
Diffstat (limited to 'rola-devtools')
| -rw-r--r-- | rola-devtools/Cargo.lock | 7 | ||||
| -rw-r--r-- | rola-devtools/Cargo.toml | 6 | ||||
| -rw-r--r-- | rola-devtools/scripts/check-all.py | 38 | ||||
| -rw-r--r-- | rola-devtools/scripts/run-desktop.py | 11 | ||||
| -rw-r--r-- | rola-devtools/scripts/windows-folder-hide.ps1 | 43 | ||||
| -rw-r--r-- | rola-devtools/src/bin/welcome.rs | 3 | ||||
| -rw-r--r-- | rola-devtools/src/lib.rs | 1 |
7 files changed, 109 insertions, 0 deletions
diff --git a/rola-devtools/Cargo.lock b/rola-devtools/Cargo.lock new file mode 100644 index 0000000..f03c9e3 --- /dev/null +++ b/rola-devtools/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "rola-devtools" +version = "0.1.0" diff --git a/rola-devtools/Cargo.toml b/rola-devtools/Cargo.toml new file mode 100644 index 0000000..dd6e6d7 --- /dev/null +++ b/rola-devtools/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rola-devtools" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/rola-devtools/scripts/check-all.py b/rola-devtools/scripts/check-all.py new file mode 100644 index 0000000..cd2ddf1 --- /dev/null +++ b/rola-devtools/scripts/check-all.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +import subprocess +import sys +from pathlib import Path + +script_dir = Path(__file__).resolve().parent +root_dir = script_dir.parent.parent + +steps = [ + ("cargo check --workspace", [ + "cargo", "check", "--workspace", + ]), + ("cargo clippy --workspace -- -D warnings", [ + "cargo", "clippy", "--workspace", "--", "-D", "warnings", + ]), + ("cargo build --workspace --release", [ + "cargo", "build", "--workspace", "--release", + ]), + ("dotnet restore", [ + "dotnet", "restore", "rola-desktop.sln", + ]), + ("dotnet build", [ + "dotnet", "build", "rola-desktop.sln", "--nologo", + ]), +] + +ok = True +for label, cmd in steps: + print(f"\nSTEP - \"{label}\": ", flush=True) + result = subprocess.run(cmd, cwd=root_dir) + if result.returncode != 0: + print(f" [FAILED] Failed (exit code {result.returncode})", flush=True) + ok = False + break + print(f" [SUCCESS] Passed", flush=True) + +sys.exit(0 if ok else 1) diff --git a/rola-devtools/scripts/run-desktop.py b/rola-devtools/scripts/run-desktop.py new file mode 100644 index 0000000..e9d4093 --- /dev/null +++ b/rola-devtools/scripts/run-desktop.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +import subprocess +import sys +from pathlib import Path + +script_dir = Path(__file__).resolve().parent +project_dir = script_dir.parent.parent / "rola-desktop" +csproj = project_dir / "rola-desktop.csproj" + +subprocess.run(["dotnet", "run", "--project", str(csproj), *sys.argv[1:]]) diff --git a/rola-devtools/scripts/windows-folder-hide.ps1 b/rola-devtools/scripts/windows-folder-hide.ps1 new file mode 100644 index 0000000..0ab2632 --- /dev/null +++ b/rola-devtools/scripts/windows-folder-hide.ps1 @@ -0,0 +1,43 @@ +# Check `last_check` + +$lastCheckFile = Join-Path $PSScriptRoot "last_check" +$currentTime = Get-Date +$timeThreshold = 10 + +if (Test-Path $lastCheckFile) { + $lastCheckTime = Get-Content $lastCheckFile | Get-Date + $timeDiff = ($currentTime - $lastCheckTime).TotalMinutes + + if ($timeDiff -lt $timeThreshold) { + exit + } +} + +$currentTime.ToString() | Out-File -FilePath $lastCheckFile -Force + +# Hide Files + +Set-Location -Path (Join-Path $PSScriptRoot "..\..") + +Get-ChildItem -Path . -Force -Recurse -ErrorAction SilentlyContinue | Where-Object { + $_.FullName -notmatch '\\.temp\\' -and $_.FullName -notmatch '\\.git\\' +} | ForEach-Object { + attrib -h $_.FullName 2>&1 | Out-Null +} + +Get-ChildItem -Path . -Force -Recurse -ErrorAction SilentlyContinue | Where-Object { + $_.Name -match '^\..*' -and $_.FullName -notmatch '\\\.\.$' -and $_.FullName -notmatch '\\\.$' +} | ForEach-Object { + attrib +h $_.FullName 2>&1 | Out-Null +} + +if (Get-Command git -ErrorAction SilentlyContinue) { + git status --ignored --short | ForEach-Object { + if ($_ -match '^!!\s+(.+)$') { + $ignoredPath = $matches[1] + if ($ignoredPath -notmatch '\.lnk$' -and (Test-Path $ignoredPath)) { + attrib +h $ignoredPath 2>&1 | Out-Null + } + } + } +} diff --git a/rola-devtools/src/bin/welcome.rs b/rola-devtools/src/bin/welcome.rs new file mode 100644 index 0000000..3b1982f --- /dev/null +++ b/rola-devtools/src/bin/welcome.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Welcome!"); +} diff --git a/rola-devtools/src/lib.rs b/rola-devtools/src/lib.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/rola-devtools/src/lib.rs @@ -0,0 +1 @@ + |
