Search in sources :

Example 1 with MavenResourceCompilerConfigurationGenerator

use of org.jetbrains.idea.maven.project.MavenResourceCompilerConfigurationGenerator in project intellij-community by JetBrains.

the class MavenCompilingTestCase method compile.

private void compile(final CompileScope scope) {
    try {
        CompilerTester tester = new CompilerTester(myProject, Arrays.asList(scope.getAffectedModules()));
        UIUtil.invokeAndWaitIfNeeded(new Runnable() {

            @Override
            public void run() {
                new MavenResourceCompilerConfigurationGenerator(myProject, MavenProjectsManager.getInstance(myProject).getProjectsTreeForTests()).generateBuildConfiguration(false);
            }
        });
        try {
            List<CompilerMessage> messages = tester.make(scope);
            for (CompilerMessage message : messages) {
                if (message.getCategory() == CompilerMessageCategory.ERROR) {
                    fail("Compilation failed with error: " + message.getMessage());
                }
            }
        } finally {
            tester.tearDown();
        }
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : MavenResourceCompilerConfigurationGenerator(org.jetbrains.idea.maven.project.MavenResourceCompilerConfigurationGenerator) CompilerMessage(com.intellij.openapi.compiler.CompilerMessage) CompilerTester(com.intellij.testFramework.CompilerTester) IOException(java.io.IOException)

Aggregations

CompilerMessage (com.intellij.openapi.compiler.CompilerMessage)1 CompilerTester (com.intellij.testFramework.CompilerTester)1 IOException (java.io.IOException)1 MavenResourceCompilerConfigurationGenerator (org.jetbrains.idea.maven.project.MavenResourceCompilerConfigurationGenerator)1