Skip to content

Commit bfdbd8b

Browse files
committed
Avoid libraryDependencies for internal dependencies
1 parent 0e94467 commit bfdbd8b

File tree

12 files changed

+58
-88
lines changed

12 files changed

+58
-88
lines changed

build.sbt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ lazy val `domains-task` =
2323
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-ResetEverywhere` in Compile).value}"""
2424
)
2525
.dependsOn(`keywords-Shift`,
26+
`keywords-Each` % Test,
2627
`keywords-Fork` % Test,
2728
`keywords-Using` % Test,
2829
`keywords-Yield` % Test,
@@ -60,7 +61,7 @@ lazy val `keywords-Continue` =
6061
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-BangNotation` in Compile).value}""",
6162
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-ResetEverywhere` in Compile).value}"""
6263
)
63-
.dependsOn(Dsl)
64+
.dependsOn(Dsl, `keywords-Each` % Test)
6465

6566
lazy val `keywords-ContinueJS` = `keywords-Continue`.js
6667
lazy val `keywords-ContinueJVM` = `keywords-Continue`.jvm
@@ -95,7 +96,7 @@ lazy val `keywords-AsynchronousIo` =
9596
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-BangNotation` in Compile).value}""",
9697
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-ResetEverywhere` in Compile).value}"""
9798
)
98-
.dependsOn(`keywords-Shift`, `comprehension` % Test)
99+
.dependsOn(`keywords-Shift`, `keywords-Each` % Test, `keywords-Using` % Test, `comprehension` % Test, `domains-task` % Test)
99100
lazy val `keywords-AsynchronousIoJS` = `keywords-AsynchronousIo`.js
100101
lazy val `keywords-AsynchronousIoJVM` = `keywords-AsynchronousIo`.jvm
101102

@@ -194,7 +195,7 @@ lazy val `keywords-ForEach` =
194195
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-BangNotation` in Compile).value}""",
195196
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-ResetEverywhere` in Compile).value}"""
196197
)
197-
.dependsOn(Dsl)
198+
.dependsOn(Dsl, `keywords-Each` % Test)
198199
lazy val `keywords-ForEachJS` = `keywords-ForEach`.js
199200
lazy val `keywords-ForEachJVM` = `keywords-ForEach`.jvm
200201

@@ -205,7 +206,7 @@ lazy val `keywords-Each` =
205206
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-BangNotation` in Compile).value}""",
206207
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-ResetEverywhere` in Compile).value}"""
207208
)
208-
.dependsOn(Dsl, `keywords-Shift`, `keywords-Continue` % Test)
209+
.dependsOn(Dsl, `keywords-Shift`)
209210
lazy val `keywords-EachJS` = `keywords-Each`.js
210211
lazy val `keywords-EachJVM` = `keywords-Each`.jvm
211212

@@ -233,7 +234,7 @@ lazy val `keywords-Yield` =
233234
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-BangNotation` in Compile).value}""",
234235
scalacOptions += raw"""-Xplugin:${(packageBin in `compilerplugins-ResetEverywhere` in Compile).value}"""
235236
)
236-
.dependsOn(Dsl, `keywords-Shift` % Test, `keywords-Continue` % Test)
237+
.dependsOn(Dsl, `keywords-Shift` % Test, `keywords-Each` % Test, `keywords-Continue` % Test)
237238
lazy val `keywords-YieldJS` = `keywords-Yield`.js
238239
lazy val `keywords-YieldJVM` = `keywords-Yield`.jvm
239240

@@ -289,6 +290,10 @@ lazy val comprehension =
289290
`keywords-FlatMap`,
290291
`keywords-WithFilter`,
291292
`keywords-Return`,
293+
`keywords-Each` % Test,
294+
`keywords-Yield` % Test,
295+
`keywords-Using` % Test,
296+
`keywords-Continue` % Test,
292297
)
293298
lazy val comprehensionJS = comprehension.js
294299
lazy val comprehensionJVM = comprehension.jvm

comprehension/build.sbt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,3 @@ scalacOptions in Compile ++= {
1616
}
1717

1818
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.6-SNAP2" % Test
19-
20-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-each" % "1.3.1" % Test
21-
22-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-asynchronousio" % "1.3.1" % Test
23-
24-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-yield" % "1.3.1" % Test
25-
26-
libraryDependencies += "com.thoughtworks.dsl" %%% "domains-task" % "1.3.1" % Optional
27-
28-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-continue" % "1.3.1" % Test
29-
30-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-using" % "1.3.1" % Test

domains-task/.jvm/jvm.sbt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@ exampleSuperTypes := exampleSuperTypes.value.map {
77
case otherTrait =>
88
otherTrait
99
}
10-
11-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-each" % "1.3.1" % Optional
12-
13-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-fork" % "1.3.1" % Optional

keywords-AsynchronousIo/build.sbt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,3 @@ scalacOptions ++= {
77
None
88
}
99
}
10-
11-
libraryDependencies += "com.thoughtworks.dsl" %%% "comprehension" % "1.3.1" % Optional
12-
13-
libraryDependencies += "com.thoughtworks.dsl" %%% "domains-task" % "1.3.1" % Optional
14-
15-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-using" % "1.3.1" % Optional
16-
17-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-each" % "1.3.1" % Optional

keywords-Continue/build.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ libraryDependencies ++= {
1919
Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
2020
}
2121
}
22-
23-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-each" % "1.3.1" % Test

keywords-Each/build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ libraryDependencies ++= {
3131

3232
libraryDependencies += "com.thoughtworks.enableIf" %% "enableif" % "1.1.6"
3333

34-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-yield" % "1.3.1" % Test

keywords-Each/src/test/scala/com/thoughtworks/dsl/keywords/EachSpec.scala

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -151,50 +151,4 @@ class EachSpec extends FreeSpec with Matchers {
151151
}
152152
}
153153

154-
"Given a continuation that uses Yield and Each expressions" - {
155-
156-
def asyncFunction: Stream[String] !! Unit = _ {
157-
!Yield("Entering asyncFunction")
158-
val subThreadId: Int = !Each(Seq(0, 1))
159-
!Yield(s"Fork sub-thread $subThreadId")
160-
!Yield("Leaving asyncFunction")
161-
}
162-
163-
"When create a generator that contains Yield, Shift, and Each expressions" - {
164-
165-
def generator: Stream[String] = {
166-
!Yield("Entering generator")
167-
val threadId = !Each(Seq(0, 1))
168-
!Yield(s"Fork thread $threadId")
169-
!Shift(asyncFunction)
170-
Stream("Leaving generator")
171-
}
172-
173-
"Then the generator should contains yield values" in {
174-
generator should be(
175-
Seq(
176-
/**/ "Entering generator",
177-
/****/ "Fork thread 0",
178-
/******/ "Entering asyncFunction",
179-
/********/ "Fork sub-thread 0",
180-
/**********/ "Leaving asyncFunction",
181-
/**********/ "Leaving generator",
182-
/********/ "Fork sub-thread 1",
183-
/**********/ "Leaving asyncFunction",
184-
/**********/ "Leaving generator",
185-
/****/ "Fork thread 1",
186-
/******/ "Entering asyncFunction",
187-
/********/ "Fork sub-thread 0",
188-
/**********/ "Leaving asyncFunction",
189-
/**********/ "Leaving generator",
190-
/********/ "Fork sub-thread 1",
191-
/**********/ "Leaving asyncFunction",
192-
/**********/ "Leaving generator"
193-
))
194-
}
195-
196-
}
197-
198-
}
199-
200154
}

keywords-ForEach/build.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ scalacOptions in Compile ++= {
1010
case _ => Seq.empty
1111
}
1212
}
13-
14-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-each" % "1.3.1" % Test

keywords-Using/build.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ scalacOptions ++= {
1919
None
2020
}
2121
}
22-
23-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-await" % "1.3.1" % Test

keywords-Using/src/main/scala/com/thoughtworks/dsl/keywords/Using.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ object Using {
4949
* Therefore, the final value of `n` should be `(1 + 20) * 2 = 42`.
5050
*
5151
* {{{
52-
* import com.thoughtworks.dsl.Dsl.reset
53-
* Future {
54-
* !Await(multiplicationAfterAddition)
52+
* multiplicationAfterAddition.map { _ =>
5553
* n should be(42)
56-
* }: @reset
54+
* }
5755
* }}}
5856
*
5957
*/

keywords-Yield/build.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,3 @@ libraryDependencies ++= {
2424
Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
2525
}
2626
}
27-
28-
libraryDependencies += "com.thoughtworks.dsl" %%% "keywords-each" % "1.3.1" % Test

keywords-Yield/src/test/scala/com/thoughtworks/dsl/keywords/YieldSpec.scala

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,52 @@ import scala.runtime.NonLocalReturnControl
1313
*/
1414
class YieldSpec extends FreeSpec with Matchers {
1515

16+
"Given a continuation that uses Yield and Each expressions" - {
17+
18+
def asyncFunction: Stream[String] !! Unit = _ {
19+
!Yield("Entering asyncFunction")
20+
val subThreadId: Int = !Each(Seq(0, 1))
21+
!Yield(s"Fork sub-thread $subThreadId")
22+
!Yield("Leaving asyncFunction")
23+
}
24+
25+
"When create a generator that contains Yield, Shift, and Each expressions" - {
26+
27+
def generator: Stream[String] = {
28+
!Yield("Entering generator")
29+
val threadId = !Each(Seq(0, 1))
30+
!Yield(s"Fork thread $threadId")
31+
!Shift(asyncFunction)
32+
Stream("Leaving generator")
33+
}
34+
35+
"Then the generator should contains yield values" in {
36+
generator should be(
37+
Seq(
38+
/**/ "Entering generator",
39+
/****/ "Fork thread 0",
40+
/******/ "Entering asyncFunction",
41+
/********/ "Fork sub-thread 0",
42+
/**********/ "Leaving asyncFunction",
43+
/**********/ "Leaving generator",
44+
/********/ "Fork sub-thread 1",
45+
/**********/ "Leaving asyncFunction",
46+
/**********/ "Leaving generator",
47+
/****/ "Fork thread 1",
48+
/******/ "Entering asyncFunction",
49+
/********/ "Fork sub-thread 0",
50+
/**********/ "Leaving asyncFunction",
51+
/**********/ "Leaving generator",
52+
/********/ "Fork sub-thread 1",
53+
/**********/ "Leaving asyncFunction",
54+
/**********/ "Leaving generator"
55+
))
56+
}
57+
58+
}
59+
60+
}
61+
1662
"stream" - {
1763

1864
def shouldCompile = {

0 commit comments

Comments
 (0)