Compare commits

..

2 commits
v1.0.0 ... main

Author SHA1 Message Date
ltadeu6
afe65f4245
Atualiza CLAUDE.md e README com processo de build de release e downloads
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:25:49 -03:00
ltadeu6
5f94667bf9
Configura electron-builder para AppImage (Linux) e NSIS (Windows)
- package.json: appId, linux AppImage target, win NSIS target
- res/electron/build.json: config completa para electron-builder v26

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:53:33 -03:00
4 changed files with 64 additions and 10 deletions

View file

@ -24,11 +24,50 @@ Tests use Node.js directly — no test runner or build step needed.
### Run / build (Electron) ### Run / build (Electron)
```sh ```sh
cordova run electron # dev run nix-shell --run "cordova run electron" # dev run
cordova build electron --release --verbose # release build
``` ```
### Run on Android Release build produces an AppImage (Linux) in two steps — cordova-electron bundles electron-builder v24 which ignores the Linux target, so electron-builder v26 from devDependencies is called directly:
```sh
nix-shell --run "cordova build electron --release" # prepare platform
nix-shell --run "node_modules/.bin/electron-builder --linux AppImage --config res/electron/build.json"
# output: platforms/electron/build/BioLab-1.0.0.AppImage
```
### Build release APK (Android)
Signing keys are managed via agenix (`android-signing-env`). Use `--packageType=apk` to force APK output instead of AAB:
```sh
android-signing-env python3 -c "
import json, os
cfg = {'android': {'release': {
'keystore': os.environ['ANDROID_KEYSTORE_PATH'],
'keystoreType': 'pkcs12',
'alias': os.environ['ANDROID_KEY_ALIAS'],
'storePassword': os.environ['ANDROID_KEYSTORE_PASSWORD'],
'password': os.environ['ANDROID_KEY_PASSWORD']
}}}
open('/tmp/biolab-build.json','w').write(__import__('json').dumps(cfg))
"
nix-shell --run "ANDROID_HOME=\$HOME/Android/Sdk ANDROID_SDK_ROOT=\$HOME/Android/Sdk \
GRADLE_USER_HOME=\$(pwd)/.gradle \
cordova build android --release --buildConfig /tmp/biolab-build.json -- --packageType=apk"
rm /tmp/biolab-build.json
# output: platforms/android/app/build/outputs/apk/release/app-release.apk
```
### Build release .exe (Windows VM)
```sh
# VM: user@192.168.122.187, cordova global at C:\Users\User\AppData\Roaming\npm\cordova.cmd
ssh user@192.168.122.187 "cd C:\\Users\\user\\BioLab && git pull && C:\\Users\\User\\AppData\\Roaming\\npm\\cordova.cmd build electron --release"
scp "user@192.168.122.187:C:/Users/user/BioLab/platforms/electron/build/BioLab Setup 1.0.0.exe" /tmp/
# output: /tmp/BioLab Setup 1.0.0.exe
```
### Run on Android (dev)
```sh ```sh
# Set up environment first (or source env.sh): # Set up environment first (or source env.sh):
@ -57,7 +96,6 @@ www/
search.js — orchestrates everything: builds ODE functions (model × Pirt coupling), search.js — orchestrates everything: builds ODE functions (model × Pirt coupling),
runs PSO per model, renders Plotly charts, computes AIC, sorts results runs PSO per model, renders Plotly charts, computes AIC, sorts results
rrandom.js — Math.random wrapper used by PSO rrandom.js — Math.random wrapper used by PSO
solve.js — standalone legacy helper (not imported by search.js)
tests/ tests/
demo.mjs — smoke test: PSO converges to a finite error demo.mjs — smoke test: PSO converges to a finite error
synthetic-search.mjs — accuracy test: PSO recovers known Monod params from synthetic data synthetic-search.mjs — accuracy test: PSO recovers known Monod params from synthetic data
@ -82,4 +120,3 @@ www/
- External CDN dependencies: KaTeX (math rendering), Plotly (charts). Both are loaded in `index.html`; `search.js` assumes `Plotly` and `katex` are globals. - External CDN dependencies: KaTeX (math rendering), Plotly (charts). Both are loaded in `index.html`; `search.js` assumes `Plotly` and `katex` are globals.
- The `Objective` constructor detects column order from header keywords (Portuguese and English), so column order in the data table matters only when headers are absent or unrecognized. - The `Objective` constructor detects column order from header keywords (Portuguese and English), so column order in the data table matters only when headers are absent or unrecognized.
- `PSO` uses `Math.random` directly — `synthetic-search.mjs` patches it with a deterministic LCG for reproducible test results. - `PSO` uses `Math.random` directly — `synthetic-search.mjs` patches it with a deterministic LCG for reproducible test results.
- `solve.js` is a legacy standalone function that references globals (`RK4`, `Plotly`, `document`) and is not imported anywhere in the current codebase.

View file

@ -2,7 +2,13 @@
Ferramenta web para estimativa de parâmetros cinéticos de crescimento microbiano e consumo de substrato. Ferramenta web para estimativa de parâmetros cinéticos de crescimento microbiano e consumo de substrato.
Acesse em: **[biolab.tadix.dev](https://biolab.tadix.dev)** Acesse em: **[biolab.tadix.dev](https://biolab.tadix.dev)** — ou baixe o app para desktop/Android:
| Plataforma | Download |
|---|---|
| Linux (AppImage) | [BioLab-1.0.0.AppImage](https://git.tadix.dev/ltadeu6/BioLab/releases/tag/v1.0.0) |
| Windows (instalador) | [BioLab-Setup-1.0.0.exe](https://git.tadix.dev/ltadeu6/BioLab/releases/tag/v1.0.0) |
| Android (APK) | [BioLab-1.0.0.apk](https://git.tadix.dev/ltadeu6/BioLab/releases/tag/v1.0.0) |
## Como funciona ## Como funciona

View file

@ -24,14 +24,23 @@
] ]
}, },
"build": { "build": {
"appId": "com.tadeu.biolab", "appId": "dev.tadix.biolab",
"productName": "BioLab", "productName": "BioLab",
"directories": { "directories": {
"buildResources": "resources" "buildResources": "res"
},
"linux": {
"target": "AppImage",
"icon": "res/icon.png",
"category": "Science"
}, },
"win": { "win": {
"target": "nsis", "target": "nsis",
"icon": "resources/icon.ico" "icon": "res/icon.ico"
},
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true
} }
} }
} }

View file

@ -2,7 +2,9 @@
"appId": "dev.tadix.biolab", "appId": "dev.tadix.biolab",
"productName": "BioLab", "productName": "BioLab",
"directories": { "directories": {
"buildResources": "res" "buildResources": "res",
"app": "platforms/electron/www",
"output": "platforms/electron/build"
}, },
"linux": { "linux": {
"target": "AppImage", "target": "AppImage",