Commit 5bd0b966 authored by Mark Derricutt's avatar Mark Derricutt

Fix for missing test deps

parent 8a10b498
......@@ -17,7 +17,7 @@ To use this plugin and start compiling clojure code as part of your maven build,
<plugin>
<groupId>com.theoryinpractise</groupId>
<artifactId>clojure-maven-plugin</artifactId>
<version>1.2</version>
<version>1.3</version>
</plugin>
</plugins>
......
......@@ -40,6 +40,15 @@ public abstract class AbstractClojureCompilerMojo extends AbstractMojo {
*/
protected List<String> classpathElements;
/**
* Project test classpath.
*
* @parameter default-value="${project.testClasspathElements}"
* @required
* @readonly
*/
protected List<String> testClasspathElements;
/**
* Location of the file.
*
......@@ -132,7 +141,7 @@ public abstract class AbstractClojureCompilerMojo extends AbstractMojo {
List<File> dirs = new ArrayList<File>();
if (Arrays.asList(sourceDirectoryTypes).contains(SourceDirectory.COMPILE)) {
dirs.add(generatedSourceDirectory);
dirs.add(generatedSourceDirectory);
dirs.addAll(Arrays.asList(translatePaths(sourceDirectories)));
}
if (Arrays.asList(sourceDirectoryTypes).contains(SourceDirectory.TEST)) {
......@@ -170,7 +179,7 @@ public abstract class AbstractClojureCompilerMojo extends AbstractMojo {
cl.addArgument("-cp");
cl.addArgument(cp);
cl.addArgument("-Dclojure.compile.path=" + outputDirectory.getPath() + "");
if (warnOnReflection) cl.addArgument("-Dclojure.compile.warn-on-reflection=true");
cl.addArguments(clojureOptions, false);
......
......@@ -56,7 +56,7 @@ public class ClojureGenDocMojo extends AbstractClojureCompilerMojo {
final String[] allNamespaces = new NamespaceDiscovery(getLog(), compileDeclaredNamespaceOnly)
.discoverNamespacesIn(namespaces, getSourceDirectories(SourceDirectory.COMPILE, SourceDirectory.TEST));
for (String namespace : allNamespaces) {
sb.append("'").append(namespace);
if (count++ < allNamespaces.length - 1) {
......@@ -76,7 +76,7 @@ public class ClojureGenDocMojo extends AbstractClojureCompilerMojo {
callClojureWith(
getSourceDirectories(SourceDirectory.COMPILE, SourceDirectory.TEST),
outputDirectory, classpathElements, "clojure.main",
outputDirectory, testClasspathElements, "clojure.main",
new String[]{genDocClj.getPath()});
}
......
......@@ -78,7 +78,7 @@ public class ClojureRunTestMojo extends AbstractClojureCompilerMojo {
getLog().debug("Running clojure:test against " + testScript);
callClojureWith(allSourceDirectories, outputDirectory, classpathElements, "clojure.main", new String[]{testScript});
callClojureWith(allSourceDirectories, outputDirectory, testClasspathElements, "clojure.main", new String[]{testScript});
}
}
......
......@@ -35,7 +35,7 @@ public class TestClojureCompilerMojo extends AbstractClojureCompilerMojo {
getLog().info("Test compiliation is skipped");
} else {
final File[] allSourceDirectories = getSourceDirectories(SourceDirectory.COMPILE, SourceDirectory.TEST);
callClojureWith(allSourceDirectories, outputDirectory, classpathElements, "clojure.lang.Compile",
callClojureWith(allSourceDirectories, outputDirectory, testClasspathElements, "clojure.lang.Compile",
new NamespaceDiscovery(getLog(), compileDeclaredNamespaceOnly).discoverNamespacesIn(namespaces, allSourceDirectories));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment