From 34f5b46d60cb1d78d8a39c4f5f9c6e8360e37d78 Mon Sep 17 00:00:00 2001 From: david-swift Date: Mon, 30 Sep 2024 22:31:07 +0200 Subject: [PATCH] Update to Swift 6 --- .github/workflows/docs.yml | 4 ++-- Package.swift | 5 +++-- Sources/Adwaita/Model/Extensions/Int.swift | 2 +- Sources/Generation/Extensions/String.swift | 2 +- Sources/Generation/GIR/Property.swift | 5 +---- io.github.AparokshaUI.Demo.json | 8 ++++---- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4390761..25122c2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,7 +19,7 @@ jobs: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: macos-14 + runs-on: macos-15 steps: - uses: actions/checkout@v4 - name: Install Libadwaita @@ -47,7 +47,7 @@ jobs: run: | echo "" > docs/index.html; sed -i '' 's/#06f/#ea3358/g' docs/css/documentation-topic~topic~tutorials-overview.d6f5411c.css - sed -i '' 's/,2px/,10px/g' docs/css/index.038e887c.css + sed -i '' 's/,2px/,10px/g' docs/css/index.*.css - name: Upload Artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/Package.swift b/Package.swift index be5cc63..336c978 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.9 +// swift-tools-version: 6.0 // // Package.swift // Adwaita @@ -53,5 +53,6 @@ let package = Package( name: "Demo", dependencies: ["Adwaita"] ) - ] + ], + swiftLanguageModes: [.v5] ) diff --git a/Sources/Adwaita/Model/Extensions/Int.swift b/Sources/Adwaita/Model/Extensions/Int.swift index 3a40f74..31e3985 100644 --- a/Sources/Adwaita/Model/Extensions/Int.swift +++ b/Sources/Adwaita/Model/Extensions/Int.swift @@ -5,7 +5,7 @@ // Created by david-swift on 15.01.24. // -extension Int: Identifiable { +extension Int: @retroactive Identifiable { /// Get the integer itself as the identifier. public var id: Int { self } diff --git a/Sources/Generation/Extensions/String.swift b/Sources/Generation/Extensions/String.swift index 5a9e791..2acdbbe 100644 --- a/Sources/Generation/Extensions/String.swift +++ b/Sources/Generation/Extensions/String.swift @@ -5,7 +5,7 @@ // Created by david-swift on 14.01.24. // -extension String: CodingKey { +extension String: @retroactive CodingKey { /// The string. public var stringValue: String { diff --git a/Sources/Generation/GIR/Property.swift b/Sources/Generation/GIR/Property.swift index add6ddd..2caeba9 100644 --- a/Sources/Generation/GIR/Property.swift +++ b/Sources/Generation/GIR/Property.swift @@ -89,15 +89,12 @@ struct Property: Decodable { let property = convertPropertyName(configuration: genConfig) let builder = ((type?.isWidget ?? false) || (type?.isMenu ?? false)) ? "@ViewBuilder " : "" let mainParameter = parameter(config: config, genConfig: genConfig, modifier: true, defaultValue: true) - var sideParameters = "" - var sideAssignments = "" return """ \(doc?.docComment(indent: " ") ?? "/// \(name)") - public func \(convertPropertyName(configuration: genConfig))(\(sideParameters)\(builder)_ \(mainParameter)) -> Self { + public func \(convertPropertyName(configuration: genConfig))(\(builder)_ \(mainParameter)) -> Self { var newSelf = self newSelf.\(property) = \(property) - \(sideAssignments) return newSelf } diff --git a/io.github.AparokshaUI.Demo.json b/io.github.AparokshaUI.Demo.json index 4865375..b8416c7 100644 --- a/io.github.AparokshaUI.Demo.json +++ b/io.github.AparokshaUI.Demo.json @@ -1,10 +1,10 @@ { "app-id": "io.github.AparokshaUI.Demo", "runtime": "org.gnome.Platform", - "runtime-version": "46", + "runtime-version": "47", "sdk": "org.gnome.Sdk", "sdk-extensions": [ - "org.freedesktop.Sdk.Extension.swift5" + "org.freedesktop.Sdk.Extension.swift6" ], "command": "Demo", "finish-args": [ @@ -15,8 +15,8 @@ "--socket=wayland" ], "build-options": { - "append-path": "/usr/lib/sdk/swift5/bin", - "prepend-ld-library-path": "/usr/lib/sdk/swift5/lib" + "append-path": "/usr/lib/sdk/swift6/bin", + "prepend-ld-library-path": "/usr/lib/sdk/swift6/lib" }, "cleanup": [ "/include",