@@ -74,53 +74,55 @@ export class PluginsService implements IPluginsService {
74
74
75
75
let action = ( pluginDestinationPath : string , platform : string , platformData : IPlatformData ) => {
76
76
return ( ( ) => {
77
- // Process .js files
78
- let installedFrameworkVersion = this . getInstalledFrameworkVersion ( platform ) . wait ( ) ;
79
- let pluginPlatformsData = pluginData . platformsData ;
80
- if ( pluginPlatformsData ) {
81
- let pluginVersion = ( < any > pluginPlatformsData ) [ platform ] ;
82
- if ( ! pluginVersion ) {
83
- this . $logger . warn ( `${ pluginData . name } is not supported for ${ platform } .` ) ;
84
- return ;
77
+ if ( this . $fs . exists ( path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ) . wait ( ) ) {
78
+ // Process .js files
79
+ let installedFrameworkVersion = this . getInstalledFrameworkVersion ( platform ) . wait ( ) ;
80
+ let pluginPlatformsData = pluginData . platformsData ;
81
+ if ( pluginPlatformsData ) {
82
+ let pluginVersion = ( < any > pluginPlatformsData ) [ platform ] ;
83
+ if ( ! pluginVersion ) {
84
+ this . $logger . warn ( `${ pluginData . name } is not supported for ${ platform } .` ) ;
85
+ return ;
86
+ }
87
+
88
+ if ( semver . gt ( pluginVersion , installedFrameworkVersion ) ) {
89
+ this . $logger . warn ( `${ pluginData . name } ${ pluginVersion } for ${ platform } is not compatible with the currently installed framework version ${ installedFrameworkVersion } .` ) ;
90
+ return ;
91
+ }
85
92
}
86
93
87
- if ( semver . gt ( pluginVersion , installedFrameworkVersion ) ) {
88
- this . $logger . warn ( `${ pluginData . name } ${ pluginVersion } for ${ platform } is not compatible with the currently installed framework version ${ installedFrameworkVersion } .` ) ;
89
- return ;
90
- }
91
- }
92
-
93
- this . $fs . ensureDirectoryExists ( pluginDestinationPath ) . wait ( ) ;
94
- shelljs . cp ( "-Rf" , pluginData . fullPath , pluginDestinationPath ) ;
94
+ this . $fs . ensureDirectoryExists ( pluginDestinationPath ) . wait ( ) ;
95
+ shelljs . cp ( "-Rf" , pluginData . fullPath , pluginDestinationPath ) ;
95
96
96
- let pluginPlatformsFolderPath = path . join ( pluginDestinationPath , pluginData . name , "platforms" , platform ) ;
97
- let pluginConfigurationFilePath = path . join ( pluginPlatformsFolderPath , platformData . configurationFileName ) ;
98
- let configurationFilePath = platformData . configurationFilePath ;
97
+ let pluginPlatformsFolderPath = path . join ( pluginDestinationPath , pluginData . name , "platforms" , platform ) ;
98
+ let pluginConfigurationFilePath = path . join ( pluginPlatformsFolderPath , platformData . configurationFileName ) ;
99
+ let configurationFilePath = platformData . configurationFilePath ;
99
100
100
- if ( this . $fs . exists ( pluginConfigurationFilePath ) . wait ( ) ) {
101
- // Validate plugin configuration file
102
- let pluginConfigurationFileContent = this . $fs . readText ( pluginConfigurationFilePath ) . wait ( ) ;
103
- this . validateXml ( pluginConfigurationFileContent , pluginConfigurationFilePath ) ;
101
+ if ( this . $fs . exists ( pluginConfigurationFilePath ) . wait ( ) ) {
102
+ // Validate plugin configuration file
103
+ let pluginConfigurationFileContent = this . $fs . readText ( pluginConfigurationFilePath ) . wait ( ) ;
104
+ this . validateXml ( pluginConfigurationFileContent , pluginConfigurationFilePath ) ;
104
105
105
- // Validate configuration file
106
- let configurationFileContent = this . $fs . readText ( configurationFilePath ) . wait ( ) ;
107
- this . validateXml ( configurationFileContent , configurationFilePath ) ;
106
+ // Validate configuration file
107
+ let configurationFileContent = this . $fs . readText ( configurationFilePath ) . wait ( ) ;
108
+ this . validateXml ( configurationFileContent , configurationFilePath ) ;
108
109
109
- // Merge xml
110
- let resultXml = this . mergeXml ( configurationFileContent , pluginConfigurationFileContent , platformData . mergeXmlConfig || [ ] ) . wait ( ) ;
111
- this . validateXml ( resultXml ) ;
112
- this . $fs . writeFile ( configurationFilePath , resultXml ) . wait ( ) ;
113
- }
110
+ // Merge xml
111
+ let resultXml = this . mergeXml ( configurationFileContent , pluginConfigurationFileContent , platformData . mergeXmlConfig || [ ] ) . wait ( ) ;
112
+ this . validateXml ( resultXml ) ;
113
+ this . $fs . writeFile ( configurationFilePath , resultXml ) . wait ( ) ;
114
+ }
114
115
115
- this . $projectFilesManager . processPlatformSpecificFiles ( pluginDestinationPath , platform ) . wait ( ) ;
116
+ this . $projectFilesManager . processPlatformSpecificFiles ( pluginDestinationPath , platform ) . wait ( ) ;
116
117
117
- pluginData . pluginPlatformsFolderPath = ( _platform : string ) => path . join ( pluginData . fullPath , "platforms" , _platform ) ;
118
- platformData . platformProjectService . preparePluginNativeCode ( pluginData ) . wait ( ) ;
118
+ pluginData . pluginPlatformsFolderPath = ( _platform : string ) => path . join ( pluginData . fullPath , "platforms" , _platform ) ;
119
+ platformData . platformProjectService . preparePluginNativeCode ( pluginData ) . wait ( ) ;
119
120
120
- shelljs . rm ( "-rf" , path . join ( pluginDestinationPath , pluginData . name , "platforms" ) ) ;
121
+ shelljs . rm ( "-rf" , path . join ( pluginDestinationPath , pluginData . name , "platforms" ) ) ;
121
122
122
- // Show message
123
- this . $logger . out ( `Successfully prepared plugin ${ pluginData . name } for ${ platform } .` ) ;
123
+ // Show message
124
+ this . $logger . out ( `Successfully prepared plugin ${ pluginData . name } for ${ platform } .` ) ;
125
+ }
124
126
125
127
} ) . future < void > ( ) ( ) ;
126
128
} ;
0 commit comments