@@ -215,8 +215,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
215
215
* Returns the path to the .xcarchive.
216
216
*/
217
217
public async archive ( projectData : IProjectData , buildConfig ?: IBuildConfig , options ?: { archivePath ?: string , additionalArgs ?: string [ ] } ) : Promise < string > {
218
+ const platformData = this . getPlatformData ( projectData ) ;
218
219
const projectRoot = this . getPlatformData ( projectData ) . projectRoot ;
219
- const archivePath = options && options . archivePath ? path . resolve ( options . archivePath ) : path . join ( projectRoot , "/build/archive/" , projectData . projectName + ".xcarchive" ) ;
220
+ const archivePath = options && options . archivePath ? path . resolve ( options . archivePath ) : path . join ( platformData . getBuildOutputPath ( buildConfig ) , projectData . projectName + ".xcarchive" ) ;
220
221
let args = [ "archive" , "-archivePath" , archivePath , "-configuration" ,
221
222
getConfigurationName ( ! buildConfig || buildConfig . release ) ]
222
223
. concat ( this . xcbuildProjectArgs ( projectRoot , projectData , "scheme" ) ) ;
@@ -287,12 +288,11 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
287
288
/**
288
289
* Exports .xcarchive for a development device.
289
290
*/
290
- private async exportDevelopmentArchive ( projectData : IProjectData , buildConfig : IBuildConfig , options : { archivePath : string , exportDir ?: string , teamID ?: string , provision ?: string } ) : Promise < string > {
291
+ private async exportDevelopmentArchive ( projectData : IProjectData , buildConfig : IBuildConfig , options : { archivePath : string , provision ?: string } ) : Promise < string > {
291
292
const platformData = this . getPlatformData ( projectData ) ;
292
293
const projectRoot = platformData . projectRoot ;
293
294
const archivePath = options . archivePath ;
294
- const buildOutputPath = path . join ( projectRoot , constants . BUILD_DIR ) ;
295
- const exportOptionsMethod = await this . getExportOptionsMethod ( projectData ) ;
295
+ const exportOptionsMethod = await this . getExportOptionsMethod ( projectData , archivePath ) ;
296
296
let plistTemplate = `<?xml version="1.0" encoding="UTF-8"?>
297
297
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
298
298
<plist version="1.0">
@@ -320,7 +320,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
320
320
this . $fs . writeFile ( exportOptionsPlist , plistTemplate ) ;
321
321
322
322
// The xcodebuild exportPath expects directory and writes the <project-name>.ipa at that directory.
323
- const exportPath = path . resolve ( options . exportDir || buildOutputPath ) ;
323
+ const exportPath = path . resolve ( path . dirname ( archivePath ) ) ;
324
324
const exportFile = path . join ( exportPath , projectData . projectName + ".ipa" ) ;
325
325
326
326
await this . xcodebuild (
@@ -1399,8 +1399,8 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1399
1399
}
1400
1400
}
1401
1401
1402
- private getExportOptionsMethod ( projectData : IProjectData ) : string {
1403
- const embeddedMobileProvisionPath = path . join ( this . getPlatformData ( projectData ) . projectRoot , constants . BUILD_DIR , "archive" , ` ${ projectData . projectName } .xcarchive` , 'Products' , 'Applications' , `${ projectData . projectName } .app` , "embedded.mobileprovision" ) ;
1402
+ private getExportOptionsMethod ( projectData : IProjectData , archivePath : string ) : string {
1403
+ const embeddedMobileProvisionPath = path . join ( archivePath , 'Products' , 'Applications' , `${ projectData . projectName } .app` , "embedded.mobileprovision" ) ;
1404
1404
const provision = mobileprovision . provision . readFromFile ( embeddedMobileProvisionPath ) ;
1405
1405
1406
1406
return {
0 commit comments