-
Notifications
You must be signed in to change notification settings - Fork 3
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
Changing to the mill build system #48
base: main
Are you sure you want to change the base?
Conversation
- code coverage - sonatype: http://www.lihaoyi.com/mill/page/common-project-layouts.html#publishing - name the output assembly JAR
This changes the build system to mill. Also: * remove the dependency badge since it no longer works
build.sc
Outdated
|
||
object commons extends ScalaModule with ScoverageModule with PublishModule { | ||
def artifactName = "commons" | ||
def gitHash = Process("git rev-parse --short HEAD").lineStream.head |
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 think you can avoid using Process and instead use ammonite os.proc
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.
A few questions and comments.
after_success: | ||
- codecov | ||
- test "$TRAVIS_REPO_SLUG" == 'fulcrumgenomics/commons' && test "$TRAVIS_PULL_REQUEST" | ||
== 'false' && test "$TRAVIS_BRANCH" == 'master' && sbt +publish | ||
== 'false' && test "$TRAVIS_BRANCH" == 'master' && mill mill.scalalib.PublishModule/publishAll "${SONATYPE_USERNAME}:${SONATYPE_PASSWORD}" __.publishArtifacts --release true |
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.
This is a little cumbersome. Is there a way to put some of this line into the build file so that the command is closer to mill publishAll
? Thinking about when we're doing official releases and doing this by hand.
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.
Also, is this doing cross-builds?
@@ -3,7 +3,6 @@ | |||
[![Code Review](https://api.codacy.com/project/badge/grade/52e1d786d9784c7192fae2f8e853fa34)](https://www.codacy.com/app/contact_32/commons) | |||
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fulcrumgenomics/commons_2.11/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.fulcrumgenomics/commons_2.11) | |||
[![Javadocs](http://javadoc.io/badge/com.fulcrumgenomics/commons_2.12.svg)](http://javadoc.io/doc/com.fulcrumgenomics/commons_2.12) | |||
[![Dependency Status](https://www.versioneye.com/user/projects/56b2d2d593b95a003c714340/badge.svg)](https://www.versioneye.com/user/projects/56b2d2d593b95a003c714340#dialog_dependency_badge) |
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.
Could we also add a little to the README about how to build the project, so how to get the minimum version of mill and what the command is to compile/test/build jar? Perhaps how to publish locally?
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.
We should also think about how one gets setup in IntelliJ since IntelliJ doesn't (yet) understand mill build files.
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.
mill mill.scalalib.GenIdea/idea;
def scoverageVersion = "1.3.1" | ||
def scalacOptions = Seq("-target:jvm-1.8", "-deprecation", "-unchecked") | ||
|
||
// TODO: start year (2015) |
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.
Can we resolve these TODOs?
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 could use some help 👍
import scala.sys.process.Process | ||
|
||
object commons extends ScalaModule with ScoverageModule with PublishModule { | ||
def artifactName = "commons" |
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.
Could we do something like getClass.getSimpleName
here to standardize object == artifact name? Or do we want to embed the version name here?
object commons extends ScalaModule with ScoverageModule with PublishModule { | ||
def artifactName = "commons" | ||
def gitHash = os.proc("git", "rev-parse", "--short", "HEAD").call().out.trim | ||
def publishVersion = s"0.8.0-${gitHash}-SNAPSHOT" |
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 wonder if there's an easy way to pass custom params to a mill build such that we could define the version as if (release) "0.8.0" else (s"....")
def artifactName = "commons" | ||
def gitHash = os.proc("git", "rev-parse", "--short", "HEAD").call().out.trim | ||
def publishVersion = s"0.8.0-${gitHash}-SNAPSHOT" | ||
def scalaVersion = "2.12.8" |
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.
So do we lose cross-building? That seems less than ideal.
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.
Ah yes, I'll want to do add that support. Mill has facilities to do this http://www.lihaoyi.com/mill/page/cross-builds.html
@@ -35,7 +35,7 @@ import scala.collection.mutable | |||
*/ | |||
class AsyncStreamSinkTest extends UnitSpec { | |||
"AsyncStreamSink" should "capture all the output" in { | |||
val file = Paths.get("src/test/resources/com/fulcrumgenomics/commons/io/async-stream-sink-test.txt") | |||
val file = Paths.get("commons/test/resources/com/fulcrumgenomics/commons/io/async-stream-sink-test.txt") |
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'm a bit surprised by this. Does mill require even for single-module builds that the main and test sources are within a module directory?
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.
@tfenne I'll address your feedback, but I added a few comments for your future reading. |
Note: this isn't ready until: