Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions scripts/generate-cocoa-bindings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,49 @@ if (!(Get-Command sharpie -ErrorAction SilentlyContinue))
# Ensure Xamarin is installed (or sharpie won't produce expected output).
if (!(Test-Path '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/64bits/iOS/Xamarin.iOS.dll'))
{
Write-Output 'Xamarin.iOS not found. Attempting to install via Homebrew.'
brew install --cask xamarin-ios
Write-Output 'Xamarin.iOS not found. Attempting to install manually.'

# Download Xamarin.iOS package
$packageName = 'xamarin.ios-16.4.0.23.pkg'
$directDownloadUrl = 'https://github.com/jamescrosswell/xamarin-ios/releases/download/16.4.0.23/Xamarin.iOS.16.4.0.23.pkg'
$downloadPath = "/tmp/$packageName"

Write-Output "Downloading Xamarin.iOS package..."
curl -L -o $downloadPath $directDownloadUrl

if ($LASTEXITCODE -ne 0)
{
Write-Error "Failed to download Xamarin.iOS package. Exit code: $LASTEXITCODE"
}

if (Test-Path $downloadPath)
{
Write-Output "Downloaded package to $downloadPath"
Write-Output "Installing Xamarin.iOS package..."

# Install the package using installer command (requires sudo)
sudo installer -pkg $downloadPath -target /

if ($LASTEXITCODE -ne 0)
{
Write-Error "Failed to install Xamarin.iOS package. Exit code: $LASTEXITCODE"
}
else
{
Write-Output "Xamarin.iOS package installed successfully"
}

# Clean up downloaded file
Remove-Item $downloadPath -Force -ErrorAction SilentlyContinue
}
else
{
Write-Error "Downloaded package not found at $downloadPath"
}

if (!(Test-Path '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/64bits/iOS/Xamarin.iOS.dll'))
{
Write-Error 'Xamarin.iOS not found. Try installing manually from: https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/.'
Write-Error 'Xamarin.iOS not found after installation.'
}
}

Expand Down
Loading