Skip to content

Commit 0ac347d

Browse files
committed
Make package and skip list in GenScalaTestDotty as Map that can be shared by GenModulesDotty.
1 parent a2dc07b commit 0ac347d

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

project/GenScalaTestDotty.scala

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ object GenScalaTestDotty {
126126
copyResourceDir("scalatest/src/main/resources/org/scalatest", "org/scalatest", targetDir, List.empty)
127127
}
128128

129-
def genScala(targetDir: File, version: String, scalaVersion: String): Seq[File] = {
130-
copyDir("scalatest/src/main/scala/org/scalatest", "org/scalatest", targetDir,
131-
List(
129+
val genScalaPackages: Map[String, List[String]] =
130+
Map(
131+
"org/scalatest" -> List(
132132
"Assertions.scala", // Re-implemented
133133
"AssertionsMacro.scala", // Re-implemented
134134
"CompileMacro.scala", // Re-implemented
@@ -141,52 +141,50 @@ object GenScalaTestDotty {
141141
"StreamlinedXml.scala", // Hmm, not sure what to do with XML support, let's ask.
142142
"StreamlinedXmlEquality.scala", // Hmm, not sure what to do with XML support, let's ask.
143143
"StreamlinedXmlNormMethods.scala" // Hmm, not sure what to do with XML support, let's ask.
144-
)
145-
) ++
146-
copyDir("scalatest/src/main/scala/org/scalatest/concurrent", "org/scalatest/concurrent", targetDir, List.empty) ++
147-
copyDir("scalatest/src/main/scala/org/scalatest/diagrams", "org/scalatest/diagrams", targetDir,
148-
List(
144+
),
145+
"org/scalatest/concurrent" -> List.empty,
146+
"org/scalatest/diagrams" -> List(
149147
"Diagrams.scala",
150148
"DiagramsMacro.scala"
151-
)
152-
) ++
153-
copyDir("scalatest/src/main/scala/org/scalatest/exceptions", "org/scalatest/exceptions", targetDir, List.empty) ++
154-
copyDir("scalatest/src/main/scala/org/scalatest/enablers", "org/scalatest/enablers", targetDir, List.empty) ++
155-
copyDir("scalatest/src/main/scala/org/scalatest/events", "org/scalatest/events", targetDir, List.empty) ++
156-
copyDir("scalatest/src/main/scala/org/scalatest/fixture", "org/scalatest/fixture", targetDir, List.empty) ++
157-
copyDir("scalatest/src/main/scala/org/scalatest/featurespec", "org/scalatest/featurespec", targetDir, List.empty) ++
158-
copyDir("scalatest/src/main/scala/org/scalatest/funspec", "org/scalatest/funspec", targetDir, List.empty) ++
159-
copyDir("scalatest/src/main/scala/org/scalatest/funsuite", "org/scalatest/funsuite", targetDir, List.empty) ++
160-
copyDir("scalatest/src/main/scala/org/scalatest/freespec", "org/scalatest/freespec", targetDir, List.empty) ++
161-
copyDir("scalatest/src/main/scala/org/scalatest/flatspec", "org/scalatest/flatspec", targetDir, List.empty) ++
162-
copyDir("scalatest/src/main/scala/org/scalatest/matchers", "org/scalatest/matchers", targetDir,
163-
List(
149+
),
150+
"org/scalatest/exceptions" -> List.empty,
151+
"org/scalatest/enablers" -> List.empty,
152+
"org/scalatest/events" -> List.empty,
153+
"org/scalatest/fixture" -> List.empty,
154+
"org/scalatest/featurespec" -> List.empty,
155+
"org/scalatest/funspec" -> List.empty,
156+
"org/scalatest/funsuite" -> List.empty,
157+
"org/scalatest/freespec" -> List.empty,
158+
"org/scalatest/flatspec" -> List.empty,
159+
"org/scalatest/matchers" -> List(
164160
"Matcher.scala", // Re-implemented with new macro
165161
"MatchPatternMacro.scala", // Re-implemented with new macro
166162
"TypeMatcherMacro.scala" // Re-implemented with new macro
167-
)
168-
) ++
169-
copyDir("scalatest/src/main/scala/org/scalatest/matchers/dsl", "org/scalatest/matchers/dsl", targetDir,
170-
List(
163+
),
164+
"org/scalatest/matchers/dsl" -> List(
171165
"BeWord.scala",
172166
"JavaCollectionWrapper.scala",
173167
"JavaMapWrapper.scala",
174168
"MatchPatternWord.scala",
175169
"NotWord.scala",
176170
"ResultOfNotWordForAny.scala"
177-
)
178-
) ++
179-
copyDir("scalatest/src/main/scala/org/scalatest/matchers/should", "org/scalatest/matchers/should", targetDir, List.empty) ++
180-
copyDir("scalatest/src/main/scala/org/scalatest/path", "org/scalatest/path", targetDir, List.empty) ++
181-
copyDir("scalatest/src/main/scala/org/scalatest/prop", "org/scalatest/prop", targetDir, List.empty) ++
182-
copyDir("scalatest/src/main/scala/org/scalatest/propspec", "org/scalatest/propspec", targetDir, List.empty) ++
183-
copyDir("scalatest/src/main/scala/org/scalatest/time", "org/scalatest/time", targetDir, List.empty) ++
184-
copyDir("scalatest/src/main/scala/org/scalatest/verbs", "org/scalatest/verbs", targetDir, List.empty) ++
185-
copyDir("scalatest/src/main/scala/org/scalatest/tools", "org/scalatest/tools", targetDir, List.empty) ++
186-
copyDir("scalatest/src/main/scala/org/scalatest/refspec", "org/scalatest/refspec", targetDir, List.empty) ++
187-
copyDir("scalatest/src/main/scala/org/scalatest/words", "org/scalatest/words", targetDir, List.empty) ++
188-
copyDir("scalatest/src/main/scala/org/scalatest/wordspec", "org/scalatest/wordspec", targetDir, List.empty)
189-
}
171+
),
172+
"org/scalatest/matchers/should" -> List.empty,
173+
"org/scalatest/path" -> List.empty,
174+
"org/scalatest/prop" -> List.empty,
175+
"org/scalatest/propspec" -> List.empty,
176+
"org/scalatest/time" -> List.empty,
177+
"org/scalatest/verbs" -> List.empty,
178+
"org/scalatest/tools" -> List.empty,
179+
"org/scalatest/refspec" -> List.empty,
180+
"org/scalatest/words" -> List.empty,
181+
"org/scalatest/wordspec" -> List.empty
182+
)
183+
184+
def genScala(targetDir: File, version: String, scalaVersion: String): Seq[File] =
185+
genScalaPackages.flatMap { case (packagePath, skipList) =>
186+
copyDir("scalatest/src/main/scala/" + packagePath, packagePath, targetDir, skipList)
187+
}.toList
190188

191189
def genTest(targetDir: File, version: String, scalaVersion: String): Seq[File] = {
192190
copyFiles("scalatest-test/src/test/scala/org/scalatest", "org/scalatest", targetDir,

0 commit comments

Comments
 (0)