@@ -277,6 +277,24 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
277
277
if ( this . $fs . exists ( libsFolderPath ) . wait ( ) ) {
278
278
this . addLibrary ( libsFolderPath ) . wait ( ) ;
279
279
}
280
+
281
+ let configurationsDirectoryPath = path . join ( this . platformData . projectRoot , "configurations" ) ;
282
+ this . $fs . ensureDirectoryExists ( configurationsDirectoryPath ) . wait ( ) ;
283
+
284
+ let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginData . name ) ;
285
+ this . $fs . ensureDirectoryExists ( pluginConfigurationDirectoryPath ) . wait ( ) ;
286
+
287
+ // Copy include include.gradle file
288
+ let includeGradleFilePath = path . join ( pluginPlatformsFolderPath , "include.gradle" ) ;
289
+ if ( this . $fs . exists ( includeGradleFilePath ) . wait ( ) ) {
290
+ // TODO: Validate the existing include.gradle
291
+ shell . cp ( "-f" , includeGradleFilePath , pluginConfigurationDirectoryPath ) ;
292
+ } // TODO: SHOULD generate default include.gradle
293
+
294
+ // Copy all resources from plugin
295
+ let resourcesDestinationDirectoryPath = path . join ( this . platformData . projectRoot , "src" , pluginData . name ) ;
296
+ this . $fs . ensureDirectoryExists ( resourcesDestinationDirectoryPath ) . wait ( ) ;
297
+ shell . cp ( "-Rf" , path . join ( pluginPlatformsFolderPath , "*" ) , resourcesDestinationDirectoryPath ) ;
280
298
} ) . future < void > ( ) ( ) ;
281
299
}
282
300
@@ -290,6 +308,9 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
290
308
let pluginJars = this . $fs . enumerateFilesInDirectorySync ( libsFolderPath ) ;
291
309
_ . each ( pluginJars , jarName => this . $fs . deleteFile ( path . join ( libsFolderPath , jarName ) ) . wait ( ) ) ;
292
310
}
311
+
312
+ this . $fs . deleteDirectory ( path . join ( this . platformData . projectRoot , "configurations" , pluginData . name ) ) . wait ( ) ;
313
+ this . $fs . deleteDirectory ( path . join ( this . platformData . projectRoot , "src" , pluginData . name ) ) . wait ( ) ;
293
314
} catch ( e ) {
294
315
if ( e . code === "ENOENT" ) {
295
316
this . $logger . debug ( "No native code jars found: " + e . message ) ;
0 commit comments