From 974a6df629e065c6f46951e4a2cda46f25f16008 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 27 May 2016 13:44:30 +0300 Subject: [PATCH 1/2] XML validation fixed --- lib/services/platform-service.ts | 7 +++++-- lib/xml-validator.ts | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 49472a88b6..b82ff6e5f4 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -268,8 +268,11 @@ export class PlatformService implements IPlatformService { sourceFiles = sourceFiles.filter(source => !minimatch(source, `**/${constants.TNS_MODULES_FOLDER_NAME}/**`, { nocase: true })); } - // verify .xml files are well-formed - this.$xmlValidator.validateXmlFiles(sourceFiles).wait(); + // Verify .xml files are well-formed. If not valid stop the transfer. + if(!this.$xmlValidator.validateXmlFiles(sourceFiles).wait()){ + this.$errors.failWithoutHelp("Invalid or not well-formed XML files detected!"); + return false; + } // Remove .ts and .js.map files constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, { nocase: true }))); diff --git a/lib/xml-validator.ts b/lib/xml-validator.ts index c2546e41b3..cd0275a600 100644 --- a/lib/xml-validator.ts +++ b/lib/xml-validator.ts @@ -18,8 +18,8 @@ export class XmlValidator implements IXmlValidator { let hasErrors = !!errorOutput; xmlHasErrors = xmlHasErrors || hasErrors; if (hasErrors) { - this.$logger.warn(`${file} has syntax errors.`); - this.$logger.out(errorOutput); + this.$logger.info(`${file} has syntax errors.`.red.bold); + this.$logger.out(errorOutput.yellow); } }); return !xmlHasErrors; From 6f897e1e7f22cb0a9bb07c54c0a048272078a8e7 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Fri, 27 May 2016 13:45:19 +0300 Subject: [PATCH 2/2] SHA updated --- lib/common | 2 +- lib/services/platform-service.ts | 9 +++------ test/ios-project-service.ts | 1 + test/platform-service.ts | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/common b/lib/common index 3fd5124602..82716ac632 160000 --- a/lib/common +++ b/lib/common @@ -1 +1 @@ -Subproject commit 3fd5124602667d209cb0fa81ec661059ff54b2d4 +Subproject commit 82716ac632fc8d4338e249d9ab56392a7e6b3473 diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index b82ff6e5f4..495ea1d46c 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -268,11 +268,8 @@ export class PlatformService implements IPlatformService { sourceFiles = sourceFiles.filter(source => !minimatch(source, `**/${constants.TNS_MODULES_FOLDER_NAME}/**`, { nocase: true })); } - // Verify .xml files are well-formed. If not valid stop the transfer. - if(!this.$xmlValidator.validateXmlFiles(sourceFiles).wait()){ - this.$errors.failWithoutHelp("Invalid or not well-formed XML files detected!"); - return false; - } + // 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 }))); @@ -714,4 +711,4 @@ export class PlatformService implements IPlatformService { }).future()(); } } -$injector.register("platformService", PlatformService); +$injector.register("platformService", PlatformService); \ No newline at end of file diff --git a/test/ios-project-service.ts b/test/ios-project-service.ts index 1e0229d502..4c967645fd 100644 --- a/test/ios-project-service.ts +++ b/test/ios-project-service.ts @@ -82,6 +82,7 @@ function createTestInjector(projectPath: string, projectName: string): IInjector testInjector.register("xcprojService", {}); testInjector.register("pluginVariablesService", PluginVariablesService); testInjector.register("pluginVariablesHelper", PluginVariablesHelper); + testInjector.register("androidProcessService", {}); return testInjector; } diff --git a/test/platform-service.ts b/test/platform-service.ts index 7cf6574b56..220cb1f270 100644 --- a/test/platform-service.ts +++ b/test/platform-service.ts @@ -348,4 +348,4 @@ describe('Platform Service Tests', () => { assert.isFalse(warnings.indexOf("has errors") !== -1); }); }); -}); +}); \ No newline at end of file