-
Notifications
You must be signed in to change notification settings - Fork 127
provide a CLI for writing reports from generated results #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Why a CLI API and not a standard Scala one? It's much easier to call scala method than to run Scala program. Not to mention you can then return some values, and not interface via files somewhere in target directory. Jerzy
|
I explained my reasoning here: scoverage/gradle-scoverage#22 |
Ok, I misunserstood that post. You do want to remove compile-time dependency between But could tou expose a Scala API and on top of it CLI API? Running separate JVM from sbt just to create a report seems like an overkill to me. I can help with coding/documenting it. |
No worries - re: your JVM concerns: I think that launching a new JVM with such a small classpath is a) trivial and b) cheap. Especially when compared to the other work involved just in compiling a small Scala project. maiflai/gradle-scct@5005d4d#diff-9a3db29361db74217cd9a3d2e970a3e6R137 shows the change required to the gradle build to remove the compile-time dependency. I agree that the SBT plugin (being tightly coupled to Scala) will indeed use the Scala API (the ReportWriter). The CLI exposes this via the Reports App for consumption by the non-Scala gradle and maven clients. Actually creating these reports (three formats, one of which a dynamically generated website) is complex, but the client API should make it appear simple. |
Thanks. Did you remove messages with paths where reports are generated by purpose? I think it's very helpful for user to just copy URI from console to browser/editor (or just ctrl+click it). |
Ah - no, that's an accident :-) Cheers, I'll update the PR. |
case (false, true) => | ||
CoverageAggregator.aggregate(baseDir, opts[Boolean](CLEAN_AGGREGATED_FILES)) | ||
case (true, true)=> | ||
Console.err.println(s"Cannot specify $SINGLE_DATA_DIR and $AGGREGATE_SUB_PROJECTS") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to have messages prefixed with plugin name, like [scoverage] Cannot specify (...)
, what do you think about that?
Is this good place to discuss differences between SBT/Maven and gradle regarding dependencies, classpaths, using different versions of scalac plugin, etc? |
Might as well be.
|
Every <plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>1.0.2</version>
<dependencies>
<dependency>
<groupId>org.scoverage</groupId>
<artifactId>scalac-scoverage-plugin_2.10</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</plugin> The whole configuration is on the plugin side. In Gradle example plugin version is declared in: |
What I would like to achieve is default configuration to be as simple as possible. |
I agree with the sentiment - my concern is that there appeared to be no consistent way to determine the version of scala that is being used in a gradle project. I'll check again later, but I thought the part of the Scala plugin that does this was private. sbt supports the %% syntax, does maven expose the major version? Does maven support cross-compilation? |
Maven does not expose anything, plugin is responsible for finding Scala version: |
Ah - yes, I don't want to release a new version of the gradle plugin when they start releasing 2.12 in a few months time. |
This is design choice. |
Looking at my code now, I could add |
There is |
The gradle code would functionally be a carbon copy of the maven code, but in physically fewer lines. I do object to every scala plugin implementing version discovery themselves. The current implementation is from a time when there was only one jar, and I felt that it did not add value to lock the user to precise maven coordinates. I'll look at adding a public scala binary version to the gradle scala plugin, with the aim being to provide similar information as SBT. |
So for now I think I'm going to actually close this. I've read through the thread and I believe I understand the issues raised, but I don't think creating a CLI is the way to go. Honestly, I'd probably be a better idea to provide a Java interface to write reports instead. If this is something that people still want to talk about and explore we can definitely do this, but it's been 6 years since there has been any movement here. |
A first attempt to expose an API that can be called from SBT, gradle and Maven