Skip to content

Commit

Permalink
Merge pull request #14 from rossabaker/master
Browse files Browse the repository at this point in the history
Support parameter inheritance
  • Loading branch information
jsuereth committed Nov 19, 2012
2 parents d3b4854 + f2522fe commit e0538b4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.goals= clean test-scala:echo
invoker.goals= clean test-scala:echo test-scala:child-echo
25 changes: 12 additions & 13 deletions src/it/test-mojo-project/src/it/testEcho/validate.groovy
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
def echoString = "HAI"
def logFile = new File(basedir, "target/echo.txt")
//Look for echo string
def found = false;
def fileNames = ["echo.txt", "child.txt"]

System.out.println("Logfile = " + logFile)
fileNames.each({ fileName ->
def found = false
def logFile = new File(basedir, "target/${fileName}")
logFile.eachLine({ line ->
if(line.startsWith(echoString)) {
found = true
}
});
assert found
})

logFile.eachLine({ line ->
System.out.println("Checking line: " + line)
if(line.startsWith(echoString)) {
found = true;
}
});

assert found
true
true
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,20 @@ class TestMojo extends AbstractMojo {
if(!outputDirectory.exists) {
outputDirectory.mkdirs()
}
val file = new File(outputDirectory, "echo.txt")
val file = new File(outputDirectory, fileName)
val output = new PrintStream(new FileOutputStream(file))

output.println("HAI")
output.close()

}

val fileName = "echo.txt"
}

@goal("child-echo")
@phase("process-sources")
@requiresProject
class ChildMojo extends TestMojo {
override val fileName = "child.txt"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MojoExtractorCompiler(project: MavenProject) extends MavenProjectTools wit
val settings = new Settings();
//TODO - Set settings
settings.classpath.value = getCompileClasspathString(project)
settings.stop.tryToSetColon(List("superaccessors"))
settings.stop.tryToSetColon(List("constructors"))
settings.sourcepath.tryToSet(project.getCompileSourceRoots().asInstanceOf[java.util.List[String]].toList)
val reporter = new ConsoleReporter(settings);
(settings, reporter)
Expand Down

0 comments on commit e0538b4

Please sign in to comment.