@@ -120,19 +120,20 @@ export async function GetProjectDetails(credential: AppleCredential, xcodeVersio
120120}
121121
122122async function parseBuildSettings ( projectPath : string ) : Promise < [ string , string ] > {
123- await fs . promises . access ( projectPath , fs . constants . R_OK ) ;
124- const xCodeProjContent = await fs . promises . readFile ( projectPath , 'utf8' ) ;
125- const platformName = core . getInput ( 'platform' ) || matchRegexPattern ( xCodeProjContent , / \s + P L A T F O R M _ N A M E = (?< platformName > \w + ) / , 'platformName' ) ;
123+ const projectFilePath = `${ projectPath } /project.pbxproj` ;
124+ await fs . promises . access ( projectFilePath , fs . constants . R_OK ) ;
125+ const content = await fs . promises . readFile ( projectFilePath , 'utf8' ) ;
126+ const platformName = core . getInput ( 'platform' ) || matchRegexPattern ( content , / \s + P L A T F O R M _ N A M E = (?< platformName > \w + ) / , 'platformName' ) ;
126127 if ( ! platformName ) {
127128 throw new Error ( 'Unable to determine the platform name from the build settings' ) ;
128129 }
129- const bundleId = core . getInput ( 'bundle-id' ) || matchRegexPattern ( xCodeProjContent , / \s + P R O D U C T _ B U N D L E _ I D E N T I F I E R = (?< bundleId > [ \w . - ] + ) / , 'bundleId' ) ;
130+ const bundleId = core . getInput ( 'bundle-id' ) || matchRegexPattern ( content , / \s + P R O D U C T _ B U N D L E _ I D E N T I F I E R = (?< bundleId > [ \w . - ] + ) / , 'bundleId' ) ;
130131 if ( ! bundleId || bundleId === 'NO' ) {
131132 throw new Error ( 'Unable to determine the bundle ID from the build settings' ) ;
132133 }
133134 let platformSdkVersion = core . getInput ( 'platform-sdk-version' ) || null ;
134135 if ( ! platformSdkVersion ) {
135- platformSdkVersion = matchRegexPattern ( xCodeProjContent , / \s + S D K _ V E R S I O N = (?< sdkVersion > [ \d . ] + ) / , 'sdkVersion' ) || null ;
136+ platformSdkVersion = matchRegexPattern ( content , / \s + S D K _ V E R S I O N = (?< sdkVersion > [ \d . ] + ) / , 'sdkVersion' ) || null ;
136137 }
137138 const platforms = {
138139 'iphoneos' : 'iOS' ,
0 commit comments