diff --git a/lib/services/livesync/livesync-service.ts b/lib/services/livesync/livesync-service.ts index 9d319d7e49..4984f3fc6d 100644 --- a/lib/services/livesync/livesync-service.ts +++ b/lib/services/livesync/livesync-service.ts @@ -15,7 +15,8 @@ class LiveSyncService implements ILiveSyncService { private $projectData: IProjectData, private $projectDataService: IProjectDataService, private $prompter: IPrompter, - private $injector: IInjector) { } + private $injector: IInjector, + private $options: IOptions) { } private ensureAndroidFrameworkVersion(platformData: IPlatformData): IFuture { // TODO: this can be moved inside command or canExecute function return (() => { @@ -64,7 +65,7 @@ class LiveSyncService implements ILiveSyncService { appIdentifier: this.$projectData.projectId, projectFilesPath: path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME), syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME), - excludedProjectDirsAndFiles: constants.LIVESYNC_EXCLUDED_FILE_PATTERNS, + excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : [], forceExecuteFullSync: this.forceExecuteFullSync }; this.$liveSyncServiceBase.sync(liveSyncData).wait(); diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index b8e17347ad..046a175190 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -269,8 +269,11 @@ export class PlatformService implements IPlatformService { // verify .xml files are well-formed this.$xmlValidator.validateXmlFiles(sourceFiles).wait(); - // Remove .ts and .js.map files - constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, { nocase: true }))); + // Remove .ts and .js.map files in release + if (this.$options.release) { + constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, { nocase: true }))); + } + let copyFileFutures = sourceFiles.map(source => { let destinationPath = path.join(appDestinationDirectoryPath, path.relative(appSourceDirectoryPath, source)); if (this.$fs.getFsStats(source).wait().isDirectory()) { diff --git a/lib/services/test-execution-service.ts b/lib/services/test-execution-service.ts index 416cc23716..316aad9fdc 100644 --- a/lib/services/test-execution-service.ts +++ b/lib/services/test-execution-service.ts @@ -235,7 +235,7 @@ class TestExecutionService implements ITestExecutionService { projectFilesPath: projectFilesPath, syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME), canExecuteFastSync: false, // Always restart the application when change is detected, so tests will be rerun. - excludedProjectDirsAndFiles: constants.LIVESYNC_EXCLUDED_FILE_PATTERNS + excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : [] }; this.$liveSyncServiceBase.sync(liveSyncData).wait();