1
- // swift-tools-version:5.3
1
+ // swift-tools-version:5.4
2
2
import PackageDescription
3
3
4
+ var packageDependencies : [ Package . Dependency ] = [ ]
5
+ var calDependencies : [ Target . Dependency ] = [ " AwsCCommon " ]
6
+ var ioDependencies : [ Target . Dependency ] = [ " AwsCCommon " , " AwsCCal " ]
7
+
8
+ #if os(Linux)
9
+ packageDependencies. append ( . package ( name: " S2N " , path: " ./S2N " ) )
10
+
11
+ ioDependencies. append ( . product( name: " S2N " , package : " S2N " ) )
12
+ calDependencies. append ( . product( name: " LibCrypto " , package : " S2N " ) )
13
+ #endif
14
+
4
15
var package = Package ( name: " AwsCrt " ,
5
- platforms: [ . iOS( . v11) , . macOS( . v10_14) ] ,
6
- products: [
7
- . library( name: " AwsCommonRuntimeKit " , targets: [ " AwsCommonRuntimeKit " ] ) ,
8
- . executable( name: " Elasticurl " , targets: [ " Elasticurl " ] )
9
- ] )
16
+ platforms: [ . iOS( . v11) , . macOS( . v10_14) ] ,
17
+ products: [
18
+ . library( name: " AwsCommonRuntimeKit " , targets: [ " AwsCommonRuntimeKit " ] ) ,
19
+ . executable( name: " Elasticurl " , targets: [ " Elasticurl " ] )
20
+ ] ,
21
+ dependencies: packageDependencies
22
+ )
23
+
24
+ let excludesFromAll = [ " bin " , " tests " , " cmake " , " codebuild " , " CONTRIBUTING.md " ,
25
+ " LICENSE " , " format-check.sh " , " NOTICE " , " builder.json " ,
26
+ " sanitizer-blacklist.txt " , " CMakeLists.txt " , " README.md " ,
27
+ " CODE_OF_CONDUCT.md " , " build-deps.sh " ]
10
28
11
29
// aws-c-common config
12
- var awsCCommonPlatformExcludes = [ " source/windows " , " source/android " , " AWSCRTAndroidTestRunner " ,
13
- " cmake " , " codebuild " , " docker-images " , " tests " , " verification " ]
14
- //var unsafeFlagsArray: [String] = []
30
+ var awsCCommonPlatformExcludes = [ " source/windows " , " source/android " ,
31
+ " AWSCRTAndroidTestRunner " , " docker-images " , " verification " ,
32
+ " include/aws/common/ " ]
33
+ awsCCommonPlatformExcludes. append ( contentsOf: excludesFromAll)
15
34
16
35
#if arch(i386) || arch(x86_64)
17
36
awsCCommonPlatformExcludes. append ( " source/arch/arm " )
@@ -33,7 +52,8 @@ awsCCommonPlatformExcludes.append("source/arch/intel/asm")
33
52
awsCCommonPlatformExcludes. append ( " source/arch/arm/asm " )
34
53
#endif
35
54
36
- var awsCIoPlatformExcludes = [ " tests " , " cmake " , " docs " ]
55
+ var awsCIoPlatformExcludes = [ " docs " ]
56
+ awsCIoPlatformExcludes. append ( contentsOf: excludesFromAll)
37
57
38
58
#if os(macOS)
39
59
awsCIoPlatformExcludes. append ( " source/windows " )
@@ -50,46 +70,47 @@ awsCIoPlatformExcludes.append("source/bsd")
50
70
awsCIoPlatformExcludes. append ( " source/darwin " )
51
71
#endif
52
72
53
- var awsCCalPlatformExcludes = [ " tests " , " cmake " ]
73
+ var awsCCalPlatformExcludes = [ " include/aws/cal/private " ]
74
+ awsCCalPlatformExcludes. append ( contentsOf: excludesFromAll)
54
75
55
76
#if os(macOS)
56
77
awsCCalPlatformExcludes. append ( " source/windows " )
57
78
awsCCalPlatformExcludes. append ( " source/unix " )
58
79
#elseif(Windows)
59
- awsCCalPlatformExcludes. append ( " source/darin " )
80
+ awsCCalPlatformExcludes. append ( " source/darwin " )
60
81
awsCCalPlatformExcludes. append ( " source/unix " )
61
82
#else
62
83
awsCCalPlatformExcludes. append ( " source/windows " )
63
84
awsCCalPlatformExcludes. append ( " source/darwin " )
64
85
#endif
65
86
66
- var awsCCompressionPlatformExcludes = [ " tests " , " cmake " , " codebuild " , " source/huffman_generator/ " ]
67
- var awsCHttpPlatformExcludes = [ " tests " , " bin " , " integration-testing " , " continuous-delivery " , " cmake " , " codebuild " ]
68
- var awsCAuthPlatformExcludes = [ " tests " ]
69
- var awsCMqttPlatformExcludes = [ " tests " , " cmake " ]
87
+ var awsCCompressionPlatformExcludes = [ " source/huffman_generator/ " ]
88
+ awsCCompressionPlatformExcludes. append ( contentsOf: excludesFromAll)
89
+ var awsCHttpPlatformExcludes = [ " integration-testing " , " continuous-delivery " , " include/aws/http/private " ]
90
+ awsCHttpPlatformExcludes. append ( contentsOf: excludesFromAll)
91
+ let awsCAuthPlatformExcludes = excludesFromAll
92
+ let awsCMqttPlatformExcludes = excludesFromAll
70
93
71
94
package . targets = ( [
72
95
. target(
73
96
name: " AwsCPlatformConfig " ,
74
97
path: " aws-common-runtime/config " ,
75
- publicHeadersPath: " . "
76
- ) ,
98
+ publicHeadersPath: " . " ) ,
77
99
. target(
78
100
name: " AwsCCommon " ,
79
101
dependencies: [ " AwsCPlatformConfig " ] ,
80
102
path: " aws-common-runtime/aws-c-common " ,
81
103
exclude: awsCCommonPlatformExcludes) ,
104
+ . target(
105
+ name: " AwsCCal " ,
106
+ dependencies: calDependencies,
107
+ path: " aws-common-runtime/aws-c-cal " ,
108
+ exclude: awsCCalPlatformExcludes) ,
82
109
. target(
83
110
name: " AwsCIo " ,
84
- dependencies: [ " AwsCCommon " ] ,
111
+ dependencies: ioDependencies ,
85
112
path: " aws-common-runtime/aws-c-io " ,
86
113
exclude: awsCIoPlatformExcludes) ,
87
- . target(
88
- name: " AwsCCal " ,
89
- dependencies: [ " AwsCCommon " ] ,
90
- path: " aws-common-runtime/aws-c-cal " ,
91
- exclude: awsCCalPlatformExcludes
92
- ) ,
93
114
. target(
94
115
name: " AwsCCompression " ,
95
116
dependencies: [ " AwsCCommon " ] ,
@@ -98,7 +119,7 @@ package.targets = ( [
98
119
) ,
99
120
. target(
100
121
name: " AwsCHttp " ,
101
- dependencies: [ " AwsCCompression " , " AwsCIo " , " AwsCCommon " ] ,
122
+ dependencies: [ " AwsCCompression " , " AwsCIo " , " AwsCCal " , " AwsCCommon " ] ,
102
123
path: " aws-common-runtime/aws-c-http " ,
103
124
exclude: awsCHttpPlatformExcludes
104
125
) ,
@@ -110,9 +131,10 @@ package.targets = ( [
110
131
) ,
111
132
. target(
112
133
name: " AwsCMqtt " ,
113
- dependencies: [ " AwsCHttp " , " AwsCCompression " , " AwsCIo " , " AwsCCommon " ] ,
134
+ dependencies: [ " AwsCHttp " , " AwsCCompression " , " AwsCIo " , " AwsCCal " , " AwsCCommon " ] ,
114
135
path: " aws-common-runtime/aws-c-mqtt " ,
115
- exclude: awsCMqttPlatformExcludes
136
+ exclude: awsCMqttPlatformExcludes,
137
+ cSettings: [ . define( " AWS_MQTT_WITH_WEBSOCKETS " ) ]
116
138
) ,
117
139
. target(
118
140
name: " AwsCommonRuntimeKit " ,
@@ -124,7 +146,7 @@ package.targets = ( [
124
146
dependencies: [ " AwsCommonRuntimeKit " ] ,
125
147
path: " Test "
126
148
) ,
127
- . target (
149
+ . executableTarget (
128
150
name: " Elasticurl " ,
129
151
dependencies: [ " AwsCommonRuntimeKit " ] ,
130
152
path: " Source/Elasticurl "
0 commit comments