Skip to content

Commit e7db028

Browse files
committed
Merge pull request #1291 from NativeScript/totev/xml-warnings
Only warn about XML parsing errors
2 parents e5d15b5 + dbc7e95 commit e7db028

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lib/services/platform-service.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,7 @@ export class PlatformService implements IPlatformService {
237237
}
238238

239239
// verify .xml files are well-formed
240-
let validXmlFiles = this.checkXmlFiles(sourceFiles).wait();
241-
if (!validXmlFiles) {
242-
return false;
243-
}
240+
this.checkXmlFiles(sourceFiles).wait();
244241

245242
// Remove .ts and .js.map files
246243
PlatformService.EXCLUDE_FILES_PATTERN.forEach(pattern => sourceFiles = sourceFiles.filter(file => !minimatch(file, pattern, {nocase: true})));

test/platform-service.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,17 @@ describe('Platform Service Tests', () => {
331331
projectData.projectDir = tempFolder;
332332

333333
platformService = testInjector.resolve("platformService");
334-
let result = platformService.preparePlatform("android").wait();
334+
let oldLoggerWarner = testInjector.resolve("$logger").warn;
335+
let warnings: string = "";
336+
try {
337+
testInjector.resolve("$logger").warn = (text: string) => warnings += text;
338+
platformService.preparePlatform("android").wait();
339+
} finally {
340+
testInjector.resolve("$logger").warn = oldLoggerWarner;
341+
}
335342

336343
// Asserts that prepare has caught invalid xml
337-
assert.isFalse(result);
344+
assert.isFalse(warnings.indexOf("has errors") !== -1);
338345
});
339346
});
340347
});

0 commit comments

Comments
 (0)