Skip to content

Only warn about XML parsing errors #1291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ export class PlatformService implements IPlatformService {
}

// verify .xml files are well-formed
let validXmlFiles = this.checkXmlFiles(sourceFiles).wait();
if (!validXmlFiles) {
return false;
}
this.checkXmlFiles(sourceFiles).wait();

// Remove .ts and .js.map files
PlatformService.EXCLUDE_FILES_PATTERN.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, {nocase: true})));
Expand Down
11 changes: 9 additions & 2 deletions test/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,17 @@ describe('Platform Service Tests', () => {
projectData.projectDir = tempFolder;

platformService = testInjector.resolve("platformService");
let result = platformService.preparePlatform("android").wait();
let oldLoggerWarner = testInjector.resolve("$logger").warn;
let warnings: string = "";
try {
testInjector.resolve("$logger").warn = (text: string) => warnings += text;
platformService.preparePlatform("android").wait();
} finally {
testInjector.resolve("$logger").warn = oldLoggerWarner;
}

// Asserts that prepare has caught invalid xml
assert.isFalse(result);
assert.isFalse(warnings.indexOf("has errors") !== -1);
});
});
});