@@ -94,23 +94,24 @@ async function getPackageType(provisionalFile) {
9494
9595module . exports = {
9696 build : async ( args ) => {
97- const {
97+ let {
9898 cordova,
9999 cordovaVersion,
100100 cordovaIosVersion,
101101 projectDir,
102102 certificate,
103103 certificatePassword,
104104 provisionalFile,
105- packageType
105+ buildType,
106+ packageType
106107 } = args ;
107108
108109 if ( ! await hasValidNodeVersion ( ) || ! await isGitInstalled ( ) || ! await isCocoaPodsIstalled ( ) ) {
109110 return {
110111 success : false
111112 }
112113 }
113- const errors = validateForIos ( certificate , certificatePassword , provisionalFile , packageType ) ;
114+ const errors = validateForIos ( certificate , certificatePassword , provisionalFile , buildType ) ;
114115 if ( errors . length > 0 ) {
115116 return {
116117 success : false ,
@@ -126,8 +127,6 @@ module.exports = {
126127 label : loggerLabel ,
127128 message : `provisional UUID : ${ provisionuuid } `
128129 } ) ;
129- const codeSignIdentity = packageType === 'production' ? "iPhone Distribution" : "iPhone Developer" ;
130-
131130 if ( semver . satisfies ( cordovaVersion , '8.x' ) ) {
132131 useModernBuildSystem = 'NO' ;
133132 }
@@ -163,15 +162,15 @@ module.exports = {
163162 label : loggerLabel ,
164163 message : 'Prepared for cordova ios'
165164 } ) ;
166- let provisionalType = 'development' ;
167- if ( packageType === 'production ' ) {
168- provisionalType = await getPackageType ( provisionalFile ) ;
165+ packageType = packageType || 'development' ;
166+ if ( buildType === 'release ' ) {
167+ packageType = await getPackageType ( provisionalFile ) ;
169168 }
170169 await exec ( cordova , [
171170 'build' , 'ios' , '--verbose' , '--device' ,
172- packageType === 'production' ? '--release' : '--debug' ,
173- `--codeSignIdentity="${ codeSignIdentity } "` ,
174- `--packageType="${ provisionalType } "` ,
171+ `-- ${ buildType } ` ,
172+ `--codeSignIdentity="iPhone Developer "` ,
173+ `--packageType="${ packageType } "` ,
175174 `--developmentTeam="${ developmentTeamId } "` ,
176175 `--provisioningProfile="${ provisionuuid } "` ,
177176 `--buildFlag="-UseModernBuildSystem=${ useModernBuildSystem } "` ,
@@ -185,7 +184,7 @@ module.exports = {
185184 message : 'build completed'
186185 } ) ;
187186 const output = projectDir + 'output/ios/' ;
188- const outputFilePath = `${ output } ${ projectInfo . displayName || projectInfo . name } (${ projectInfo . version } ).${ packageType } .ipa` ;
187+ const outputFilePath = `${ output } ${ projectInfo . displayName || projectInfo . name } (${ projectInfo . version } ).${ buildType } .ipa` ;
189188 fs . mkdirSync ( output , { recursive : true } ) ;
190189 fs . copyFileSync ( findFile ( projectDir + 'platforms/ios/build/device' , / \. i p a ? / ) , outputFilePath ) ;
191190 return {
0 commit comments