-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rework contrib.scoverage.api to be java based.
- Loading branch information
1 parent
d0a4153
commit 714f3e2
Showing
8 changed files
with
215 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
contrib/scoverage/api/src/mill/contrib/scoverage/api/ScoverageReportWorkerApi.scala
This file was deleted.
Oops, something went wrong.
95 changes: 95 additions & 0 deletions
95
contrib/scoverage/api/src/mill/contrib/scoverage/api/ScoverageReportWorkerApi2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package mill.contrib.scoverage.api; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Files; | ||
import java.io.IOException; | ||
import java.io.Serializable; | ||
|
||
public interface ScoverageReportWorkerApi2 { | ||
|
||
interface Logger { | ||
void info(String msg); | ||
void error(String msg); | ||
void debug(String msg); | ||
} | ||
|
||
interface Ctx { | ||
Logger log(); | ||
Path dest(); | ||
} | ||
|
||
public static abstract class ReportType implements Serializable { | ||
private String name; | ||
|
||
/*private[api]*/ | ||
ReportType(String name) {} | ||
|
||
public static final ReportType Console = new ConsoleModule(); | ||
public static final FileReportType Html = new HtmlModule(); | ||
public static final FileReportType Xml = new XmlModule(); | ||
public static final FileReportType XmlCobertura = new XmlCoberturaModule(); | ||
|
||
/* private[api]*/ | ||
static final class ConsoleModule extends ReportType implements Serializable { | ||
/* private[api]*/ | ||
ConsoleModule() { | ||
super("Console"); | ||
} | ||
}; | ||
|
||
/* private[api]*/ | ||
static final class HtmlModule extends FileReportType implements Serializable { | ||
/* private[api]*/ | ||
HtmlModule() { | ||
super("Html", "htmlReport"); | ||
} | ||
}; | ||
|
||
/* private[api]*/ | ||
static final class XmlModule extends FileReportType implements Serializable { | ||
/* private[api]*/ | ||
XmlModule() { | ||
super("Xml", "xmlReport"); | ||
} | ||
} | ||
|
||
/* private[api]*/ | ||
static final class XmlCoberturaModule extends FileReportType implements Serializable { | ||
/* private[api]*/ | ||
XmlCoberturaModule() { | ||
super("XmlCobertura", "xmlCoberturaReport"); | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} | ||
|
||
public static abstract class FileReportType extends ReportType implements Serializable { | ||
private final String folderName; | ||
|
||
/*private[api]*/ | ||
FileReportType(String name, String folderName) { | ||
super(name); | ||
this.folderName = folderName; | ||
} | ||
|
||
public String folderName() { | ||
return folderName; | ||
} | ||
} | ||
|
||
void report(ReportType reportType, Path[] sources, Path[] dataDirs, Path sourceRoot, Ctx ctx); | ||
|
||
static void makeAllDirs(Path path) throws IOException { | ||
// Replicate behavior of `os.makeDir.all(path)` | ||
if (Files.isDirectory(path) && Files.isSymbolicLink(path)) { | ||
// do nothing | ||
} else { | ||
Files.createDirectories(path); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
contrib/scoverage/src/mill/contrib/scoverage/ScoverageReport.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.