@@ -14,11 +14,19 @@ abstract class PublishLocalTestDefinitions extends ScalaCliSuite with TestScalaV
14
14
15
15
def testPublishVersion : String = " 1.5.6"
16
16
17
- private object PublishTestInputs {
17
+ protected object PublishTestInputs {
18
18
def testOrg : String = " test-local-org.sth"
19
19
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 " " }
22
30
|//> using dep com.lihaoyi::os-lib:0.11.3 ${Some (" ,exclude=com.lihaoyi%%geny" ).filter(_ =>
23
31
exclude
24
32
).getOrElse(" " )}
@@ -43,14 +51,18 @@ abstract class PublishLocalTestDefinitions extends ScalaCliSuite with TestScalaV
43
51
| """ .stripMargin
44
52
}
45
53
54
+ lazy val projectFilePath : os.RelPath = os.rel / " src" / " project.scala"
55
+ lazy val projectConfPath : os.RelPath = os.rel / " src" / " publish-conf.scala"
46
56
def inputs (
47
57
message : String = " Hello" ,
48
58
includePublishVersion : Boolean = true ,
49
- excludeGeny : Boolean = false
59
+ excludeGeny : Boolean = false ,
60
+ useTestScope : Boolean = false ,
61
+ crossVersions : Option [Seq [String ]] = None
50
62
): TestInputs =
51
63
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)
54
66
)
55
67
}
56
68
@@ -146,7 +158,7 @@ abstract class PublishLocalTestDefinitions extends ScalaCliSuite with TestScalaV
146
158
val output1 = output()
147
159
expect(output1 == " Hello" )
148
160
149
- os.write.over(root / " project.scala " , PublishTestInputs .projFile(" olleH" ))
161
+ os.write.over(root / PublishTestInputs .projectFilePath , PublishTestInputs .projFile(" olleH" ))
150
162
publishLocal()
151
163
val output2 = output()
152
164
expect(output2 == " olleH" )
0 commit comments