@@ -23,16 +23,8 @@ public struct DependencySettings : Serializable, Sendable, Encodable {
23
23
public let dependencies : OrderedSet < String >
24
24
public let verification : Bool
25
25
26
-
27
- public init ( _ scope: MacroEvaluationScope ) {
28
- self . init (
29
- dependencies: scope. evaluate ( BuiltinMacros . DEPENDENCIES) ,
30
- verification: scope. evaluate ( BuiltinMacros . DEPENDENCIES_VERIFICATION)
31
- )
32
- }
33
-
34
26
public init (
35
- dependencies: [ String ] ,
27
+ dependencies: any Sequence < String > ,
36
28
verification: Bool
37
29
) {
38
30
self . dependencies = OrderedSet ( dependencies)
@@ -51,7 +43,22 @@ public struct DependencySettings : Serializable, Sendable, Encodable {
51
43
self . dependencies = try deserializer. deserialize ( )
52
44
self . verification = try deserializer. deserialize ( )
53
45
}
46
+ }
54
47
48
+ extension DependencySettings {
49
+ public init ( _ scope: MacroEvaluationScope ) {
50
+ let dependencies = scope. evaluate ( BuiltinMacros . DEPENDENCIES)
51
+
52
+ // We cannot distinguish between "DEPENDENCIES" not set and set to an empty list.
53
+ // Turn verification off it we have an empty list, assuming that it is not set.
54
+ // This means that there is no way at the moment to declare that a project with no dependencies should have verification enabled.
55
+ let verification = !dependencies. isEmpty && scope. evaluate ( BuiltinMacros . DEPENDENCIES_VERIFICATION)
56
+
57
+ self . init (
58
+ dependencies: dependencies,
59
+ verification: verification
60
+ )
61
+ }
55
62
}
56
63
57
64
// Task-specific settings
0 commit comments