@@ -14,11 +14,19 @@ abstract class PublishLocalTestDefinitions extends ScalaCliSuite with TestScalaV
1414
1515 def testPublishVersion : String = " 1.5.6"
1616
17- private object PublishTestInputs {
17+ protected object PublishTestInputs {
1818 def testOrg : String = " test-local-org.sth"
1919 def testName : String = " my-proj"
20- def projFile (message : String , exclude : Boolean = false ): String =
21- s """ //> using scala $testedPublishedScalaVersion
20+ def projFile (
21+ message : String ,
22+ exclude : Boolean = false ,
23+ useTestScope : Boolean = false ,
24+ crossVersions : Option [Seq [String ]] = None
25+ ): String =
26+ s """ //> using scala ${crossVersions.map(
27+ _.mkString(" " )
28+ ).getOrElse(testedPublishedScalaVersion)}
29+ | ${if (useTestScope) " //> using target.scope test" else " " }
2230 |//> using dep com.lihaoyi::os-lib:0.11.3 ${Some (" ,exclude=com.lihaoyi%%geny" ).filter(_ =>
2331 exclude
2432 ).getOrElse(" " )}
@@ -43,14 +51,18 @@ abstract class PublishLocalTestDefinitions extends ScalaCliSuite with TestScalaV
4351 | """ .stripMargin
4452 }
4553
54+ lazy val projectFilePath : os.RelPath = os.rel / " src" / " project.scala"
55+ lazy val projectConfPath : os.RelPath = os.rel / " src" / " publish-conf.scala"
4656 def inputs (
4757 message : String = " Hello" ,
4858 includePublishVersion : Boolean = true ,
49- excludeGeny : Boolean = false
59+ excludeGeny : Boolean = false ,
60+ useTestScope : Boolean = false ,
61+ crossVersions : Option [Seq [String ]] = None
5062 ): TestInputs =
5163 TestInputs (
52- os.rel / " project.scala " -> projFile(message, excludeGeny),
53- os.rel / " publish-conf.scala " -> publishConfFile(includePublishVersion)
64+ projectFilePath -> projFile(message, excludeGeny, useTestScope, crossVersions ),
65+ projectConfPath -> publishConfFile(includePublishVersion)
5466 )
5567 }
5668
@@ -146,7 +158,7 @@ abstract class PublishLocalTestDefinitions extends ScalaCliSuite with TestScalaV
146158 val output1 = output()
147159 expect(output1 == " Hello" )
148160
149- os.write.over(root / " project.scala " , PublishTestInputs .projFile(" olleH" ))
161+ os.write.over(root / PublishTestInputs .projectFilePath , PublishTestInputs .projFile(" olleH" ))
150162 publishLocal()
151163 val output2 = output()
152164 expect(output2 == " olleH" )
0 commit comments