Search in sources :

Example 1 with ScalaCompileOptions

use of org.jetbrains.plugins.gradle.model.scala.ScalaCompileOptions in project intellij-community by JetBrains.

the class ScalaModelBuilderImplTest method testScalaModel.

@Test
public void testScalaModel() throws Exception {
    DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getIdeaProject().getModules();
    List<ScalaModel> scalaModels = ContainerUtil.mapNotNull(ideaModules, new Function<IdeaModule, ScalaModel>() {

        @Override
        public ScalaModel fun(IdeaModule module) {
            return allModels.getExtraProject(module, ScalaModel.class);
        }
    });
    assertEquals(1, scalaModels.size());
    ScalaModel scalaModel = scalaModels.get(0);
    ScalaCompileOptions scalaCompileOptions = scalaModel.getScalaCompileOptions();
    assertNotNull(scalaCompileOptions);
    assertEquals(1, scalaCompileOptions.getAdditionalParameters().size());
    assertEquals("-opt:opt", scalaCompileOptions.getAdditionalParameters().iterator().next());
}
Also used : ScalaCompileOptions(org.jetbrains.plugins.gradle.model.scala.ScalaCompileOptions) IdeaModule(org.gradle.tooling.model.idea.IdeaModule) ScalaModel(org.jetbrains.plugins.gradle.model.scala.ScalaModel) Test(org.junit.Test)

Aggregations

IdeaModule (org.gradle.tooling.model.idea.IdeaModule)1 ScalaCompileOptions (org.jetbrains.plugins.gradle.model.scala.ScalaCompileOptions)1 ScalaModel (org.jetbrains.plugins.gradle.model.scala.ScalaModel)1 Test (org.junit.Test)1