@@ -109,12 +109,17 @@ struct XcodeBuilder {
109
109
" xcodebuild " ,
110
110
" -project " , self . path. pathString,
111
111
" -configuration " , self . options. configuration. xcodeConfigurationName,
112
- " -archivePath " , self . buildDirectory. appendingPathComponent ( self . productName ( target: target) ) . appendingPathComponent ( sdk. archiveName) . path,
113
112
" -destination " , sdk. destination,
114
113
" BUILD_DIR= \( self . buildDirectory. path) " ,
115
114
" SKIP_INSTALL=NO "
116
115
]
117
116
117
+ if self . options. action == . archive {
118
+ command += [
119
+ " -archivePath " , self . buildDirectory. appendingPathComponent ( self . productName ( target: target) ) . appendingPathComponent ( sdk. archiveName) . path,
120
+ ]
121
+ }
122
+
118
123
// add SDK-specific build settings
119
124
if let settings = sdk. buildSettings {
120
125
for setting in settings {
@@ -136,19 +141,30 @@ struct XcodeBuilder {
136
141
command += [ " -scheme " , target ]
137
142
138
143
// and the command
139
- command += [ " archive " ]
144
+ if self . options. action == . build {
145
+ command += [ " build " ]
146
+ } else {
147
+ command += [ " archive " ]
148
+ }
140
149
141
150
return command
142
151
}
143
152
144
153
// we should probably pull this from the build output but we just make assumptions here
145
154
private func frameworkPath ( target: String , sdk: TargetPlatform . SDK ) -> Foundation . URL {
146
- return self . buildDirectory
147
- . appendingPathComponent ( self . productName ( target: target) )
148
- . appendingPathComponent ( sdk. archiveName)
149
- . appendingPathComponent ( " Products/Library/Frameworks " )
150
- . appendingPathComponent ( " \( self . productName ( target: target) ) .framework " )
151
- . absoluteURL
155
+ if self . options. action == . build {
156
+ return self . buildDirectory
157
+ . appendingPathComponent ( sdk. releaseFolder)
158
+ . appendingPathComponent ( " \( self . productName ( target: target) ) .framework " )
159
+ . absoluteURL
160
+ } else {
161
+ return self . buildDirectory
162
+ . appendingPathComponent ( self . productName ( target: target) )
163
+ . appendingPathComponent ( sdk. archiveName)
164
+ . appendingPathComponent ( " Products/Library/Frameworks " )
165
+ . appendingPathComponent ( " \( self . productName ( target: target) ) .framework " )
166
+ . absoluteURL
167
+ }
152
168
}
153
169
154
170
// MARK: - Debug Symbols
0 commit comments