eeg_portal/ai-context.ps1

31 lines
1.5 KiB
PowerShell

$OutFile = "projekt_kontext.txt"
$Files = @()
# 1. Konfigurationen und Abhängigkeiten (Das Ökosystem)
if (Test-Path ".\pom.xml") { $Files += Get-Item ".\pom.xml" }
if (Test-Path ".\eeg_backend\pom.xml") { $Files += Get-Item ".\eeg_backend\pom.xml" }
if (Test-Path ".\eeg_frontend\package.json") { $Files += Get-Item ".\eeg_frontend\package.json" }
# 2. Backend: Java-Klassen (Spring Boot, Hibernate)
# Sucht nur im main-Verzeichnis, um Testklassen automatisch auszuschließen
if (Test-Path ".\eeg_backend\src\main\java") {
$Files += Get-ChildItem -Path ".\eeg_backend\src\main\java" -Filter *.java -Recurse
}
# 3. Frontend: Angular (TypeScript und HTML)
if (Test-Path ".\eeg_frontend\src\app") {
# Wir holen .ts und .html, filtern aber .spec.ts (Tests) hart heraus
$Files += Get-ChildItem -Path ".\eeg_frontend\src\app" -Include *.ts, *.html -Recurse | Where-Object { $_.Name -notmatch "\.spec\.ts$" }
}
# Ausgabe schreiben (UTF8 ist extrem wichtig!)
Clear-Content -Path $OutFile -ErrorAction SilentlyContinue
foreach ($f in $Files) {
"========================================" | Out-File -Append $OutFile -Encoding UTF8
"Datei: $($f.FullName)" | Out-File -Append $OutFile -Encoding UTF8
"========================================" | Out-File -Append $OutFile -Encoding UTF8
Get-Content $f.FullName -Encoding UTF8 | Out-File -Append $OutFile -Encoding UTF8
"`n" | Out-File -Append $OutFile -Encoding UTF8
}
Write-Host "Erfolgreich! Der Kontext für Backend und Frontend wurde in '$OutFile' gespeichert."