@@ -61,50 +61,52 @@ export class PluginsService implements IPluginsService {
61
61
public prepare ( pluginData : IPluginData ) : IFuture < void > {
62
62
return ( ( ) => {
63
63
let action = ( pluginDestinationPath : string , platform : string , platformData : IPlatformData ) => {
64
- let skipExecution = false ;
65
64
// Process .js files
66
65
let installedFrameworkVersion = this . getInstalledFrameworkVersion ( platform ) . wait ( ) ;
67
66
let pluginPlatformsData = pluginData . platformsData ;
68
67
if ( pluginPlatformsData ) {
69
68
let pluginVersion = ( < any > pluginPlatformsData ) [ platform ] ;
69
+ if ( ! pluginVersion ) {
70
+ this . $logger . warn ( `${ pluginData . name } is not supported for ${ platform } .` ) ;
71
+ return ;
72
+ }
73
+
70
74
if ( semver . gt ( pluginVersion , installedFrameworkVersion ) ) {
71
75
this . $logger . warn ( `${ pluginData . name } ${ pluginVersion } for ${ platform } is not compatible with the currently installed framework version ${ installedFrameworkVersion } .` ) ;
72
- skipExecution = true ;
76
+ return ;
73
77
}
74
78
}
79
+
80
+ this . $fs . ensureDirectoryExists ( pluginDestinationPath ) . wait ( ) ;
81
+ shelljs . cp ( "-R" , pluginData . fullPath , pluginDestinationPath ) ;
82
+
83
+ let pluginPlatformsFolderPath = path . join ( pluginDestinationPath , pluginData . name , "platforms" , platform ) ;
84
+ let pluginConfigurationFilePath = path . join ( pluginPlatformsFolderPath , platformData . configurationFileName ) ;
85
+ let configurationFilePath = platformData . configurationFilePath ;
75
86
76
- if ( ! skipExecution ) {
77
- this . $fs . ensureDirectoryExists ( pluginDestinationPath ) . wait ( ) ;
78
- shelljs . cp ( "-R" , pluginData . fullPath , pluginDestinationPath ) ;
79
-
80
- let pluginPlatformsFolderPath = path . join ( pluginDestinationPath , pluginData . name , "platforms" , platform ) ;
81
- let pluginConfigurationFilePath = path . join ( pluginPlatformsFolderPath , platformData . configurationFileName ) ;
82
- let configurationFilePath = platformData . configurationFilePath ;
83
-
84
- if ( this . $fs . exists ( pluginConfigurationFilePath ) . wait ( ) ) {
85
- // Validate plugin configuration file
86
- let pluginConfigurationFileContent = this . $fs . readText ( pluginConfigurationFilePath ) . wait ( ) ;
87
- this . validateXml ( pluginConfigurationFileContent , pluginConfigurationFilePath ) ;
88
-
89
- // Validate configuration file
90
- let configurationFileContent = this . $fs . readText ( configurationFilePath ) . wait ( ) ;
91
- this . validateXml ( configurationFileContent , configurationFilePath ) ;
92
-
93
- // Merge xml
94
- let resultXml = this . mergeXml ( configurationFileContent , pluginConfigurationFileContent , platformData . mergeXmlConfig || [ ] ) . wait ( ) ;
95
- this . validateXml ( resultXml ) ;
96
- this . $fs . writeFile ( configurationFilePath , resultXml ) . wait ( ) ;
97
- }
98
-
99
- if ( this . $fs . exists ( pluginPlatformsFolderPath ) . wait ( ) ) {
100
- shelljs . rm ( "-rf" , pluginPlatformsFolderPath ) ;
101
- }
87
+ if ( this . $fs . exists ( pluginConfigurationFilePath ) . wait ( ) ) {
88
+ // Validate plugin configuration file
89
+ let pluginConfigurationFileContent = this . $fs . readText ( pluginConfigurationFilePath ) . wait ( ) ;
90
+ this . validateXml ( pluginConfigurationFileContent , pluginConfigurationFilePath ) ;
102
91
103
- // TODO: Add libraries
92
+ // Validate configuration file
93
+ let configurationFileContent = this . $fs . readText ( configurationFilePath ) . wait ( ) ;
94
+ this . validateXml ( configurationFileContent , configurationFilePath ) ;
104
95
105
- // Show message
106
- this . $logger . out ( `Successfully prepared plugin ${ pluginData . name } for ${ platform } .` ) ;
96
+ // Merge xml
97
+ let resultXml = this . mergeXml ( configurationFileContent , pluginConfigurationFileContent , platformData . mergeXmlConfig || [ ] ) . wait ( ) ;
98
+ this . validateXml ( resultXml ) ;
99
+ this . $fs . writeFile ( configurationFilePath , resultXml ) . wait ( ) ;
107
100
}
101
+
102
+ if ( this . $fs . exists ( pluginPlatformsFolderPath ) . wait ( ) ) {
103
+ shelljs . rm ( "-rf" , pluginPlatformsFolderPath ) ;
104
+ }
105
+
106
+ // TODO: Add libraries
107
+
108
+ // Show message
109
+ this . $logger . out ( `Successfully prepared plugin ${ pluginData . name } for ${ platform } .` ) ;
108
110
} ;
109
111
110
112
this . executeForAllInstalledPlatforms ( action ) ;
0 commit comments