@@ -117,7 +117,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
117
117
let installedVersion = coreModuleData . version ;
118
118
let coreModuleName = coreModuleData . name ;
119
119
120
- let customTemplateOptions = await this . getPathToPlatformTemplate ( platformTemplate , platformData . frameworkPackageName ) ;
120
+ let customTemplateOptions = await this . getPathToPlatformTemplate ( platformTemplate , platformData . frameworkPackageName , projectData . projectDir ) ;
121
121
let pathToTemplate = customTemplateOptions && customTemplateOptions . pathToTemplate ;
122
122
await platformData . platformProjectService . createProject ( path . resolve ( frameworkDir ) , installedVersion , projectData , pathToTemplate ) ;
123
123
platformData . platformProjectService . ensureConfigurationFileInAppResources ( projectData ) ;
@@ -129,17 +129,17 @@ export class PlatformService extends EventEmitter implements IPlatformService {
129
129
frameworkPackageNameData . template = customTemplateOptions . selectedTemplate ;
130
130
}
131
131
132
- this . $projectDataService . setNSValue ( this . $ projectData. projectDir , platformData . frameworkPackageName , frameworkPackageNameData ) ;
132
+ this . $projectDataService . setNSValue ( projectData . projectDir , platformData . frameworkPackageName , frameworkPackageNameData ) ;
133
133
134
134
return coreModuleName ;
135
135
136
136
}
137
137
138
- private async getPathToPlatformTemplate ( selectedTemplate : string , frameworkPackageName : string ) : Promise < { selectedTemplate : string , pathToTemplate : string } > {
138
+ private async getPathToPlatformTemplate ( selectedTemplate : string , frameworkPackageName : string , projectDir : string ) : Promise < { selectedTemplate : string , pathToTemplate : string } > {
139
139
if ( ! selectedTemplate ) {
140
140
// read data from package.json's nativescript key
141
141
// check the nativescript.tns-<platform>.template value
142
- const nativescriptPlatformData = this . $projectDataService . getNSValue ( this . $projectData . projectDir , frameworkPackageName ) ;
142
+ const nativescriptPlatformData = this . $projectDataService . getNSValue ( projectDir , frameworkPackageName ) ;
143
143
selectedTemplate = nativescriptPlatformData && nativescriptPlatformData . template ;
144
144
}
145
145
@@ -217,16 +217,16 @@ export class PlatformService extends EventEmitter implements IPlatformService {
217
217
if ( changesInfo . hasChanges ) {
218
218
// android build artifacts need to be cleaned up when switching from release to debug builds
219
219
if ( platform . toLowerCase ( ) === "android" ) {
220
- let previousPrepareInfo = this . $projectChangesService . getPrepareInfo ( platform ) ;
220
+ let previousPrepareInfo = this . $projectChangesService . getPrepareInfo ( platform , projectData ) ;
221
221
// clean up prepared plugins when not building for release
222
- if ( previousPrepareInfo && previousPrepareInfo . release !== this . $options . release ) {
223
- let platformData = this . $platformsData . getPlatformData ( platform ) ;
224
- await platformData . platformProjectService . cleanProject ( platformData . projectRoot , [ ] ) ;
222
+ if ( previousPrepareInfo && previousPrepareInfo . release !== appFilesUpdaterOptions . release ) {
223
+ let platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
224
+ await platformData . platformProjectService . cleanProject ( platformData . projectRoot , [ ] , projectData ) ;
225
225
}
226
226
}
227
227
228
- await this . preparePlatformCore ( platform , changesInfo ) ;
229
- this . $projectChangesService . savePrepareInfo ( platform ) ;
228
+ await this . preparePlatformCore ( platform , appFilesUpdaterOptions , projectData , provision ) ;
229
+ this . $projectChangesService . savePrepareInfo ( platform , projectData ) ;
230
230
} else {
231
231
this . $logger . out ( "Skipping prepare." ) ;
232
232
}
@@ -586,7 +586,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
586
586
this . validatePlatformInstalled ( platform , projectData ) ;
587
587
let platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
588
588
589
- await this . $platformsData . getPlatformData ( platform ) . platformProjectService . stopServices ( ) ;
589
+ await platformData . platformProjectService . stopServices ( platformData . projectRoot ) ;
590
590
591
591
let platformDir = path . join ( projectData . platformsDir , platform ) ;
592
592
this . $fs . deleteDirectory ( platformDir ) ;
0 commit comments