aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-03-17 03:09:07 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2017-03-17 03:09:07 -0400
commitebf93c0807053bf2408456e893e5e26afd805f0e (patch)
tree8018dfd7c5dbaf848cf6d5ac9a33688f527b8526 /test
parentb9c20082bcbd231eb67c3ded0d3fe6674c8c55b7 (diff)
downloadcbt-ebf93c0807053bf2408456e893e5e26afd805f0e.tar.gz
cbt-ebf93c0807053bf2408456e893e5e26afd805f0e.tar.bz2
cbt-ebf93c0807053bf2408456e893e5e26afd805f0e.zip
Replace dependencies feature for conflict resolution
Diffstat (limited to 'test')
-rw-r--r--test/simple/build/build.scala28
-rw-r--r--test/test.scala2
2 files changed, 29 insertions, 1 deletions
diff --git a/test/simple/build/build.scala b/test/simple/build/build.scala
index dd5f95b..3465ec3 100644
--- a/test/simple/build/build.scala
+++ b/test/simple/build/build.scala
@@ -15,7 +15,7 @@ class Build(val context: cbt.Context) extends BaseBuild{
// the below tests pom inheritance with variable substitution being parts of strings
MavenDependency("cc.factorie","factorie_2.11","1.2"),
// test recursive substitution. see https://github.com/cvogt/cbt/issues/434
- MavenDependency("com.amazonaws", "aws-java-sdk-s3", "1.11.86")
+ MavenDependency("com.amazonaws", "aws-java-sdk-s3", "1.11.86"),
// the dependency below uses a maven version range. Currently not supported.
// TODO: put in a proper error message for version range not supported
//MavenDependency("com.github.nikita-volkov", "sext", "0.2.4")
@@ -23,6 +23,19 @@ class Build(val context: cbt.Context) extends BaseBuild{
// org.apache.spark:spark-sql_2.11:1.6.1
// currently fails, let's see if because of a bug
// io.spray:spray-http:1.3.3
+ ScalaDependency( "com.lihaoyi", "scalatex-api", "0.3.6" ),
+ ScalaDependency( "com.lihaoyi", "scalatex-site", "0.3.6" )
+ ) ++
+ Resolver( mavenCentral, sonatypeReleases ).bind(
+ "org.scalameta" %% "scalameta" % "1.1.0"
+ ).map(
+ _.copy(
+ // without this .replace the ScalatexCrash will crash during macro expansion
+ replace = _ => _.map{
+ case MavenDependency("com.lihaoyi","scalaparse_2.11",_,_,_) => "com.lihaoyi" % "scalaparse_2.11" % "0.3.1"
+ case other => other
+ }
+ )
) ++
Resolver( new java.net.URL("http://maven.spikemark.net/roundeights") ).bind(
// Check that lower case checksums work
@@ -39,4 +52,17 @@ class Build(val context: cbt.Context) extends BaseBuild{
)
def printArgs = context.args.mkString(" ")
+
+ override def compile = {
+ val dummyScalatexFile = projectDirectory / "src_generated" / "ScalatexCrash.scalatex"
+ lib.write( dummyScalatexFile, "" )
+ lib.write(
+ projectDirectory / "src_generated" / "ScalatexCrash.scala",
+ s"""object ScalatexCrash{
+ import _root_.scalatags.Text.all._
+ val file = _root_.scalatex.twf("${dummyScalatexFile}")
+ }"""
+ )
+ super.compile
+ }
}
diff --git a/test/test.scala b/test/test.scala
index c49d1e5..6c629bb 100644
--- a/test/test.scala
+++ b/test/test.scala
@@ -92,6 +92,7 @@ object Main{
assert(res.out contains usageString, usageString + " not found in " ++ res.toString)
}
def compile(path: String)(implicit logger: Logger) = task("compile", path)
+ def run(path: String)(implicit logger: Logger) = task("run", path)
def task(name: String, path: String)(implicit logger: Logger) = {
val res = runCbt(path, Seq(name))
val debugToken = name ++ " " ++ path ++ " "
@@ -207,6 +208,7 @@ object Main{
clean("multi-build")
usage("simple")
compile("simple")
+ run("simple")
clean("simple")
if( compat ){
usage("simple-fixed")