@@ -12,7 +12,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
12
12
private static VALUES_DIRNAME = "values" ;
13
13
private static VALUES_VERSION_DIRNAME_PREFIX = AndroidProjectService . VALUES_DIRNAME + "-v" ;
14
14
private static ANDROID_PLATFORM_NAME = "android" ;
15
- private static LIBS_FOLDER_NAME = "libs" ;
16
15
private static MIN_RUNTIME_VERSION_WITH_GRADLE = "1.3.0" ;
17
16
18
17
private _androidProjectPropertiesManagers : IDictionary < IAndroidProjectPropertiesManager > ;
@@ -278,21 +277,32 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
278
277
return ( ( ) => {
279
278
let pluginPlatformsFolderPath = this . getPluginPlatformsFolderPath ( pluginData , AndroidProjectService . ANDROID_PLATFORM_NAME ) ;
280
279
280
+ this . processResourcesFromPlugin ( pluginData . name , pluginPlatformsFolderPath ) . wait ( ) ;
281
+
282
+ // Process androidManifest.xml from App_Resources
283
+ let manifestFilePath = path . join ( this . $projectData . appResourcesDirectoryPath , this . platformData . configurationFileName ) ;
284
+ if ( this . $fs . exists ( manifestFilePath ) . wait ( ) ) {
285
+ this . processResourcesFromPlugin ( "NativescriptAppResources" , this . $projectData . appResourcesDirectoryPath ) . wait ( ) ;
286
+ }
287
+ } ) . future < void > ( ) ( ) ;
288
+ }
289
+
290
+ private processResourcesFromPlugin ( pluginName : string , pluginPlatformsFolderPath : string ) : IFuture < void > {
291
+ return ( ( ) => {
281
292
let configurationsDirectoryPath = path . join ( this . platformData . projectRoot , "configurations" ) ;
282
293
this . $fs . ensureDirectoryExists ( configurationsDirectoryPath ) . wait ( ) ;
283
294
284
- let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginData . name ) ;
295
+ let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginName ) ;
285
296
this . $fs . ensureDirectoryExists ( pluginConfigurationDirectoryPath ) . wait ( ) ;
286
297
287
- // Copy include include .gradle file
298
+ // Copy include.gradle file
288
299
let includeGradleFilePath = path . join ( pluginPlatformsFolderPath , "include.gradle" ) ;
289
300
if ( this . $fs . exists ( includeGradleFilePath ) . wait ( ) ) {
290
- // TODO: Validate the existing include.gradle
291
301
shell . cp ( "-f" , includeGradleFilePath , pluginConfigurationDirectoryPath ) ;
292
- } // TODO: SHOULD generate default include.gradle
302
+ }
293
303
294
304
// Copy all resources from plugin
295
- let resourcesDestinationDirectoryPath = path . join ( this . platformData . projectRoot , "src" , pluginData . name ) ;
305
+ let resourcesDestinationDirectoryPath = path . join ( this . platformData . projectRoot , "src" , pluginName ) ;
296
306
this . $fs . ensureDirectoryExists ( resourcesDestinationDirectoryPath ) . wait ( ) ;
297
307
shell . cp ( "-Rf" , path . join ( pluginPlatformsFolderPath , "*" ) , resourcesDestinationDirectoryPath ) ;
298
308
} ) . future < void > ( ) ( ) ;
0 commit comments