@@ -286,6 +286,24 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
286
286
if ( this . $fs . exists ( libsFolderPath ) . wait ( ) ) {
287
287
this . addLibrary ( libsFolderPath ) . wait ( ) ;
288
288
}
289
+
290
+ let configurationsDirectoryPath = path . join ( this . platformData . projectRoot , "configurations" ) ;
291
+ this . $fs . ensureDirectoryExists ( configurationsDirectoryPath ) . wait ( ) ;
292
+
293
+ let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginData . name ) ;
294
+ this . $fs . ensureDirectoryExists ( pluginConfigurationDirectoryPath ) . wait ( ) ;
295
+
296
+ // Copy include include.gradle file
297
+ let includeGradleFilePath = path . join ( pluginPlatformsFolderPath , "include.gradle" ) ;
298
+ if ( this . $fs . exists ( includeGradleFilePath ) . wait ( ) ) {
299
+ // TODO: Validate the existing include.gradle
300
+ shell . cp ( "-f" , includeGradleFilePath , pluginConfigurationDirectoryPath ) ;
301
+ } // TODO: SHOULD generate default include.gradle
302
+
303
+ // Copy all resources from plugin
304
+ let resourcesDestinationDirectoryPath = path . join ( this . platformData . projectRoot , "src" , pluginData . name ) ;
305
+ this . $fs . ensureDirectoryExists ( resourcesDestinationDirectoryPath ) . wait ( ) ;
306
+ shell . cp ( "-Rf" , path . join ( pluginPlatformsFolderPath , "*" ) , resourcesDestinationDirectoryPath ) ;
289
307
} ) . future < void > ( ) ( ) ;
290
308
}
291
309
@@ -299,6 +317,9 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
299
317
let pluginJars = this . $fs . enumerateFilesInDirectorySync ( libsFolderPath ) ;
300
318
_ . each ( pluginJars , jarName => this . $fs . deleteFile ( path . join ( libsFolderPath , jarName ) ) . wait ( ) ) ;
301
319
}
320
+
321
+ this . $fs . deleteDirectory ( path . join ( this . platformData . projectRoot , "configurations" , pluginData . name ) ) . wait ( ) ;
322
+ this . $fs . deleteDirectory ( path . join ( this . platformData . projectRoot , "src" , pluginData . name ) ) . wait ( ) ;
302
323
} catch ( e ) {
303
324
if ( e . code === "ENOENT" ) {
304
325
this . $logger . debug ( "No native code jars found: " + e . message ) ;
0 commit comments