@@ -32,7 +32,9 @@ export class ProjectData implements IProjectData {
32
32
public projectFilePath : string ;
33
33
public projectId : string ;
34
34
public projectName : string ;
35
- public appDirectoryPath : string ;
35
+ get appDirectoryPath ( ) : string {
36
+ return this . getAppDirectoryPath ( ) ;
37
+ }
36
38
get appResourcesDirectoryPath ( ) : string {
37
39
return this . getAppResourcesDirectoryPath ( ) ;
38
40
}
@@ -70,7 +72,6 @@ export class ProjectData implements IProjectData {
70
72
this . projectName = this . $projectHelper . sanitizeName ( path . basename ( projectDir ) ) ;
71
73
this . platformsDir = path . join ( projectDir , constants . PLATFORMS_DIR_NAME ) ;
72
74
this . projectFilePath = projectFilePath ;
73
- this . appDirectoryPath = path . join ( projectDir , constants . APP_FOLDER_NAME ) ;
74
75
this . projectId = data . id ;
75
76
this . dependencies = fileContent . dependencies ;
76
77
this . devDependencies = fileContent . devDependencies ;
@@ -106,7 +107,28 @@ export class ProjectData implements IProjectData {
106
107
}
107
108
}
108
109
109
- return absoluteAppResourcesDirPath || path . join ( projectDir , constants . APP_FOLDER_NAME , constants . APP_RESOURCES_FOLDER_NAME ) ;
110
+ return absoluteAppResourcesDirPath || path . join ( this . getAppDirectoryPath ( projectDir ) , constants . APP_RESOURCES_FOLDER_NAME ) ;
111
+ }
112
+
113
+ public getAppDirectoryPath ( projectDir ?: string ) : string {
114
+ if ( ! projectDir ) {
115
+ projectDir = this . projectDir ;
116
+ }
117
+
118
+ const configNSFilePath = path . join ( projectDir , constants . CONFIG_NS_FILE_NAME ) ;
119
+ let absoluteAppDirPath : string ;
120
+
121
+ if ( this . $fs . exists ( configNSFilePath ) ) {
122
+ const configNS = this . $fs . readJson ( configNSFilePath ) ;
123
+
124
+ if ( configNS && configNS [ constants . CONFIG_NS_APP_ENTRY ] ) {
125
+ const appDirPath = configNS [ constants . CONFIG_NS_APP_ENTRY ] ;
126
+
127
+ absoluteAppDirPath = path . resolve ( projectDir , appDirPath ) ;
128
+ }
129
+ }
130
+
131
+ return absoluteAppDirPath || path . join ( projectDir , constants . APP_FOLDER_NAME ) ;
110
132
}
111
133
112
134
private getProjectType ( ) : string {
0 commit comments