Search in sources :

Example 1 with IssueCollector

use of org.eclipse.n4js.generator.headless.IssueCollector in project n4js by eclipse.

the class AccessControlTest method compile.

/**
 * Compiles the projects generated into the path at {@link #FIXTURE_ROOT}, which in this test case the projects
 * representing the currently tested scenario and returns the generated issues.
 *
 * @return the generated issues
 */
private static Collection<Issue> compile(MemberType memberType) {
    IssueCollector issueCollector = new IssueCollector();
    try {
        N4HeadlessCompiler hlc = HeadlessCompilerFactory.createCompilerWithDefaults();
        final File projectRoot = Paths.get(FIXTURE_ROOT, memberType.name()).toFile();
        hlc.compileAllProjects(Arrays.asList(projectRoot), issueCollector);
    } catch (N4JSCompileException e) {
    // nothing to do
    }
    return issueCollector.getCollectedIssues();
}
Also used : N4JSCompileException(org.eclipse.n4js.generator.headless.N4JSCompileException) N4HeadlessCompiler(org.eclipse.n4js.generator.headless.N4HeadlessCompiler) IssueCollector(org.eclipse.n4js.generator.headless.IssueCollector) File(java.io.File)

Aggregations

File (java.io.File)1 IssueCollector (org.eclipse.n4js.generator.headless.IssueCollector)1 N4HeadlessCompiler (org.eclipse.n4js.generator.headless.N4HeadlessCompiler)1 N4JSCompileException (org.eclipse.n4js.generator.headless.N4JSCompileException)1