Skip to content

Commit

Permalink
Bumped toolkit and dependency versions and resolved resulting issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
tfenne committed Oct 6, 2023
1 parent 6ea1c2c commit f5902b6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 29 deletions.
42 changes: 17 additions & 25 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import java.text.SimpleDateFormat
import java.util.Date

import mill._
import mill.scalalib._
import mill.scalalib.publish.{Developer, License, PomSettings, SCM}
import mill.scalalib.publish._
import java.util.jar.Attributes.Name.{IMPLEMENTATION_VERSION => ImplementationVersion}

import ammonite.ops._
import coursier.maven.MavenRepository

import scala.sys.process.Process
Expand All @@ -15,23 +11,23 @@ import scala.util.{Failure, Success, Try}
/** Base trait for build modules. */
trait CommonModule extends SbtModule {
def deployLocal(assembly: PathRef, jarName:String) = {
mkdir(pwd / 'jars)
os.makeDir.all(os.pwd / Symbol("jars"))
println(s"Copying artifact ${assembly.path} to jars / $jarName")
cp.over(assembly.path, pwd / 'jars / jarName)
os.copy(assembly.path, os.pwd / Symbol("jars") / jarName, replaceExisting = true)
}

override def repositories: Seq[coursier.Repository] = super.repositories ++ Seq(
MavenRepository("https://oss.sonatype.org/content/repositories/public"),
MavenRepository("https://oss.sonatype.org/content/repositories/snapshots"),
MavenRepository("https://jcenter.bintray.com/"),
MavenRepository("https://artifactory.broadinstitute.org/artifactory/libs-snapshot/")
MavenRepository("https://broadinstitute.jfrog.io/artifactory/libs-snapshot/")
)
}

/** A base trait for versioning modules. */
trait ReleaseModule extends JavaModule {
/** Execute Git arguments and return the standard output. */
private def git(args: String*): String = %%("git", args)(pwd).out.string.trim
private def git(args: String*): String = os.proc("git", args).call().out.text().trim

/** Get the commit hash at the HEAD of this branch. */
private def gitHead: String = git("rev-parse", "HEAD")
Expand Down Expand Up @@ -73,21 +69,18 @@ trait ReleaseModule extends JavaModule {


object tools extends CommonModule with PublishModule with ReleaseModule {
def scalaVersion = "2.13.3"
def millSourcePath = super.millSourcePath / ammonite.ops.up
def mainClass = Some("com.fulcrumgenomics.sv.cmdline.SvMain")
def artifactName = "fgsv"
def scalaVersion = "2.13.12"
override def millSourcePath = super.millSourcePath / os.up
override def mainClass = Some("com.fulcrumgenomics.sv.cmdline.SvMain")
override def artifactName = "fgsv"
def gitHash = Process("git rev-parse --short HEAD").lineStream.head
def publishVersion = s"0.0.4-${gitHash}-SNAPSHOT"
def publishVersion = s"0.1.0-${gitHash}-SNAPSHOT"
def pomSettings = PomSettings(
description = artifactName(),
organization = "com.fulcrumgenomics",
url = "https://github.com/fulcrumgenomics/fgsv",
licenses = Seq(License("MIT License", "http://www.fulcrumgenomics.com")),
scm = SCM(
"git://github.com:fulcrumgenomics/fgsv.git",
"scm:git://github.com:fulcrumgenomics/fgsv.git"
),
licenses = Seq(License.MIT),
versionControl = VersionControl.github("fulcrumgenomics","fgsv"),
developers = Seq(
Developer("tfenne", "Tim Fennell", "https://github.com/tfenne"),
Developer("nh13", "Nils Homer", "https://github.com/nh13"),
Expand All @@ -101,23 +94,22 @@ object tools extends CommonModule with PublishModule with ReleaseModule {
"com.google.cloud.genomics"
)

def ivyDeps = Agg(
override def ivyDeps = Agg(
ivy"org.scala-lang:scala-compiler:${scalaVersion()}",
ivy"com.fulcrumgenomics:fgbio_2.13:1.5.0".excludeOrg(orgsToExclude:_*),
ivy"org.xerial.snappy:snappy-java:1.1.8.4"
ivy"com.fulcrumgenomics:fgbio_2.13:2.1.0".excludeOrg(orgsToExclude:_*)
)

object test extends Tests {
def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.1.0")
def testFramework = "org.scalatest.tools.Framework"
override def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.1.0")
override def testFramework = "org.scalatest.tools.Framework"

// run mill tools.test.singleTest com.fulcrumgenomics.sv.x.y.x.TestClassName
def singleTest(args: String*) = T.command {
super.runMain("org.scalatest.run", args: _*)
}
}

def javacOptions = Seq("-source", "1.8", "-target", "1.8")
override def javacOptions = Seq("-source", "1.8", "-target", "1.8")

def deployLocal = T { super.deployLocal(assembly(), "fgsv.jar") }
}
2 changes: 1 addition & 1 deletion mill
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This is a wrapper script, that automatically download mill from GitHub release pages
# You can give the required mill version with MILL_VERSION env variable
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
DEFAULT_MILL_VERSION=0.9.12
DEFAULT_MILL_VERSION=0.10.4

set -e

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class FgSvMetricsDoclet extends FgMetricsDoclet {
}

/** Locates the metrics documentation templates and turns them into simple case classes with comments as markdown. */
private lazy val metrics: Seq[MetricDescription] = {
override protected lazy val metrics: Seq[MetricDescription] = {
def simplify(name: String) = if (name.indexOf('.') > 0) name.substring(name.lastIndexOf('.') + 1) else name

findMetricsClasses.map{ template =>
Expand Down Expand Up @@ -89,7 +89,7 @@ class FgSvMetricsDoclet extends FgMetricsDoclet {
}

/** Take the body of a scaladoc comment and renders it into MarkDown. */
private def renderBody(body: Body): String = {
override protected def renderBody(body: Body): String = {
val buffer = new StringBuilder

// Takes a block element and renders it into MarkDown and writes it into the buffer
Expand Down Expand Up @@ -125,6 +125,6 @@ class FgSvMetricsDoclet extends FgMetricsDoclet {
}

/** Turns the text from a heading into the text to use as a link target. */
private def toLinkTarget(heading: String): String = heading.toLowerCase.replace(' ', '-')
override protected def toLinkTarget(heading: String): String = heading.toLowerCase.replace(' ', '-')
}

0 comments on commit f5902b6

Please sign in to comment.