You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ark_main_config.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
## **ark.yml**— Workspace Configuration
1
+
## **ark.yml**- Workspace Configuration
2
2
3
-
This file defines the project settings used to build the normalized **BuildContext**. It lives at the workspace root and is created automatically when the workspace is first set in the GUI (if missing).
3
+
This file defines the project settings used to build the normalized **BuildContext**. It lives at the workspace root and is created automatically when the workspace is first configured in the GUI, if missing.
4
4
5
-
The configuration is loaded by `Core/Configs/` and serves as the primary source of truth for project metadata.
5
+
The configuration is loaded by `Core/Configs/` and is the primary source of truth for project metadata.
6
6
7
7
## Minimal Example
8
8
@@ -37,8 +37,8 @@ plugins:
37
37
38
38
Behavior:
39
39
40
-
- When a build is triggered (CLI or GUI), this entrypoint is used to populate the `BuildContext`.
41
-
- In the GUI, you can select any file to compile, but the `project.entry` remains the default configuration.
40
+
- When a build is triggered from the CLI or GUI, this entrypoint is used to populate the `BuildContext`.
41
+
- In the GUI, you can select any file to compile, but `project.entry` remains the default configuration.
42
42
- If it is missing or invalid, compilation is blocked until a valid entrypoint is selected.
43
43
44
44
GUI shortcuts:
@@ -60,7 +60,7 @@ The fields in `ark.yml` are mapped directly to the `BuildContext` data structure
60
60
| `build.data` | `data_mappings` |
61
61
| `build.icon` | `icon` |
62
62
63
-
> **Note**: `workspace.exclude` is exclusive to the GUI workspace view filtering (file explorer). `build.exclude` is what determines which files are ignored during the actual compilation (engine) and BCASL phases.
63
+
> **Note**: `workspace.exclude` is used only for the GUI workspace view filter. `build.exclude` determines which files are ignored during compilation and BCASL phases.
64
64
65
65
## Plugins Configuration
66
66
@@ -71,7 +71,7 @@ plugins:
71
71
bcasl_enabled: true # Global toggle for the BCASL pipeline
72
72
```
73
73
74
-
If `bcasl_enabled` is set to `false`, the entire pipeline is skipped during compilation. This setting is also manageable via the **BCASL Pipeline** dialog in the GUI.
74
+
If `bcasl_enabled` is set to `false`, the entire pipeline is skipped during compilation. You can also change this setting in the **BCASL Pipeline** dialog in the GUI.
Copy file name to clipboardExpand all lines: docs/how_to_create_a_bc_plugin.md
+35-34Lines changed: 35 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
-
## **BC Plugin Guide**
1
+
## **BCASL Plugin Guide**
2
2
3
-
## **BCASL = BeforeCompilation Action System & Loader.**
3
+
**BCASL = Before-Compilation Action System & Loader.**
4
4
5
5
**Overview**
6
-
A BC plugin (BCASL) is a package placed in `Plugins/` and executed before compilation. It registers automatically, respects execution order (priority, tags, dependencies), and uses `PreCompileContext` to work with the workspace.
6
+
A BC plugin is a package placed in `Plugins/` and executed before compilation. It registers automatically, respects execution order (priority, tags, dependencies), and uses `PreCompileContext` to work with the workspace.
7
7
8
-
The BCASL engine and loader are **pure-Python** modules, meaning they can run in headless environments (CLI, CI) without any Qt dependencies. UI integration is provided separately by the ARK GUI.
8
+
The BCASL loader and runtime are **pure-Python**. They run in headless environments (CLI, CI) without Qt dependencies. UI integration is provided separately by the ARK GUI.
9
9
10
10
**Discovery And Loading**
11
11
12
12
- Plugins are discovered in `Plugins/<plugin_name>/`.
13
13
- The folder must contain an `__init__.py`.
14
14
- The loader imports each package and detects plugins via `@bc_register` or `bcasl_register(manager)`.
15
-
- If `bcasl.yml` is missing, a default file is generated.
15
+
- If `bcasl.yml` is missing, BCASL generates a best-effort default file when it runs.
16
16
17
17
**Package Layout**
18
18
@@ -53,8 +53,8 @@ class ExampleClean(BcPluginBase):
# Accès au dossier de sortie défini dans ark.yml ou le verrou
153
+
# Access the output directory defined in ark.yml or the lock file.
154
154
output_dir = ctx.build_context.output_dir
155
155
...
156
156
```
157
157
158
-
*Exemple concret : Le plugin **OutputCleaner** utilise `ctx.build_context.output_dir` pour vider le dossier de sortie avant la compilation.*
158
+
*Example: the **OutputCleaner** plugin uses `ctx.build_context.output_dir` to clear the output directory before compilation.*
159
159
160
-
Usage simplifié :
160
+
Simplified usage:
161
161
162
162
```python
163
-
# Parcourt tous les fichiers du projet selon la config bcasl.yml
163
+
# Iterate over all project files using the bcasl.yml configuration.
164
164
for path in ctx.iter_files():
165
165
...
166
166
167
-
# Recherche spécifique tout en respectant les exclusions globales
167
+
# Search specific files while still respecting global exclusions.
168
168
for path in ctx.iter_files(["**/*.json"]):
169
169
...
170
170
```
@@ -180,8 +180,8 @@ ok = set_selected_workspace("/path/to/new/workspace")
180
180
181
181
Behavior.
182
182
183
-
- The request is accepted by contract (returns True).
184
-
- The target directory is created if needed (best‑effort).
183
+
- The request is accepted by contract (returns `True`).
184
+
- The target directory is created if needed, besteffort.
185
185
- If the UI is present, the Core applies the change and may stop ongoing builds.
186
186
- After requesting a switch, avoid using the old `ctx` for sensitive actions.
187
187
@@ -190,10 +190,10 @@ Behavior.
190
190
- Use `Plugins_SDK.GeneralContext.Dialog` for messages and progress.
191
191
- When running in the GUI, dialogs are routed through the UI thread and inherit the theme.
192
192
- In headless/CLI mode, these are routed to standard output.
193
-
- **Important**: Plugins should avoid direct Qt imports to remain compatible with headless execution. Direct Qt dialogs (like `QProgressDialog`) are not supported in sandboxed or headless runs.
193
+
- **Important**: Avoid direct Qt imports to remain compatible with headless execution. Direct Qt dialogs such as `QProgressDialog` are not supported in sandboxed or headless runs.
194
194
195
195
**Plugin UI Config Tabs**
196
-
BCASL can expose per‑plugin configuration tabs in the BCASL config UI.
196
+
BCASL can expose per-plugin configuration tabs in the BCASL config UI.
197
197
198
198
Implement:
199
199
@@ -207,12 +207,13 @@ Notes.
207
207
208
208
- `config`is a dict to read/write.
209
209
- `on_save(config_dict)`can return an updated dict.
210
-
- Saved under `plugins.<id>.config` in `bcasl.yml`.
210
+
- Each plugin entry stores its config in the `config` field inside the `plugins` collection in `bcasl.yml`.
211
+
- `build_config_tab(...)`may return a widget, a `(title, widget)` tuple, a `(title, widget, on_save)` tuple, or a dict with `title`, `widget`, and `on_save`.
211
212
212
213
**Plugin i18n (GeneralContext)**
213
214
Plugins can use the SDK i18n system with a `languages/` folder in the plugin package.
214
-
The Core now propagates language changes to the Plugin SDK automatically, and the
215
-
SDK loads translations for all plugins found in `Plugins/` (by folder name).
215
+
The Core propagates language changes to the Plugin SDK, and the SDK loads
216
+
translations for plugins found in `Plugins/` by folder name.
216
217
217
218
Example layout:
218
219
@@ -224,7 +225,7 @@ Plugins/MyPlugin/
224
225
fr.json
225
226
```
226
227
227
-
Load and use (with live updates when the language changes):
228
+
Load and use, with live updates when the language changes:
228
229
229
230
```python
230
231
from Plugins_SDK.GeneralContext import (
@@ -251,10 +252,10 @@ Notes.
251
252
252
253
- If `options.sandbox` is `true`, plugins can run in isolated processes.
253
254
- Resource limits via `options.plugin_limits` (mem, cpu, files, size).
254
-
- Note: Global timeout and parallelism are no longer supported to ensure sequential stability.
255
+
- Note: global timeout and parallelism are no longer supported to keep execution sequential.
Copy file name to clipboardExpand all lines: docs/how_to_create_an_engine.md
+28-20Lines changed: 28 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ A PyCompiler_ARK engine is a Python package placed in `engines/` and auto‑load
10
10
11
11
- Engines are discovered only in `engines/<engine_id>/`.
12
12
- The folder must contain an `__init__.py`.
13
-
-At startup, `EngineLoader` scans `engines/` and imports each package.
13
+
-Discovery is lazy: the registry loads engines on first real access such as `get_engine`, `available_engines`, `create`, or `bind_tabs`.
14
14
- Auto discovery can be disabled with `ARK_ENGINES_AUTO_DISCOVER=0`.
15
15
16
16
### **Package Layout**
@@ -55,9 +55,12 @@ class MyEngine(CompilerEngine):
55
55
56
56
### **Workspace Entrypoint**
57
57
58
-
The workspace can define a single build entrypoint in `ark.yml`.
59
-
When `build.entrypoint` is set, the Core will compile only that file and pass it
60
-
to your engine as the `entry_point` in the `BuildContext`. See `docs/ark.md`.
58
+
The workspace defines its entrypoint in `ark.yml` under `project.entry`.
59
+
That value is normalized by Core into `BuildContext.entry_point` and used as the
60
+
primary script for compilation. A legacy `build.entrypoint` key is still accepted
61
+
as a fallback during normalization, but `project.entry` is the canonical field.
62
+
63
+
See `docs/ark_main_config.md`.
61
64
62
65
### **Full API**
63
66
@@ -98,8 +101,8 @@ Tools and dependencies.
98
101
99
102
- In `create_tab`, create widgets and store them on `self` (ex: `self._opt_onefile`).
100
103
- Avoid heavy work in `__init__` to keep loading fast.
101
-
- Wire signals locally and use`gui.log.append(...)` for logs.
102
-
-No need to wrap your tab in a scroll area: the UI handles large tabs automatically when needed.
104
+
- Wire signals locally and prefer`gui.log.append(...)` for logs.
105
+
-Do not add your own scroll area unless you need custom behavior; the host wraps large engine tabs automatically.
103
106
-**IMPORTANT**: Do not include UI components for **Icon** selection or **Output directory** in your engine tab. These are globally managed in `ark.yml` and passed to your engine via the `BuildContext`. Focus only on engine‑specific flags and options.
104
107
- Prefer grouping options with `QGroupBox` sections and compact hints, following the built-in engines layout style.
105
108
- Keep widget attribute names stable once they are used by config persistence or compilation logic.
@@ -146,8 +149,7 @@ Notes.
146
149
147
150
### **Advanced Config Control (Special Engines)**
148
151
149
-
Special engines can fully control where/how config is stored and whether the UI
150
-
is allowed to save it.
152
+
Special engines can override where config is stored and whether the UI may save it.
If a custom loader/saver returns `None`, Core falls back to the default
162
-
`.ark/<engine_id>/config.json` behavior.
163
+
If a custom loader returns `None`, Core falls back to the default
164
+
`.ark/<engine_id>/config.json` behavior. A custom saver that returns `None`
165
+
also falls back to the default storage path.
163
166
164
167
#### Example: custom path + read‑only UI
165
168
@@ -348,14 +351,18 @@ Notes.
348
351
- If a key is missing, always provide a safe fallback string.
349
352
350
353
**Auto Command Builder (Integrated)**
351
-
The auto‑builder is now integrated directly into the core compilation pipeline. It automatically reads a `mapping.json` in your engine's root directory to generate options from detected imports.
354
+
The auto-builder is integrated into the core compilation pipeline. It can read
355
+
`mapping.json` from the engine package, the workspace `engines/<engine_id>/`
356
+
folder, or the `PYCOMPILER_MAPPING` environment variable to generate options
357
+
from detected modules.
352
358
353
359
You no longer need to call `compute_auto_for_engine` manually in your `build_command`. The core runner will:
354
360
355
-
1. Detect modules imported in the project.
356
-
2. Read your engine's `mapping.json`.
357
-
3. Generate the appropriate flags.
358
-
4. Automatically insert them into your command (usually before the entry point).
361
+
1. Prefer `requirements.txt` or `requirements.in` when present.
362
+
2. Fall back to `pyproject.toml` dependencies.
363
+
3. Fall back to scanning Python imports.
364
+
4. Read the engine mapping and generate the appropriate flags.
365
+
5. Insert them into your command, usually before the entry point.
359
366
360
367
#### **Minimal mapping.json example.**
361
368
@@ -374,10 +381,11 @@ You no longer need to call `compute_auto_for_engine` manually in your `build_com
374
381
375
382
Key points.
376
383
377
-
- Top‑level keys are package names.
384
+
- Top-level keys are package names.
378
385
- Engine values accept `str`, `list[str]`, or `dict` with `args` or `flags`.
379
-
-`"{import_name}"` is replaced by the actual import name.
380
-
- For advanced logic, expose `AUTO_BUILDER` in `engines/<engine_id>/auto_plugins.py`.
386
+
-`"{import_name}"` is replaced by the matched import name.
387
+
- For advanced logic, expose `AUTO_BUILDER`, `get_auto_builder()`, or
388
+
`register_auto_builder()` in `engines/<engine_id>/auto_plugins.py`.
381
389
382
390
**Deep Examples Catalog (40)**
383
391
Each example includes context, intent, and a working pattern. Adjust IDs and labels to match your engine.
0 commit comments