better organiasations + news hatch scripts + some minors bugs fixes

This commit is contained in:
xgui4
2026-04-13 18:49:05 -04:00
parent cdde37ff85
commit b173ee490b
21 changed files with 59 additions and 26 deletions

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env pwsh
$PSNativeCommandUseErrorActionPreference = $true
curl.exe -L -o "internet-lce-hub-ico.png" "https://avatars.githubusercontent.com/u/267444710?s=48&v=4"
curl.exe -L -o "internet-lce-evolved-ico.png" "https://codeberg.org/repo-avatars/c60b9f3bb0dfca3d35a457d921d2f68b73ebd2054d6d6e25a949bb3a7f32ad3a"
curl.exe -L -o "internet-4jcraft-ico.png" "https://avatars.githubusercontent.com/u/265054390?s=48&v=4"

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -e
curl -L -o "internet-lce-hub-ico.png" "https://avatars.githubusercontent.com/u/267444710?s=48&v=4"
curl -L -o "internet-lce-evolved-ico.png" "https://codeberg.org/repo-avatars/c60b9f3bb0dfca3d35a457d921d2f68b73ebd2054d6d6e25a949bb3a7f32ad3a"
curl -L -o "internet-4jcraft-ico.png" "https://avatars.githubusercontent.com/u/265054390?s=48&v=4"

View File

@@ -1,8 +0,0 @@
@echo off
pyside6-rcc "res.qrc" -o "src\res_rc.py"
pyside6-uic "src\system_info.ui" -o "src\ui_system_info.py"
pyside6-uic "src\form.ui" -o "src\ui_form.py"
pyside6-uic "src\instance.ui" -o "src\ui_instance.py"
pyside6-uic "src\settingDialog.ui" -o "src\ui_settingDialog.py"
pyside6-uic "src\about.ui" -o "src\ui_about.py"

View File

@@ -6,16 +6,16 @@ from hatchling.builders.hooks.plugin.interface import BuildHookInterface
class CustomBuildHook(BuildHookInterface):
def clean(self, versions):
if os.name == "posix":
subprocess.run("./clean.sh", check=True)
subprocess.run("./scripts/clean.sh", check=True)
if os.name == "nt":
subprocess.run("clean.bat", check=True, shell=True)
subprocess.run("scripts/clean.cmd", check=True, shell=True)
return super().clean(versions)
def initialize(self, version, build_data):
if os.name == "posix":
subprocess.run("./prepare.sh", check=True)
subprocess.run("./build.sh", check=True)
subprocess.run("./scripts/prepare.sh", check=True)
subprocess.run("./scripts/build.sh", check=True)
if os.name == "nt":
subprocess.run("prepare.bat", check=True)
subprocess.run("build.bat", check=True, shell=True)
subprocess.run("scripts/prepare.cmd", check=True)
subprocess.run("scripts/build.cmd", check=True, shell=True)
return super().initialize(version, build_data)

View File

@@ -2,6 +2,6 @@ import os
import subprocess
if os.name == "posix":
subprocess.run("./packages.sh", check=True)
subprocess.run("./scripts/packages.sh", check=True)
if os.name == "nt":
subprocess.run("packages.bat", check=True, shell=True)
subprocess.run("scripts/packages.cmd", check=True, shell=True)

View File

@@ -1,3 +0,0 @@
cd assets/images
pwsh-bypass.bat

View File

@@ -30,6 +30,7 @@ path = "hatch_build.py"
[tool.hatch.envs.default.scripts]
packages = "python packages.py"
run-app = "run.py"
[tool.hatch.build]
artifacts = [

7
run.py Normal file
View File

@@ -0,0 +1,7 @@
import os
import subprocess
if os.name == "posix":
subprocess.run("./scripts/run.sh", check=True)
if os.name == "nt":
subprocess.run("scripts/run.cmd", check=True, shell=True)

8
scripts/build.cmd Normal file
View File

@@ -0,0 +1,8 @@
@echo off
pyside6-rcc "res.qrc" -o "src\res_rc.py" || exit /b 1
pyside6-uic "src\system_info.ui" -o "src\ui_system_info.py" || exit /b 1
pyside6-uic "src\form.ui" -o "src\ui_form.py" || exit /b 1
pyside6-uic "src\instance.ui" -o "src\ui_instance.py" || exit /b 1
pyside6-uic "src\settingDialog.ui" -o "src\ui_settingDialog.py" || exit /b 1
pyside6-uic "src\about.ui" -o "src\ui_about.py" || exit /b 1

View File

@@ -2,7 +2,7 @@
set -e
if [[ $("uname -s") != "FreeBSD" ]]; then
if [[ $(uname -s) != "FreeBSD" ]]; then
pyside6-rcc "res.qrc" -o "src/res_rc.py" &&
pyside6-uic "src/form.ui" -o "src/ui_form.py" &&
pyside6-uic "src/instance.ui" -o "src/ui_instance.py" &&

View File

@@ -1,5 +1,7 @@
#!/usr/bin/env pwsh
$ErrorActionPreference = 'Stop'
Remove-Item -Path -Recurse dist
Remove-Item -Path "src\res_rc.py"

2
clean.sh → scripts/clean.sh Normal file → Executable file
View File

@@ -1,5 +1,7 @@
#!/usr/bin/env sh
set -e
rm -rf dist/
rm "src/res_rc.py"

View File

@@ -1,2 +1,2 @@
prepare.bat
prepare.bat || exit /b 1
powershell.exe -ExecutionPolicy Bypass -File "packages.ps1"

View File

@@ -1,2 +1,5 @@
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
hatch run python -m nuitka --standalone --assume-yes-for-download --output-dir=dist src/main.py
Compress-Archive -Path dist/main.dist/* -DestinationPath LCE-Qt-Launcher-Windows.zip

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env bash
./prepare.sh
set -e
scripts/prepare.sh
hatch run python -m nuitka --standalone --assume-yes-for-download --output-dir=dist src/main.py
tar -czf LCE-Qt-Launcher-Linux.tar.gz -C dist/main.dist .

3
scripts/prepare.cmd Normal file
View File

@@ -0,0 +1,3 @@
cd assets/images || exit /b 1
pwsh-bypass.bat

View File

@@ -4,6 +4,4 @@ set -e
cd assets/images
chmod +x ./download_img.sh
./download_img.sh

5
scripts/run.cmd Normal file
View File

@@ -0,0 +1,5 @@
@echo off
call .venv/Scripts/activate.bat || exit /b 1
python src/main.py || exit /b 1

8
scripts/run.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e
# shellcheck source=/dev/null
source .venv/bin/activate
src/main.py

View File

@@ -50,14 +50,14 @@ class BuildInfo:
self.license : str = _FALLBACK_LICENSE
except PackageNotFoundError:
term_service.print_error(f"Package not found! More info : {PackageNotFoundError.with_traceback}")
term_service.print_error(f"Package not found! More info : {PackageNotFoundError.with_traceback()}")
self.version : str = _FALLBACK_VERSION_NUMBER
self.app_name = _FALLBACK_APP_NAME
self.git_repo_url : str = _FALLBACK_GIT_REPO_URL
self.license_link : str = _FALLBACK_LICENSE_LINK
self.license : str = _FALLBACK_LICENSE
except RuntimeError:
term_service.print_error(f"Metadata not found! More info : {RuntimeError.with_traceback}")
term_service.print_error(f"Metadata not found! More info : {RuntimeError.with_traceback()}")
self.version : str = _FALLBACK_VERSION_NUMBER
self.app_name = _FALLBACK_APP_NAME
self.git_repo_url : str = _FALLBACK_GIT_REPO_URL