1 package org_scala_tools_maven_cs;
2
3 import org.apache.maven.plugin.MojoFailureException;
4
5 import org_scala_tools_maven.ScalaMojoSupport;
6
7 abstract public class ScalaCSMojoSupport extends ScalaMojoSupport {
8
9
10
11
12
13
14 protected String csGroupId = "net.alchim31";
15
16
17
18
19
20
21 protected String csArtifactId = "scalacs";
22
23
24
25
26
27
28 protected String csVersion = "0.2";
29
30 protected ScalacsClient scs;
31
32 @Override
33 final protected void doExecute() throws Exception {
34 scs = new ScalacsClient(this, csGroupId, csArtifactId, csVersion, jvmArgs);
35 String output = doRequest().toString();
36
37
38 System.out.println(output);
39 if (output.contains("-ERROR")) {
40 throw new MojoFailureException("ScalaCS reply with ERRORs");
41 }
42 }
43
44 protected abstract CharSequence doRequest() throws Exception;
45
46 protected String projectNamePattern() throws Exception {
47 return project.getArtifactId() + "-" + project.getVersion() + "/.*";
48 }
49 }