@@ -75,7 +75,12 @@ export type MakeUniversalOpts = {
7575} ;
7676
7777const dupedFiles = ( files : AppFile [ ] ) =>
78- files . filter ( ( f ) => f . type !== AppFileType . SNAPSHOT && f . type !== AppFileType . APP_CODE ) ;
78+ files . filter (
79+ ( f ) =>
80+ f . type !== AppFileType . SNAPSHOT &&
81+ f . type !== AppFileType . APP_CODE &&
82+ f . type !== AppFileType . SINGLE_ARCH ,
83+ ) ;
7984
8085export const makeUniversalApp = async ( opts : MakeUniversalOpts ) : Promise < void > => {
8186 d ( 'making a universal app with options' , opts ) ;
@@ -121,8 +126,8 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
121126
122127 const uniqueToX64 : string [ ] = [ ] ;
123128 const uniqueToArm64 : string [ ] = [ ] ;
124- const x64Files = await getAllAppFiles ( await fs . promises . realpath ( tmpApp ) ) ;
125- const arm64Files = await getAllAppFiles ( await fs . promises . realpath ( opts . arm64AppPath ) ) ;
129+ const x64Files = await getAllAppFiles ( await fs . promises . realpath ( tmpApp ) , opts ) ;
130+ const arm64Files = await getAllAppFiles ( await fs . promises . realpath ( opts . arm64AppPath ) , opts ) ;
126131
127132 for ( const file of dupedFiles ( x64Files ) ) {
128133 if ( ! arm64Files . some ( ( f ) => f . relativePath === file . relativePath ) )
@@ -143,7 +148,9 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
143148 ) ;
144149 }
145150
146- for ( const file of x64Files . filter ( ( f ) => f . type === AppFileType . PLAIN ) ) {
151+ // Single Arch files are copied as is without processing.
152+ const multiArchFiles = x64Files . filter ( ( f ) => f . type !== AppFileType . SINGLE_ARCH ) ;
153+ for ( const file of multiArchFiles . filter ( ( f ) => f . type === AppFileType . PLAIN ) ) {
147154 const x64Sha = await sha ( path . resolve ( opts . x64AppPath , file . relativePath ) ) ;
148155 const arm64Sha = await sha ( path . resolve ( opts . arm64AppPath , file . relativePath ) ) ;
149156 if ( x64Sha !== arm64Sha ) {
@@ -159,7 +166,7 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
159166 }
160167 }
161168 const knownMergedMachOFiles = new Set ( ) ;
162- for ( const machOFile of x64Files . filter ( ( f ) => f . type === AppFileType . MACHO ) ) {
169+ for ( const machOFile of multiArchFiles . filter ( ( f ) => f . type === AppFileType . MACHO ) ) {
163170 const first = await fs . promises . realpath ( path . resolve ( tmpApp , machOFile . relativePath ) ) ;
164171 const second = await fs . promises . realpath (
165172 path . resolve ( opts . arm64AppPath , machOFile . relativePath ) ,
@@ -355,9 +362,9 @@ export const makeUniversalApp = async (opts: MakeUniversalOpts): Promise<void> =
355362 }
356363 }
357364
358- const generatedIntegrity = await computeIntegrityData ( path . join ( tmpApp , 'Contents' ) ) ;
365+ const generatedIntegrity = await computeIntegrityData ( path . join ( tmpApp , 'Contents' ) , opts ) ;
359366
360- const plistFiles = x64Files . filter ( ( f ) => f . type === AppFileType . INFO_PLIST ) ;
367+ const plistFiles = multiArchFiles . filter ( ( f ) => f . type === AppFileType . INFO_PLIST ) ;
361368 for ( const plistFile of plistFiles ) {
362369 const x64PlistPath = path . resolve ( opts . x64AppPath , plistFile . relativePath ) ;
363370 const arm64PlistPath = path . resolve ( opts . arm64AppPath , plistFile . relativePath ) ;
0 commit comments