Skip to content

Commit 6adf668

Browse files
authored
chore: update sourcery stencil - WPB-11829 (#3804)
1 parent 010dcca commit 6adf668

File tree

10 files changed

+22
-18
lines changed

10 files changed

+22
-18
lines changed

WireAuthentication/Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 5.10
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

WireCalling/Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 6.1
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

WireData/Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 6.1
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

WireDebug/Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 6.0
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

WireDomain/Package.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// swift-tools-version: 6.0
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
1+
// swift-tools-version: 6.2
32

43
import PackageDescription
54

@@ -49,8 +48,10 @@ let package = Package(
4948
)
5049

5150
for target in package.targets {
52-
target.swiftSettings = [
51+
target.swiftSettings = (target.swiftSettings ?? []) + [
52+
.enableUpcomingFeature("ExistentialAny"),
5353
.enableUpcomingFeature("InternalImportsByDefault"),
54-
.enableUpcomingFeature("ExistentialAny")
54+
.enableUpcomingFeature("MemberImportVisibility"),
55+
.enableUpcomingFeature("StrictMemorySafety"),
5556
]
5657
}

WireDomain/Sources/WireUpdateEventCoding/Models/Shared/StorableQualifiedID.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@
1717
//
1818

1919
import Foundation
20-
import WireNetwork
20+
import WireFoundation
2121

2222
struct StorableQualifiedID: Codable, Hashable, Equatable, Sendable {
2323

2424
let id: UUID
2525
let domain: String
2626

27-
init(_ value: WireNetwork.QualifiedID) {
27+
init(_ value: QualifiedID) {
2828
self.id = value.id
2929
self.domain = value.domain
3030
}
3131

32-
func toAPIModel() -> WireNetwork.QualifiedID {
32+
func toAPIModel() -> QualifiedID {
3333
.init(id: id, domain: domain)
3434
}
3535

WireFoundation/Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 6.0
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

WirePlugins/Plugins/SourceryPlugin/Stencils/AutoMockable.stencil

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// along with this program. If not, see http://www.gnu.org/licenses/.
1717
//
1818

19+
// This stencil file is copied from https://github.com/krzysztofzablocki/Sourcery (commit 645c16e9bf3cff2d268fb1a161ff88b0ba1a54bc) and slightly adjusted.
20+
1921
// swiftlint:disable line_length
2022
// swiftlint:disable variable_name
2123

@@ -252,9 +254,11 @@ public import {{ import }}
252254
{% macro existentialVariableTypeName typeName isNotAllowedToBeImplicitlyUnwrappedOptional -%}
253255
{%- if typeName|contains:"<" and typeName|contains:">" -%}
254256
{{ typeName }}
257+
{%- elif typeName|contains:"[" and typeName|contains:"]" -%}
258+
{{ typeName }}
255259
{%- elif typeName|contains:"any " and typeName|contains:"!" -%}
256260
{{ typeName | replace:"any","(any" | replace:"!",")!" }}
257-
{%- elif typeName|contains:"any " and typeName.isOptional -%}
261+
{%- elif typeName|contains:"any " and typeName.isOptional and not typeName|contains:"(" -%}
258262
{{ typeName | replace:"any","(any" | replace:"?",")?" }}
259263
{%- elif typeName|contains:"any " and typeName.isClosure and typeName|contains:"?" -%}
260264
({{ typeName | replace:"any","(any" | replace:"?",")?" }})
@@ -281,7 +285,9 @@ public import {{ import }}
281285
{{ typeName | replace:"inout ","" }}
282286
{%- endif -%}
283287
{% endset %}
284-
{%- if typeName|contains:"any " and typeName|contains:"!" -%}
288+
{%- if typeName|contains:"[" and typeName|contains:"]" -%}
289+
{{ name }}
290+
{%- elif typeName|contains:"any " and typeName|contains:"!" -%}
285291
{{ name | replace:"any","(any" | replace:"!",")?" }}
286292
{%- elif typeName|contains:"any " and typeName.isOptional and typeName.isClosure -%}
287293
({{ typeName.unwrappedTypeName| replace:"inout ","" | replace:"any","(any" | replace:"?",")?" }})?
@@ -314,7 +320,9 @@ public import {{ import }}
314320
{{ typeName | replace:"inout ","" }}
315321
{%- endif -%}
316322
{% endset %}
317-
{%- if typeName|contains:"any " and typeName|contains:"!" -%}
323+
{%- if typeName|contains:"[" and typeName|contains:"]" -%}
324+
{{ name }}
325+
{%- elif typeName|contains:"any " and typeName|contains:"!" -%}
318326
{{ name | replace:"any","(any" | replace:"!",")?" }}
319327
{%- elif typeName|contains:"any " and typeName.isOptional and typeName.isClosure -%}
320328
({{ typeName.unwrappedTypeName| replace:"inout ","" | replace:"any","(any" | replace:"?",")?" }})?
@@ -335,7 +343,9 @@ public import {{ import }}
335343
{%- endif -%}
336344
{%- endmacro %}
337345
{% macro existentialParameterTypeName typeName isVariadic -%}
338-
{%- if typeName|contains:"any " and typeName|contains:"?," and typeName|contains:">?" -%}
346+
{%- if typeName|contains:"[" and typeName|contains:"]" -%}
347+
{{ typeName }}
348+
{%- elif typeName|contains:"any " and typeName|contains:"?," and typeName|contains:">?" -%}
339349
{{ typeName | replace:"any","(any" | replace:"?,",")?," }}
340350
{%- elif typeName|contains:"any " and typeName|contains:"!" -%}
341351
{{ typeName | replace:"any","(any" | replace:"!",")!" }}

WireUI/Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 5.10
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

scripts/Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// swift-tools-version: 5.10
2-
// The swift-tools-version declares the minimum version of Swift required to build this package.
32

43
import PackageDescription
54

0 commit comments

Comments
 (0)