Skip to content

Commit

Permalink
Merge pull request #67 from velo/basedir
Browse files Browse the repository at this point in the history
Configurable basedir.
  • Loading branch information
trautonen committed Mar 17, 2015
2 parents a4c6042 + 42f9770 commit ca358bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ public class CoverallsReportMojo extends AbstractMojo {
@Component
protected MavenProject project;

/**
* Scan subdirectories for a sources file.
*/
@Parameter(property = "coveralls.basedir", defaultValue = "${project.basedir}")
protected File basedir;

@Override
public final void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
Expand Down Expand Up @@ -275,7 +281,7 @@ protected List<ServiceSetup> getServices() {
* @throws IOException if an I/O error occurs
*/
protected Job createJob() throws IOException {
Git git = new GitRepository(project.getBasedir()).load();
Git git = new GitRepository(basedir).load();
return new Job()
.withRepoToken(repoToken)
.withServiceName(serviceName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ protected List<CoverageParser> createCoverageParsers(SourceLoader sourceLoader)
mojo.coverallsFile = folder.newFile();
mojo.dryRun = true;
mojo.skip = false;
mojo.basedir = TestIoUtil.getFile("/");

when(projectMock.getBasedir()).thenReturn(TestIoUtil.getFile("/"));

Expand Down

0 comments on commit ca358bd

Please sign in to comment.