@@ -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_JAVA_VERSION = "1.7.0" ;
17
16
private static MIN_RUNTIME_VERSION_WITH_GRADLE = "1.3.0" ;
18
17
@@ -269,21 +268,32 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
269
268
return ( ( ) => {
270
269
let pluginPlatformsFolderPath = this . getPluginPlatformsFolderPath ( pluginData , AndroidProjectService . ANDROID_PLATFORM_NAME ) ;
271
270
271
+ this . processResourcesFromPlugin ( pluginData . name , pluginPlatformsFolderPath ) . wait ( ) ;
272
+
273
+ // Process androidManifest.xml from App_Resources
274
+ let manifestFilePath = path . join ( this . $projectData . appResourcesDirectoryPath , this . platformData . configurationFileName ) ;
275
+ if ( this . $fs . exists ( manifestFilePath ) . wait ( ) ) {
276
+ this . processResourcesFromPlugin ( "NativescriptAppResources" , this . $projectData . appResourcesDirectoryPath ) . wait ( ) ;
277
+ }
278
+ } ) . future < void > ( ) ( ) ;
279
+ }
280
+
281
+ private processResourcesFromPlugin ( pluginName : string , pluginPlatformsFolderPath : string ) : IFuture < void > {
282
+ return ( ( ) => {
272
283
let configurationsDirectoryPath = path . join ( this . platformData . projectRoot , "configurations" ) ;
273
284
this . $fs . ensureDirectoryExists ( configurationsDirectoryPath ) . wait ( ) ;
274
285
275
- let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginData . name ) ;
286
+ let pluginConfigurationDirectoryPath = path . join ( configurationsDirectoryPath , pluginName ) ;
276
287
this . $fs . ensureDirectoryExists ( pluginConfigurationDirectoryPath ) . wait ( ) ;
277
288
278
- // Copy include include .gradle file
289
+ // Copy include.gradle file
279
290
let includeGradleFilePath = path . join ( pluginPlatformsFolderPath , "include.gradle" ) ;
280
291
if ( this . $fs . exists ( includeGradleFilePath ) . wait ( ) ) {
281
- // TODO: Validate the existing include.gradle
282
292
shell . cp ( "-f" , includeGradleFilePath , pluginConfigurationDirectoryPath ) ;
283
- } // TODO: SHOULD generate default include.gradle
293
+ }
284
294
285
295
// Copy all resources from plugin
286
- let resourcesDestinationDirectoryPath = path . join ( this . platformData . projectRoot , "src" , pluginData . name ) ;
296
+ let resourcesDestinationDirectoryPath = path . join ( this . platformData . projectRoot , "src" , pluginName ) ;
287
297
this . $fs . ensureDirectoryExists ( resourcesDestinationDirectoryPath ) . wait ( ) ;
288
298
shell . cp ( "-Rf" , path . join ( pluginPlatformsFolderPath , "*" ) , resourcesDestinationDirectoryPath ) ;
289
299
} ) . future < void > ( ) ( ) ;
0 commit comments