From f746a3b2cf67653934cebf62c2f34a20670d32e5 Mon Sep 17 00:00:00 2001 From: david-swift Date: Sat, 8 Feb 2025 13:27:03 +0100 Subject: [PATCH] Remove outdated warning --- Package.swift | 2 +- README.md | 13 +------------ generate-bindings.ps1 | 7 +++++-- projections.json | 2 +- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Package.swift b/Package.swift index 00add87..86d24c8 100644 --- a/Package.swift +++ b/Package.swift @@ -8,7 +8,7 @@ let package = Package( .library(name: "WindowsFoundation", type: .dynamic, targets: ["WindowsFoundation"]), ], dependencies: [ - .package(url: "https://github.com/thebrowsercompany/swift-cwinrt", branch: "main"), + .package(url: "https://git.aparoksha.dev/winui-swift/swift-cwinrt", branch: "main"), ], targets: [ .target( diff --git a/README.md b/README.md index 34ace16..eaaa496 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,9 @@ # Swift Language Bindings for `Windows.Foundation` APIs -> [!WARNING] -> This project contains an outdated snapshot of a subset of WinRT projections generated with [swift-winrt](https://github.com/thebrowsercompany/swift-winrt), provided for illustration purposes. To use WinRT APIs in your Swift project, we recommend using [swift-winrt](https://github.com/thebrowsercompany/swift-winrt) directly to generate your own projections. +This is based on [thebrowsercompany/swift-windowsfoundation](https://github.com/thebrowsercompany/swift-windowsfoundation). This repository contains the Swift/WinRT language bindings for types in the `Windows.Foundation` namespace. It also contains general helper APIs used throughout all generated bindings. -These APIs are intended to be used in conjuction with the following projects: -- [swift-uwp](https://github.com/thebrowsercompany/swift-uwp) -- [swift-winui](https://github.com/thebrowsercompany/swift-winui) -- [swift-windowsappsdk](https://github.com/thebrowsercompany/swift-windowsappsdk) -- [swift-win2d](https://github.com/thebrowsercompany/swift-win2d) - -## Filing Issues - -Please file any issues you have with this repository on https://github.com/thebrowsercompany/swift-winrt - ## Known Issues and Limitations - The developer experience for consuming WinRT APIs from Swift is a work in progress. Due to current limitations, not all APIs can be generated as this causes export limit issues. diff --git a/generate-bindings.ps1 b/generate-bindings.ps1 index 05778fb..fd468e2 100644 --- a/generate-bindings.ps1 +++ b/generate-bindings.ps1 @@ -40,10 +40,11 @@ function Restore-Nuget { New-Item -ItemType Directory -Path "$PSScriptRoot\.packages" | Out-Null } $PackagesConfigPath = Join-Path $PSScriptRoot ".packages\packages.config" - $PackagesConfigContent | Out-File -FilePath $PackagesConfigPath + $PackagesConfigContent | Out-File -FilePath $PackagesConfigPath -Encoding ascii & $NugetDownloadPath restore $PackagesConfigPath -PackagesDirectory $PackagesDir | Out-Null if ($LASTEXITCODE -ne 0) { + Write-Host "Nuget restore failed!" -ForegroundColor Red exit 1 } } @@ -114,9 +115,10 @@ function Invoke-SwiftWinRT() { $RspParams += "-input $($_.FullName)`n" } } + # write rsp params to file $RspFile = Join-Path $PSScriptRoot "swift-winrt.rsp" - $RspParams | Out-File -FilePath $RspFile + $RspParams | Out-File -FilePath $RspFile -Encoding ascii & $PackagesDir\TheBrowserCompany.SwiftWinRT.$SwiftWinRTVersion\bin\swiftwinrt.exe "@$RspFile" if ($LASTEXITCODE -ne 0) { @@ -132,6 +134,7 @@ function Invoke-SwiftWinRT() { Copy-Project -OutputLocation $OutputLocation -ProjectName $Projections.Project } } + $PackagesDir = Join-Path $PSScriptRoot ".packages" Restore-Nuget -PackagesDir $PackagesDir Invoke-SwiftWinRT -PackagesDir $PackagesDir diff --git a/projections.json b/projections.json index 8eb2c47..da7be6a 100644 --- a/projections.json +++ b/projections.json @@ -10,7 +10,7 @@ "include": [ "Windows.Foundation.Collections", "Windows.Foundation.Numerics", - "Windows.Foundation", + "Windows.Foundation" ], "exclude": [ "Windows.Foundation.PropertyValue"