Muta cache-urile text VFP in afara clonei foxbin2prg
ReCreate_FoxBin2Prg.prg face Prg2Bin recursiv pe tot folderul tool-ului (get_FilesFromDirectory intra in orice subfolder), deci _textcache_* aflate sub foxbin2prg erau scanate si .??2-urile din alte proiecte reconvertite in binare parazitare.
Cache-urile stau acum in D:\ROA\_vfp_textcache\{roacnpro,roagest,roaimob}, in afara clonei, unde ReCreate nu le mai poate atinge. Actualizat default CacheRoot in vcx2txt.ps1, exemplele din CLAUDE.md / PROMPT_cautare_vfp.md / git_svn_parallel_init_prompt.md si comentariul din .git/info/exclude.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ This directory is a git clone with two remotes:
|
||||
- **`origin`** = `https://github.com/fdbozzo/foxbin2prg.git` (upstream, read-only). `master` tracks `origin/master` and stays a pristine mirror.
|
||||
- **`romfast`** = `git@gitea.romfast.ro:romfast/foxbin2prg.git` (our fork on Gitea, SSH). Working branch **`romfast`** (default on Gitea) = upstream `master` + the ROA additions committed (`vcx2txt.ps1`, `PROMPT_cautare_vfp.md`, `CLAUDE.md`, `git_svn_parallel_init_prompt.md`). The pre-git local state is kept on branch `local-snapshot-v1.21.04`.
|
||||
|
||||
Update flow (sync fork from upstream): `git fetch origin` → `git checkout master && git merge --ff-only origin/master` → `git checkout romfast && git merge master` → `git push romfast romfast master`. After any update, regenerate binaries/EXE in VFP9 with `DO ReCreate_FoxBin2Prg.prg` (an error about `TESTS\FXUResults.db2` is expected). `_textcache_*` caches and compiled binaries are kept out of git via the upstream `.gitignore` plus `.git/info/exclude`.
|
||||
Update flow (sync fork from upstream): `git fetch origin` → `git checkout master && git merge --ff-only origin/master` → `git checkout romfast && git merge master` → `git push romfast romfast master`. After any update, regenerate binaries/EXE in VFP9 with `DO ReCreate_FoxBin2Prg.prg` (an error about `TESTS\FXUResults.db2` is expected). Text caches live outside this folder (`D:\ROA\_vfp_textcache\`, see below) so `ReCreate` never touches them; compiled binaries are kept out of git via the upstream `.gitignore` plus `.git/info/exclude` (which also still ignores any stray local `_textcache*`).
|
||||
|
||||
It serves two purposes:
|
||||
|
||||
@@ -21,14 +21,14 @@ It serves two purposes:
|
||||
## Local additions (ROA-specific, not part of upstream)
|
||||
|
||||
- **`vcx2txt.ps1`** — PowerShell script that converts the VFP binaries of a project (read from its `.pjx`) into text under a cache folder, so the code inside `.vcx/.scx/.frx/.mnx/.dbc` binaries becomes greppable. Incremental (skips up-to-date files), does not need the VFP IDE open (uses the compiled `FoxBin2Prg.EXE`).
|
||||
- **`_textcache_*` folders** (`_textcache`, `_textcache_roagest`, `_textcache_roaimob`) — per-project regenerable text caches. Safe to delete; never version them.
|
||||
- **Text caches** live **outside this folder**, under `D:\ROA\_vfp_textcache\` (one subfolder per project: `roacnpro`, `roagest`, `roaimob`) — per-project regenerable text caches. Safe to delete; never version them. **They must stay outside `foxbin2prg`**: `ReCreate_FoxBin2Prg.prg` does a recursive `Prg2Bin` over the whole tool folder (`get_FilesFromDirectory` recurses into every subfolder, foxbin2prg.prg:6135) and would reconvert any `.??2` under it back into stray binaries.
|
||||
- **`PROMPT_cautare_vfp.md`** — reusable prompt (Romanian) explaining how to set up this search flow in any VFP project. Read it before working on VFP code search.
|
||||
|
||||
**Golden rule:** the generated text cache is **read-only, for searching only**. Code changes to a VFP project are made in the VFP IDE on the binary files (`.vcx/.scx/...`), never by editing the cached text.
|
||||
|
||||
```powershell
|
||||
# Populate/refresh a project's text cache (incremental)
|
||||
& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Project 'D:\ROA\ROAGEST\roagest.pjx' -ProjectRoot 'D:\ROA\ROAGEST' -CacheRoot 'D:\ROA\UTIL\foxbin2prg\_textcache_roagest'
|
||||
& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Project 'D:\ROA\ROAGEST\roagest.pjx' -ProjectRoot 'D:\ROA\ROAGEST' -CacheRoot 'D:\ROA\_vfp_textcache\roagest'
|
||||
|
||||
# Include reports/menus too: -Types vcx,scx,frx,mnx
|
||||
# One-off conversion of a file/folder not in the project: -Source 'path\to\lib.vcx'
|
||||
|
||||
@@ -41,7 +41,7 @@ IDE-ul VFP, în fișierul binar (.vcx/.scx/...), niciodată în text.
|
||||
PAS 1 — populează cache-ul text (la începutul sesiunii, sau după ce s-a modificat ceva în IDE).
|
||||
Rulează în PowerShell (e incremental — sare peste ce e deja la zi):
|
||||
|
||||
& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Project '<<FISIER_PJX>>' -ProjectRoot '<<RADACINA_PROIECT>>' -CacheRoot 'D:\ROA\UTIL\foxbin2prg\_textcache_<<NUME_PROIECT>>'
|
||||
& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Project '<<FISIER_PJX>>' -ProjectRoot '<<RADACINA_PROIECT>>' -CacheRoot 'D:\ROA\_vfp_textcache\<<NUME_PROIECT>>'
|
||||
|
||||
(Folosește un -CacheRoot distinct per proiect ca să nu amesteci cache-urile. Implicit scriptul
|
||||
convertește doar .vcx și .scx; pentru a include și rapoarte/meniuri adaugă: -Types vcx,scx,frx,mnx)
|
||||
@@ -51,12 +51,12 @@ Dacă scriptul se plânge că lipsește FoxBin2Prg.EXE, trebuie compilat o singu
|
||||
|
||||
PAS 2 — caută în cache cu unealta Grep (NU în binarele originale):
|
||||
|
||||
Grep pe folderul '_textcache_<<NUME_PROIECT>>' pentru numele de metodă/procedură/variabilă căutat.
|
||||
Grep pe folderul 'D:\ROA\_vfp_textcache\<<NUME_PROIECT>>' pentru numele de metodă/procedură/variabilă căutat.
|
||||
Ex.: caută "PROCEDURE do_salvare" sau numele tabelei/cursorului implicat.
|
||||
|
||||
CONVERSIE PUNCTUALĂ (un fișier sau folder care NU e în proiect, ex. o librărie din COMUN):
|
||||
|
||||
& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Source 'CALE\catre\librarie.vcx' -CacheRoot 'D:\ROA\UTIL\foxbin2prg\_textcache_<<NUME_PROIECT>>'
|
||||
& 'D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1' -Source 'CALE\catre\librarie.vcx' -CacheRoot 'D:\ROA\_vfp_textcache\<<NUME_PROIECT>>'
|
||||
|
||||
ALTE OPȚIUNI: -Force (reconvertește tot), -Clean (șterge cache-ul întâi).
|
||||
|
||||
@@ -73,10 +73,13 @@ fișier:linie din cache, dar reține: editarea efectivă se face în IDE-ul VFP
|
||||
|
||||
- `<<NUME_PROIECT>>` îl poți pune orice etichetă scurtă (ex. `roagest`), doar ca numele
|
||||
folderului de cache să fie unic per proiect.
|
||||
- Ține cache-ul în `D:\ROA\_vfp_textcache\`, adică **în afara** folderului `foxbin2prg`. Motiv:
|
||||
`ReCreate_FoxBin2Prg.prg` face `Prg2Bin` recursiv pe tot folderul tool-ului și ar reconverti
|
||||
`.??2`-urile din orice cache aflat sub el înapoi în binare parazitare.
|
||||
- Scriptul citește lista de fișiere direct din `.pjx`, deci convertește **doar** ce folosește
|
||||
efectiv proiectul (rapid), nu tot `COMUN\`.
|
||||
- Cache-ul (`_textcache_*`) e regenerabil și e în afara arborelui de versionare al proiectului —
|
||||
poate fi șters oricând.
|
||||
- Cache-ul (`D:\ROA\_vfp_textcache\<proiect>`) e regenerabil și e în afara arborelui de versionare
|
||||
al proiectului (și în afara clonei foxbin2prg) — poate fi șters oricând.
|
||||
- Conversia NU necesită IDE-ul VFP deschis (folosește `FoxBin2Prg.EXE` compilat).
|
||||
- Ghid complet (varianta ROAACNPRO, cu exemple): `D:\ROA\ROAACNPRO\docs\cautare_vcx_vct.md`.
|
||||
- Tabel corespondență binar → text: `.vcx`→`.vc2`, `.scx`→`.sc2`, `.frx`→`.fr2`, `.mnx`→`.mn2`,
|
||||
|
||||
@@ -61,9 +61,10 @@ Pasi:
|
||||
- Foloseste acelasi vcx2txt.ps1, dar parametrizat pentru proiectul curent (nu ROAACNPRO):
|
||||
powershell -ExecutionPolicy Bypass -File D:\ROA\UTIL\foxbin2prg\vcx2txt.ps1 `
|
||||
-Project D:\ROA\<PROIECT>\<proiect>.PJX -ProjectRoot D:\ROA\<PROIECT> `
|
||||
-CacheRoot D:\ROA\UTIL\foxbin2prg\_textcache_<proiect>
|
||||
- Cache separat per proiect (nu-l amesteca cu _textcache al ROAACNPRO). Grep in cache-ul
|
||||
respectiv, la fel ca in docs\cautare_vcx_vct.md.
|
||||
-CacheRoot D:\ROA\_vfp_textcache\<proiect>
|
||||
- Cache separat per proiect, in D:\ROA\_vfp_textcache\ (in AFARA folderului foxbin2prg, ca
|
||||
ReCreate_FoxBin2Prg.prg sa nu-l reconverteasca). Nu-l amesteca cu cache-ul ROAACNPRO
|
||||
(D:\ROA\_vfp_textcache\roacnpro). Grep in cache-ul respectiv, la fel ca in docs\cautare_vcx_vct.md.
|
||||
|
||||
5. La final, adauga/actualizeaza CLAUDE.md al acestui proiect cu o sectiune scurta: git ruleaza
|
||||
in paralel cu SVN legacy (SVN ramane sursa "vie" pentru COMUN, sincronizat manual catre git);
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
Radacina proiectului (implicit D:\ROA\ROAACNPRO). Caile din .pjx sunt relative la ea.
|
||||
|
||||
.PARAMETER CacheRoot
|
||||
Unde se scrie textul (implicit D:\ROA\UTIL\foxbin2prg\_textcache).
|
||||
Unde se scrie textul (implicit D:\ROA\_vfp_textcache\roacnpro).
|
||||
IMPORTANT: tine cache-ul in AFARA folderului foxbin2prg, altfel ReCreate_FoxBin2Prg.prg
|
||||
(care face Prg2Bin recursiv pe tot folderul tool-ului) reconverteste .??2-urile din cache in binare.
|
||||
|
||||
.PARAMETER Clean
|
||||
Sterge tot cache-ul inainte de conversie (util dupa ce s-au convertit accidental fisiere extra).
|
||||
@@ -53,7 +55,7 @@ param(
|
||||
[string]$Project = 'D:\ROA\ROAACNPRO\roaacnpro.PJX',
|
||||
[string[]]$Types = @('vcx','scx'),
|
||||
[string]$ProjectRoot = 'D:\ROA\ROAACNPRO',
|
||||
[string]$CacheRoot = 'D:\ROA\UTIL\foxbin2prg\_textcache',
|
||||
[string]$CacheRoot = 'D:\ROA\_vfp_textcache\roacnpro',
|
||||
[switch]$Clean,
|
||||
[switch]$Force
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user