Merge pull request #612 from coursier/topic/test-jar

Don't require adding type test-jar to classpathTypes
This commit is contained in:
Alexandre Archambault 2017-07-19 13:00:52 +02:00 committed by GitHub
commit 4fbb2f1992
5 changed files with 35 additions and 1 deletions

View File

@ -175,7 +175,10 @@ object CoursierPlugin extends AutoPlugin {
)
confs ++ extraSources.toSeq ++ extraDocs.toSeq
}
},
// Tests artifacts from Maven repositories are given this type.
// Adding it here so that these work straightaway.
classpathTypes += "test-jar"
)
override lazy val buildSettings = super.buildSettings ++ Seq(

View File

@ -0,0 +1,2 @@
scalaVersion := "2.11.8"
libraryDependencies += "org.jclouds.api" % "nova" % "1.5.9" classifier "tests"

View File

@ -0,0 +1,11 @@
{
val pluginVersion = sys.props.getOrElse(
"plugin.version",
throw new RuntimeException(
"""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin
)
)
addSbtPlugin("io.get-coursier" % "sbt-coursier" % pluginVersion)
}

View File

@ -0,0 +1,17 @@
import java.io.File
import java.nio.file.Files
import scala.util.Try
object Main extends App {
def classFound(clsName: String) = Try(
Thread.currentThread()
.getContextClassLoader()
.loadClass(clsName)
).toOption.nonEmpty
val classifierTest = classFound("org.jclouds.openstack.nova.functions.ParseServerFromJsonResponseTest")
assert(classifierTest, s"Couldn't find classifierTest")
}

View File

@ -0,0 +1 @@
> run