-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathvalidate-extension-structure.ps1
More file actions
61 lines (51 loc) · 2.26 KB
/
validate-extension-structure.ps1
File metadata and controls
61 lines (51 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Script to check all extensions for basic structure
Write-Host "===================================" -ForegroundColor Cyan
Write-Host "Extension Structure Check" -ForegroundColor Cyan
Write-Host "===================================" -ForegroundColor Cyan
Write-Host ""
$extensionsDir = "extensions/individual/en"
$total = 0
$valid = 0
$invalid = 0
# Get all extension directories
$extensions = Get-ChildItem -Path $extensionsDir -Directory
foreach ($ext in $extensions) {
$total++
$extName = $ext.Name
Write-Host "[$total] Checking: $extName" -ForegroundColor Yellow
# Check for required files
$hasManifest = Test-Path "$($ext.FullName)/AndroidManifest.xml"
$hasBuildGradle = Test-Path "$($ext.FullName)/build.gradle"
# Check for source files
$sourceFiles = Get-ChildItem -Path "$($ext.FullName)/src" -Filter "*.kt" -Recurse -ErrorAction SilentlyContinue
$hasSource = $sourceFiles.Count -gt 0
# Report status
if ($hasManifest -and $hasBuildGradle -and $hasSource) {
Write-Host " ✓ Structure: VALID" -ForegroundColor Green
Write-Host " - AndroidManifest.xml: ✓"
Write-Host " - build.gradle: ✓"
Write-Host " - Source files: ✓ ($($sourceFiles.Count) file(s))"
$valid++
} else {
Write-Host " ✗ Structure: INVALID" -ForegroundColor Red
Write-Host " - AndroidManifest.xml: $(if ($hasManifest) { '✓' } else { '✗' })"
Write-Host " - build.gradle: $(if ($hasBuildGradle) { '✓' } else { '✗' })"
Write-Host " - Source files: $(if ($hasSource) { "✓ ($($sourceFiles.Count))" } else { '✗' })"
$invalid++
}
Write-Host ""
}
Write-Host "===================================" -ForegroundColor Cyan
Write-Host "Summary" -ForegroundColor Cyan
Write-Host "===================================" -ForegroundColor Cyan
Write-Host "Total Extensions: $total"
Write-Host "Valid: $valid" -ForegroundColor Green
Write-Host "Invalid: $invalid" -ForegroundColor $(if ($invalid -eq 0) { "Green" } else { "Red" })
Write-Host ""
if ($invalid -eq 0) {
Write-Host "✓ All extensions have valid structure!" -ForegroundColor Green
exit 0
} else {
Write-Host "✗ Some extensions have structural issues" -ForegroundColor Red
exit 1
}