@@ -109,12 +109,17 @@ struct XcodeBuilder {
109109 " xcodebuild " ,
110110 " -project " , self . path. pathString,
111111 " -configuration " , self . options. configuration. xcodeConfigurationName,
112- " -archivePath " , self . buildDirectory. appendingPathComponent ( self . productName ( target: target) ) . appendingPathComponent ( sdk. archiveName) . path,
113112 " -destination " , sdk. destination,
114113 " BUILD_DIR= \( self . buildDirectory. path) " ,
115114 " SKIP_INSTALL=NO "
116115 ]
117116
117+ if self . options. action == . archive {
118+ command += [
119+ " -archivePath " , self . buildDirectory. appendingPathComponent ( self . productName ( target: target) ) . appendingPathComponent ( sdk. archiveName) . path,
120+ ]
121+ }
122+
118123 // add SDK-specific build settings
119124 if let settings = sdk. buildSettings {
120125 for setting in settings {
@@ -136,19 +141,30 @@ struct XcodeBuilder {
136141 command += [ " -scheme " , target ]
137142
138143 // and the command
139- command += [ " archive " ]
144+ if self . options. action == . build {
145+ command += [ " build " ]
146+ } else {
147+ command += [ " archive " ]
148+ }
140149
141150 return command
142151 }
143152
144153 // we should probably pull this from the build output but we just make assumptions here
145154 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+ }
152168 }
153169
154170 // MARK: - Debug Symbols
0 commit comments