1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.scala_tools.maven;
17
18 import java.io.File;
19 import java.util.List;
20
21 import org.apache.maven.model.Dependency;
22
23
24
25
26
27
28
29
30
31 public class ScalaCompileMojo extends ScalaCompilerSupport {
32
33
34
35
36 protected File outputDir;
37
38
39
40
41 protected File sourceDir;
42
43 protected List<String> getSourceDirectories() throws Exception {
44 List<String> sources = project.getCompileSourceRoots();
45
46 String scalaSourceDir = sourceDir.getCanonicalPath();
47 if(!sources.contains(scalaSourceDir)) {
48 sources.add(scalaSourceDir);
49 }
50 return sources;
51 }
52
53 @SuppressWarnings("unchecked")
54 @Override
55 protected List<String> getClasspathElements() throws Exception {
56 return project.getCompileClasspathElements();
57 }
58
59 @SuppressWarnings("unchecked")
60 @Override
61 protected List<Dependency> getDependencies() {
62 return project.getCompileDependencies();
63 }
64
65 @Override
66 protected File getOutputDir() throws Exception {
67 return outputDir.getAbsoluteFile();
68 }
69 }