-
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?
Changes from 14 commits
bada3db
4f4a717
f92d76f
738a5c0
d30df69
b0c3d83
6bceea9
a014099
4d710ef
7074359
b6c4f4a
68b146b
34e4f56
040acb8
1cf72a9
f36be31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[html] | ||
directory = out/commons/scoverage/htmlReport |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.idea | ||
target | ||
out |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/fulcrumgenomics/commons/blob/master/LICENSE) | ||
[![Language](http://img.shields.io/badge/language-scala-brightgreen.svg)](http://www.scala-lang.org/) | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// IMPORTANT: the version of the contrib modules must be 0.4.0-9-1db2ee or later. | ||
// IMPORTANT: if you change this version to a release, please update the .travis.yml | ||
// FIXME: change to a release version after 0.4.0-9-1db2ee | ||
import $ivy.`com.lihaoyi::mill-contrib-buildinfo:0.4.0-9-1db2ee` | ||
import mill.contrib.scoverage.ScoverageModule | ||
|
||
import mill.scalalib.{PublishModule, Dep, DepSyntax, ScalaModule} | ||
import mill.scalalib.publish.{PomSettings, License, Developer, SCM} | ||
import ammonite.ops._ | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Could we do something like |
||
def gitHash = Process("git rev-parse --short HEAD").lineStream.head | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
def publishVersion = s"0.6.0-${gitHash}-SNAPSHOT" | ||
def scalaVersion = "2.12.8" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 |
||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I could use some help 👍 |
||
// TODO: organization homepage ("http://www.fulcrumgenomics.com") | ||
def pomSettings = PomSettings( | ||
description = artifactName(), | ||
organization = "com.fulcrumgenomics", | ||
url = "https://github.com/fulcrumgenomics/commons", | ||
licenses = Seq(License("MIT license", "http://www.opensource.org/licenses/mit-license.php")), | ||
scm = SCM( | ||
"git://github.com/fulcrumgenomics/commons.git", | ||
"scm:git://github.com/fulcrumgenomics/commons.git" | ||
), | ||
developers = Seq( | ||
Developer("nh13", "Nils Homer", "https://github.com/nh13"), | ||
Developer("tfenne", "Tim Fennell", "https://github.com/tfenne") | ||
) | ||
) | ||
|
||
def ivyDeps = Agg( | ||
ivy"org.scala-lang:scala-compiler:${scalaVersion()}", | ||
ivy"com.typesafe:config:1.3.2" | ||
) | ||
|
||
// TODO: ignore long running tests with "-l LongRunningTest" | ||
object test extends ScoverageTests { | ||
def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.5") | ||
def testFrameworks = Seq("org.scalatest.tools.Framework") | ||
} | ||
|
||
private def deployJar(assembly: PathRef, jarName:String) = { | ||
mkdir(pwd / 'jars) | ||
println(s"Copying artifact ${assembly.path} to jars / $jarName") | ||
cp.over(assembly.path, pwd / 'jars / jarName) | ||
} | ||
|
||
def assemblyJar = T { deployJar(assembly(), s"commons-${publishVersion()}.jar") } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. |
||
val expected = Io.toSource(file).getLines().toList | ||
|
||
val proc = new ProcessBuilder("cat", file.toString).start() | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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?