Skip to content

Commit e27f9ca

Browse files
authored
Merge pull request #1846 from NativeScript/excluded-files
.map and .ts files are excluded in release only
2 parents afc1a67 + 2010a60 commit e27f9ca

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

lib/services/livesync/livesync-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class LiveSyncService implements ILiveSyncService {
1515
private $projectData: IProjectData,
1616
private $projectDataService: IProjectDataService,
1717
private $prompter: IPrompter,
18-
private $injector: IInjector) { }
18+
private $injector: IInjector,
19+
private $options: IOptions) { }
1920

2021
private ensureAndroidFrameworkVersion(platformData: IPlatformData): IFuture<void> { // TODO: this can be moved inside command or canExecute function
2122
return (() => {
@@ -64,7 +65,7 @@ class LiveSyncService implements ILiveSyncService {
6465
appIdentifier: this.$projectData.projectId,
6566
projectFilesPath: path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME),
6667
syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME),
67-
excludedProjectDirsAndFiles: constants.LIVESYNC_EXCLUDED_FILE_PATTERNS,
68+
excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : [],
6869
forceExecuteFullSync: this.forceExecuteFullSync
6970
};
7071
this.$liveSyncServiceBase.sync(liveSyncData).wait();

lib/services/platform-service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,11 @@ export class PlatformService implements IPlatformService {
269269
// verify .xml files are well-formed
270270
this.$xmlValidator.validateXmlFiles(sourceFiles).wait();
271271

272-
// Remove .ts and .js.map files
273-
constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, { nocase: true })));
272+
// Remove .ts and .js.map files in release
273+
if (this.$options.release) {
274+
constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, { nocase: true })));
275+
}
276+
274277
let copyFileFutures = sourceFiles.map(source => {
275278
let destinationPath = path.join(appDestinationDirectoryPath, path.relative(appSourceDirectoryPath, source));
276279
if (this.$fs.getFsStats(source).wait().isDirectory()) {

lib/services/test-execution-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class TestExecutionService implements ITestExecutionService {
235235
projectFilesPath: projectFilesPath,
236236
syncWorkingDirectory: path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME),
237237
canExecuteFastSync: false, // Always restart the application when change is detected, so tests will be rerun.
238-
excludedProjectDirsAndFiles: constants.LIVESYNC_EXCLUDED_FILE_PATTERNS
238+
excludedProjectDirsAndFiles: this.$options.release ? constants.LIVESYNC_EXCLUDED_FILE_PATTERNS : []
239239
};
240240

241241
this.$liveSyncServiceBase.sync(liveSyncData).wait();

0 commit comments

Comments
 (0)