@@ -12,7 +12,6 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
1212 private static VALUES_DIRNAME = "values" ;
1313 private static VALUES_VERSION_DIRNAME_PREFIX = AndroidProjectService . VALUES_DIRNAME + "-v" ;
1414 private static ANDROID_PLATFORM_NAME = "android" ;
15- private static LIBS_FOLDER_NAME = "libs" ;
1615 private static MIN_RUNTIME_VERSION_WITH_GRADLE = "1.3.0" ;
1716
1817 private _androidProjectPropertiesManagers : IDictionary < IAndroidProjectPropertiesManager > ;
@@ -278,21 +277,32 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
278277 return ( ( ) => {
279278 let pluginPlatformsFolderPath = this . getPluginPlatformsFolderPath ( pluginData , AndroidProjectService . ANDROID_PLATFORM_NAME ) ;
280279
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 ( ( ) => {
281292 let configurationsDirectoryPath = path . join ( this . platformData . projectRoot , "configurations" ) ;
282293 this . $fs . ensureDirectoryExists ( configurationsDirectoryPath ) . wait ( ) ;
283294
284- let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginData . name ) ;
295+ let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginName ) ;
285296 this . $fs . ensureDirectoryExists ( pluginConfigurationDirectoryPath ) . wait ( ) ;
286297
287- // Copy include include .gradle file
298+ // Copy include.gradle file
288299 let includeGradleFilePath = path . join ( pluginPlatformsFolderPath , "include.gradle" ) ;
289300 if ( this . $fs . exists ( includeGradleFilePath ) . wait ( ) ) {
290- // TODO: Validate the existing include.gradle
291301 shell . cp ( "-f" , includeGradleFilePath , pluginConfigurationDirectoryPath ) ;
292- } // TODO: SHOULD generate default include.gradle
302+ }
293303
294304 // 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 ) ;
296306 this . $fs . ensureDirectoryExists ( resourcesDestinationDirectoryPath ) . wait ( ) ;
297307 shell . cp ( "-Rf" , path . join ( pluginPlatformsFolderPath , "*" ) , resourcesDestinationDirectoryPath ) ;
298308 } ) . future < void > ( ) ( ) ;
0 commit comments