@@ -168,7 +168,7 @@ export class SPMService implements ISPMService {
168168
169169 const render = ( ) => {
170170 const elapsed = Math . round ( ( Date . now ( ) - startedAt ) / 1000 ) ;
171- spinner . text = `${ activity } … ${ color . dim ( `(${ elapsed } s )` ) } ` ;
171+ spinner . text = `${ activity } … ${ color . dim ( `(${ this . formatElapsed ( elapsed ) } )` ) } ` ;
172172 } ;
173173 // keep the elapsed timer ticking even when xcodebuild is silent (e.g.
174174 // while a binary artifact downloads) so the user can see it's alive.
@@ -256,10 +256,10 @@ export class SPMService implements ISPMService {
256256 return "Downloading Swift Package binaries (first build only)" ;
257257 }
258258 if ( / ^ F e t c h i n g \b / i. test ( trimmed ) ) {
259- return `Fetching ${ this . shortenPackageRef ( trimmed ) } ` ;
259+ return this . describePackageActivity ( "Fetching" , trimmed ) ;
260260 }
261261 if ( / ^ C l o n i n g \b / i. test ( trimmed ) ) {
262- return `Cloning ${ this . shortenPackageRef ( trimmed ) } ` ;
262+ return this . describePackageActivity ( "Cloning" , trimmed ) ;
263263 }
264264 if ( / C o m p u t i n g v e r s i o n f o r / i. test ( trimmed ) ) {
265265 return "Computing package versions" ;
@@ -273,18 +273,39 @@ export class SPMService implements ISPMService {
273273 return null ;
274274 }
275275
276- /** Extracts a short, readable name from a SwiftPM repo URL/log line. */
277- private shortenPackageRef ( line : string ) : string {
276+ /**
277+ * Builds a stable, self-explanatory activity label with the package being
278+ * worked on in parentheses, e.g. "Fetching Swift Packages (Auth0.swift)".
279+ */
280+ private describePackageActivity ( verb : string , line : string ) : string {
281+ const packageRef = this . shortenPackageRef ( line ) ;
282+ return packageRef
283+ ? `${ verb } Swift Packages (${ packageRef } )`
284+ : `${ verb } Swift Packages` ;
285+ }
286+
287+ /**
288+ * Extracts a short, readable name from a SwiftPM repo URL/log line, or null
289+ * when the line contains no URL to name the package by.
290+ */
291+ private shortenPackageRef ( line : string ) : string | null {
278292 const match = line . match ( / h t t p s ? : \/ \/ \S + / ) ;
279293 if ( ! match ) {
280- return "Swift Packages" ;
294+ return null ;
281295 }
282296 return path
283297 . basename ( match [ 0 ] )
284298 . replace ( / \. g i t $ / , "" )
285299 . replace ( / [ ) \s ] .* $ / , "" ) ;
286300 }
287301
302+ /** Formats an elapsed duration in whole seconds as "5m 15s". */
303+ private formatElapsed ( totalSeconds : number ) : string {
304+ const minutes = Math . floor ( totalSeconds / 60 ) ;
305+ const seconds = totalSeconds % 60 ;
306+ return `${ minutes } m ${ seconds } s` ;
307+ }
308+
288309 /** True when the Xcode project references any Swift packages. */
289310 private hasSPMReferences (
290311 platformData : IPlatformData ,
0 commit comments