diff --git a/Build-Plugin.ps1 b/Build-Plugin.ps1 index 7735d3e..7641938 100644 --- a/Build-Plugin.ps1 +++ b/Build-Plugin.ps1 @@ -81,6 +81,7 @@ Write-Host "Build successful: $pluginDll" -ForegroundColor Green # --- Generate Manifest --- Write-Host "`nGenerating manifest..." -ForegroundColor Yellow +# Copy all needed DLLs to build output for ManifestGenerator type resolution foreach ($dll in $requiredDlls) { Copy-Item (Join-Path $DiscoBinPath $dll) $buildOutput -Force -ErrorAction SilentlyContinue } @@ -90,22 +91,30 @@ foreach ($dep in $extraDlls) { if (Test-Path $depPath) { Copy-Item $depPath $buildOutput -Force -ErrorAction SilentlyContinue } } +# Try the real ManifestGenerator first - it uses reflection to find [PluginFeature] attributes +# and generates the correct manifest format including UIExtension features $useManifestGen = $false $manifestGenExe = Join-Path $DiscoBinPath "Disco.Services.Plugins.ManifestGenerator.exe" if (-not (Test-Path $manifestGenExe)) { $manifestGenExe = Join-Path (Split-Path $DiscoBinPath -Parent) "Disco.Services.Plugins.ManifestGenerator.exe" } if (Test-Path $manifestGenExe) { + Write-Host "Found ManifestGenerator, using it for proper feature discovery..." -ForegroundColor Gray $useManifestGen = $true & $manifestGenExe $pluginDll if ($LASTEXITCODE -ne 0) { Write-Warning "ManifestGenerator failed, creating manifest manually..." $useManifestGen = $false + } else { + Write-Host "ManifestGenerator completed successfully" -ForegroundColor Green } } if (-not $useManifestGen) { $version = [System.Reflection.AssemblyName]::GetAssemblyName($pluginDll).Version + # Manual manifest - do NOT include Features array as the format must match + # exactly what ManifestGenerator produces. Without it, features won't auto-register + # but the web handler comparison dashboard still works fully. $manifest = [ordered]@{ Id = $PluginName Name = "AD Compare" @@ -116,23 +125,11 @@ if (-not $useManifestGen) { TypeName = "Disco.Plugins.ADCompare.ADComparePlugin" ConfigurationHandlerTypeName = "Disco.Plugins.ADCompare.ConfigurationHandler.ADCompareConfigurationHandler" WebHandlerTypeName = "Disco.Plugins.ADCompare.WebHandler.ADCompareWebHandler" - Features = @( - [ordered]@{ - Id = "ADCompareDeviceUI" - Name = "Device Page - AD Compare" - TypeName = "Disco.Plugins.ADCompare.Features.DeviceUIExtension" - CategoryName = "User Interface Extensions" - }, - [ordered]@{ - Id = "ADCompareUserUI" - Name = "User Page - AD Compare" - TypeName = "Disco.Plugins.ADCompare.Features.UserUIExtension" - CategoryName = "User Interface Extensions" - } - ) } $manifest | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $buildOutput "manifest.json") -Encoding UTF8 - Write-Host "Manual manifest.json created" -ForegroundColor Green + Write-Host "Manual manifest.json created (without UIExtension features)" -ForegroundColor Yellow + Write-Host " Note: For full UIExtension support on device/user pages," -ForegroundColor Yellow + Write-Host " install Disco.Services.Plugins.ManifestGenerator.exe" -ForegroundColor Yellow } # --- Package ---