|
1 | 1 | import * as path from "path"; |
2 | | -import { NODE_MODULES_FOLDER_NAME, NativePlatformStatus, PACKAGE_JSON_FILE_NAME, APP_GRADLE_FILE_NAME, BUILD_XCCONFIG_FILE_NAME, APP_RESOURCES_FOLDER_NAME } from "../constants"; |
| 2 | +import { NODE_MODULES_FOLDER_NAME, NativePlatformStatus, PACKAGE_JSON_FILE_NAME, APP_GRADLE_FILE_NAME, BUILD_XCCONFIG_FILE_NAME } from "../constants"; |
3 | 3 | import { getHash } from "../common/helpers"; |
4 | 4 |
|
5 | 5 | const prepareInfoFileName = ".nsprepareinfo"; |
@@ -59,8 +59,8 @@ export class ProjectChangesService implements IProjectChangesService { |
59 | 59 | public async checkForChanges(platform: string, projectData: IProjectData, projectChangesOptions: IProjectChangesOptions): Promise<IProjectChangesInfo> { |
60 | 60 | const platformData = this.$platformsData.getPlatformData(platform, projectData); |
61 | 61 | this._changesInfo = new ProjectChangesInfo(); |
62 | | - const isPrepareInfoEnsured = await this.ensurePrepareInfo(platform, projectData, projectChangesOptions); |
63 | | - if (!isPrepareInfoEnsured) { |
| 62 | + const isNewPrepareInfo = await this.ensurePrepareInfo(platform, projectData, projectChangesOptions); |
| 63 | + if (!isNewPrepareInfo) { |
64 | 64 | this._newFiles = 0; |
65 | 65 |
|
66 | 66 | this._changesInfo.appFilesChanged = await this.hasChangedAppFiles(projectData); |
@@ -178,7 +178,7 @@ export class ProjectChangesService implements IProjectChangesService { |
178 | 178 | changesRequireBuild: true, |
179 | 179 | projectFileHash: this.getProjectFileStrippedHash(projectData, platform), |
180 | 180 | changesRequireBuildTime: null, |
181 | | - appFilesHashes: await this.$filesHashService.generateHashes(this.getAppFiles(projectData.appDirectoryPath)) |
| 181 | + appFilesHashes: await this.$filesHashService.generateHashes(this.getAppFiles(projectData)) |
182 | 182 | }; |
183 | 183 |
|
184 | 184 | this._outputProjectMtime = 0; |
@@ -306,12 +306,12 @@ export class ProjectChangesService implements IProjectChangesService { |
306 | 306 | return false; |
307 | 307 | } |
308 | 308 |
|
309 | | - private getAppFiles(appDirectoryPath: string): string[] { |
310 | | - return this.$fs.enumerateFilesInDirectorySync(appDirectoryPath, (filePath: string, stat: IFsStats) => filePath.indexOf(APP_RESOURCES_FOLDER_NAME) === -1); |
| 309 | + private getAppFiles(projectData: IProjectData): string[] { |
| 310 | + return this.$fs.enumerateFilesInDirectorySync(projectData.appDirectoryPath, (filePath: string, stat: IFsStats) => filePath !== projectData.appResourcesDirectoryPath); |
311 | 311 | } |
312 | 312 |
|
313 | 313 | private async hasChangedAppFiles(projectData: IProjectData): Promise<boolean> { |
314 | | - const files = this.getAppFiles(projectData.appDirectoryPath); |
| 314 | + const files = this.getAppFiles(projectData); |
315 | 315 | const changedFiles = await this.$filesHashService.getChanges(files, this._prepareInfo.appFilesHashes || {}); |
316 | 316 | const hasChanges = changedFiles && _.keys(changedFiles).length > 0; |
317 | 317 | if (hasChanges) { |
|
0 commit comments