ScalaModel (@Nullable Task task) { if (!(task instanceof ScalaCompile)) return null; ScalaCompile scalaCompile = (ScalaCompile)task; ScalaModelImpl scalaModel = new ScalaModelImpl(); scalaModel.setScalaClasspath(new LinkedHashSet<>(scalaCompile.getScalaClasspath().getFiles())); scalaModel.setZincClasspath(new LinkedHashSet<>(scalaCompile.getZincClasspath().getFiles())); scalaModel.setScalaCompileOptions(create(scalaCompile.getScalaCompileOptions())); scalaModel.setTargetCompatibility(scalaCompile.getTargetCompatibility()); scalaModel.setSourceCompatibility(scalaCompile.getSourceCompatibility()); return scalaModel; }