Skip to content
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

Change paths in coverage tests for sbt layout #47

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[html]
directory = out/commons/scoverage/htmlReport
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
target
out
21 changes: 11 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
sudo: required
language: scala
scala:
- 2.12.2
- 2.12.2
jdk:
- oraclejdk8
- oraclejdk8
script:
- sbt +clean coverage +test && sbt coverageReport coverageAggregate
- find $HOME/.sbt -name "*.lock" | xargs rm
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
- curl -L -o ~/bin/mill https://github.com/lihaoyi/mill/releases/download/0.2.6/0.2.6 && chmod +x ~/bin/mill
- export PATH=~/bin/mill:$PATH
- mill __.clean && mill __.test && mill __.scoverage.htmlReport
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
cache:
directories:
- "$HOME/.ivy2/cache"
- "$HOME/.sbt/boot/"
- "$HOME/.ivy2/cache"
- "$HOME/bin/mill"
before_install:
- pip install --user codecov
- sudo chmod +x /usr/local/bin/sbt
- pip install --user codecov
- sudo chmod +x /usr/local/bin/sbt
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 __.publish --release true
env:
global:
- secure: erKEtyVxyTgRQIrzva785xST9EhsYY+40SKhaHumIvXgfHtL6SppXCd213LXdwrKms23v/BZ43I5gOfEuX405FV1a8B7e+IGj1sG118MtlcVEyqSfuwGWtmsjhyWkvfHdyXzC8Aej5FpT9il74IdYJYVWW18UOh/q7cBI3duV5p9iooJG6IZ8zc1042+uKq4sfM9EnZEyCiffpVmqknRWZ47vlDEOiURYqccvJ0VN2P2mWSHTRMlXPGHuhy5KVMC/DIsZFbX2MaKMIT73hGMA8l6RS98ZSk7DkgrNr3hKy7P4YU9VyLRiz7S4MhCmS2L/NUEGI6V5Gouxpol+IX93IcpLp0ZgzYMfpnWfZyjTIx627cKKAsSOqoGteRFRArKwbag15u9lHltAu911PVa2bICZy0snr/CQx18++3hIPrKXLk5MnU4jQGOtZ1FbScPgEJBP2M6bUKHKPx2EJfQ5KtJgQtpv26LwLhrlJ+lRRQrirL0N3PAcciRtjGubAlB4ai9Qx6dVdJ84tlWMcgvZA2HExnK8uU6MK1biWBZevMrJ8qeb55CCaK5R7fZZJvAYKH9LIxt2YO2C8tVDEmPxjiZBp6jr9Ib+oiHU27PhUxzG1xK264tzp1LoBIewcUunbicDzqBPsQ60ByCaBhgin76E6+H+uxUY3tEnuIWX7c=
Expand Down
122 changes: 0 additions & 122 deletions build.sbt

This file was deleted.

70 changes: 70 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import $ivy.`com.lihaoyi::mill-contrib-buildinfo:0.4.0`
import mill.contrib.scoverage.ScoverageModule

import mill.Cross
import mill.scalalib.{SbtModule, PublishModule, Dep, CrossSbtModule, DepSyntax}
import mill.scalalib.publish.{PomSettings, License, Developer, SCM}
import ammonite.ops._

import scala.sys.process.Process

object commons extends SbtModule with ScoverageModule with PublishModule { outer =>
def millSourcePath = super.millSourcePath / ammonite.ops.up
def artifactName = "commons"
def gitHash = Process("git rev-parse --short HEAD").lineStream.head
def publishVersion = s"0.6.0-${gitHash}-SNAPSHOT"
def scalaVersion = "2.12.8"
def scoverageVersion = "1.3.1"
def scalacOptions = Seq("-target:jvm-1.8", "-deprecation", "-unchecked")

// TODO: start year (2015)
// 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 Tests {
def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.5")
def testFrameworks = Seq("org.scalatest.tools.Framework")
}

object coverage extends ScoverageTests {
def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.5")
def testFrameworks = Seq("org.scalatest.tools.Framework")

// See: https://github.com/lihaoyi/mill/blob/master/scalalib/src/MiscModule.scala#L66-L77
override def millSourcePath = outer.millSourcePath
override def intellijModulePath = outer.millSourcePath / 'src / 'test
override def sources = T.sources(
millSourcePath / 'src / 'test / 'scala,
millSourcePath / 'src / 'test / 'java
)
override def resources = T.sources{ millSourcePath / 'src / 'test / 'resources }

}

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") }
}
1 change: 0 additions & 1 deletion project/build.properties

This file was deleted.

9 changes: 0 additions & 9 deletions project/plugins.sbt

This file was deleted.

22 changes: 0 additions & 22 deletions sonatype.sbt

This file was deleted.

7 changes: 0 additions & 7 deletions version.sbt

This file was deleted.