@@ -117,37 +117,31 @@ object GenScalaTestNative {
117
117
new File (sourceDirName).listFiles.toList.map(_.getName).filter(_.toLowerCase.contains(" async" ))
118
118
}
119
119
120
- def genScala ( targetDir : File , version : String , scalaVersion : String ) : Seq [ File ] = {
121
- copyDir( " scalatest/src/main/scala/org/scalatest " , " org/scalatest " , targetDir,
122
- List (
120
+ val genScalaPackages : Map [ String , List [ String ]] =
121
+ Map (
122
+ " org/scalatest " -> ( List (
123
123
" DispatchReporter.scala" ,
124
124
" ConfigMapWrapperSuite.scala" , // skipped because depends on java reflection.
125
125
" JavaClassesWrappers.scala" ,
126
126
" Shell.scala" ,
127
127
" SuiteRerunner.scala" ,
128
128
" SuiteRerunner.scala" ,
129
129
" run.scala"
130
- ) ++ asyncs(" scalatest/src/main/scala/org/scalatest" )
131
- ) ++
132
- copyDir(" scalatest/src/main/scala/org/scalatest/diagrams" , " org/scalatest/diagrams" , targetDir, List .empty) ++
133
- copyDir(" scalatest/src/main/scala/org/scalatest/fixture" , " org/scalatest/fixture" , targetDir,
134
- List (
130
+ ) ++ asyncs(" scalatest/src/main/scala/org/scalatest" )),
131
+ " org/scalatest/diagrams" -> List .empty,
132
+ " org/scalatest/fixture" -> (List (
135
133
" Spec.scala" ,
136
134
" SpecLike.scala"
137
- ) ++ asyncs(" scalatest/src/main/scala/org/scalatest/fixture" )
138
- ) ++
139
- copyDir(" scalatest/src/main/scala/org/scalatest/events" , " org/scalatest/events" , targetDir, List .empty) ++
140
- copyDir(" scalatest/src/main/scala/org/scalatest/expectations" , " org/scalatest/expectations" , targetDir, List .empty) ++
141
- copyDir(" scalatest/src/main/scala/org/scalatest/matchers" , " org/scalatest/matchers" , targetDir, List .empty) ++
142
- copyDir(" scalatest/src/main/scala/org/scalatest/matchers/should" , " org/scalatest/matchers/should" , targetDir, List .empty) ++
143
- copyDir(" scalatest/src/main/scala/org/scalatest/matchers/dsl" , " org/scalatest/matchers/dsl" , targetDir,
144
- List (
135
+ ) ++ asyncs(" scalatest/src/main/scala/org/scalatest/fixture" )),
136
+ " org/scalatest/events" -> List .empty,
137
+ " org/scalatest/expectations" -> List .empty,
138
+ " org/scalatest/matchers" -> List .empty,
139
+ " org/scalatest/matchers/should" -> List .empty,
140
+ " org/scalatest/matchers/dsl" -> List (
145
141
" JavaCollectionWrapper.scala" ,
146
142
" JavaMapWrapper.scala"
147
- )
148
- ) ++
149
- copyDir(" scalatest/src/main/scala/org/scalatest/tools" , " org/scalatest/tools" , targetDir,
150
- List (
143
+ ),
144
+ " org/scalatest/tools" -> List (
151
145
" AboutJDialog.scala" ,
152
146
// "AnsiColor.scala",
153
147
" AnsiReset.scala" ,
@@ -196,40 +190,22 @@ object GenScalaTestNative {
196
190
" TestSpec.scala" ,
197
191
" XmlReporter.scala" ,
198
192
" XmlSocketReporter.scala"
199
- )
200
- ) ++
201
- copyDir(" scalatest/src/main/scala/org/scalatest/exceptions" , " org/scalatest/exceptions" , targetDir,
202
- List (
193
+ ),
194
+ " org/scalatest/exceptions" -> List (
203
195
" StackDepthExceptionHelper.scala"
204
- )
205
- ) ++
206
- copyDir(" scalatest/src/main/scala/org/scalatest/time" , " org/scalatest/time" , targetDir, List .empty) ++
207
- copyDir(" scalatest/src/main/scala/org/scalatest/words" , " org/scalatest/words" , targetDir, List .empty) ++
208
- copyDir(" scalatest/src/main/scala/org/scalatest/enablers" , " org/scalatest/enablers" , targetDir, List .empty) ++
209
- copyDir(" scalatest/src/main/scala/org/scalatest/funsuite" , " org/scalatest/funsuite" , targetDir,
210
- asyncs(" scalatest/src/main/scala/org/scalatest/funsuite" )
211
- ) ++
212
- copyDir(" scalatest/src/main/scala/org/scalatest/featurespec" , " org/scalatest/featurespec" , targetDir,
213
- asyncs(" scalatest/src/main/scala/org/scalatest/featurespec" )
214
- ) ++
215
- copyDir(" scalatest/src/main/scala/org/scalatest/funspec" , " org/scalatest/funspec" , targetDir,
216
- asyncs(" scalatest/src/main/scala/org/scalatest/funspec" )
217
- ) ++
218
- copyDir(" scalatest/src/main/scala/org/scalatest/freespec" , " org/scalatest/freespec" , targetDir,
219
- asyncs(" scalatest/src/main/scala/org/scalatest/freespec" )
220
- ) ++
221
- copyDir(" scalatest/src/main/scala/org/scalatest/flatspec" , " org/scalatest/flatspec" , targetDir,
222
- asyncs(" scalatest/src/main/scala/org/scalatest/flatspec" )
223
- ) ++
224
- copyDir(" scalatest/src/main/scala/org/scalatest/prop" , " org/scalatest/prop" , targetDir, List .empty) ++
225
- copyDir(" scalatest/src/main/scala/org/scalatest/propspec" , " org/scalatest/propspec" , targetDir,
226
- asyncs(" scalatest/src/main/scala/org/scalatest/propspec" )
227
- ) ++
228
- copyDir(" scalatest/src/main/scala/org/scalatest/wordspec" , " org/scalatest/wordspec" , targetDir,
229
- asyncs(" scalatest/src/main/scala/org/scalatest/wordspec" )
230
- ) ++
231
- copyDir(" scalatest/src/main/scala/org/scalatest/concurrent" , " org/scalatest/concurrent" , targetDir,
232
- List (
196
+ ),
197
+ " org/scalatest/time" -> List .empty,
198
+ " org/scalatest/words" -> List .empty,
199
+ " org/scalatest/enablers" -> List .empty,
200
+ " org/scalatest/funsuite" -> asyncs(" scalatest/src/main/scala/org/scalatest/funsuite" ),
201
+ " org/scalatest/featurespec" -> asyncs(" scalatest/src/main/scala/org/scalatest/featurespec" ),
202
+ " org/scalatest/funspec" -> asyncs(" scalatest/src/main/scala/org/scalatest/funspec" ),
203
+ " org/scalatest/freespec" -> asyncs(" scalatest/src/main/scala/org/scalatest/freespec" ),
204
+ " org/scalatest/flatspec" -> asyncs(" scalatest/src/main/scala/org/scalatest/flatspec" ),
205
+ " org/scalatest/prop" -> List .empty,
206
+ " org/scalatest/propspec" -> asyncs(" scalatest/src/main/scala/org/scalatest/propspec" ),
207
+ " org/scalatest/wordspec" -> asyncs(" scalatest/src/main/scala/org/scalatest/wordspec" ),
208
+ " org/scalatest/concurrent" -> (List (
233
209
" Waiters.scala" , // skipeed because doesn't really make sense on js's single-thread environment.
234
210
" Conductors.scala" , // skipped because depends on PimpedReadWriteLock
235
211
" ConductorFixture.scala" , // skipped because depends on Conductors
@@ -248,20 +224,23 @@ object GenScalaTestNative {
248
224
" DeprecatedTimeLimitedTests.scala" , // skipped because js is single-threaded and does not share memory, there's no practical way to interrupt in js.
249
225
" Timeouts.scala" , // skipped because js is single-threaded and does not share memory, there's no practical way to interrupt in js.
250
226
" TimeoutTask.scala" // skipped because timeout is not supported.,
251
- ) ++ asyncs(" scalatest/src/main/scala/org/scalatest/concurrent" )
252
- ) ++
253
- copyDir(" scalatest/src/main/scala/org/scalatest/path" , " org/scalatest/path" , targetDir, List .empty) ++
254
- copyDir(" scalatest/src/main/scala/org/scalatest/tagobjects" , " org/scalatest/tagobjects" , targetDir,
255
- List (
227
+ ) ++ asyncs(" scalatest/src/main/scala/org/scalatest/concurrent" )),
228
+ " org/scalatest/path" -> List .empty,
229
+ " org/scalatest/tagobjects" -> List (
256
230
" ChromeBrowser.scala" , // skipped because selenium not supported.
257
231
" FirefoxBrowser.scala" , // skipped because selenium not supported.
258
232
" HtmlUnitBrowser.scala" , // skipped because selenium not supported.
259
233
" InternetExplorerBrowser.scala" , // skipped because selenium not supported.
260
234
" SafariBrowser.scala" // skipped because selenium not supported.
261
- )
262
- ) ++
263
- copyDir(" scalatest/src/main/scala/org/scalatest/verbs" , " org/scalatest/verbs" , targetDir, List .empty)
264
- }
235
+ ),
236
+ " org/scalatest/verbs" -> List .empty,
237
+
238
+ )
239
+
240
+ def genScala (targetDir : File , version : String , scalaVersion : String ): Seq [File ] =
241
+ genScalaPackages.flatMap { case (packagePath, skipList) =>
242
+ copyDir(" scalatest/src/main/scala/" + packagePath, packagePath, targetDir, skipList)
243
+ }.toList
265
244
266
245
def genTest (targetDir : File , version : String , scalaVersion : String ): Seq [File ] = {
267
246
// copyStartsWithFiles("scalatest-test/src/test/scala/org/scalatest", "org/scalatest", "Async", targetDir) ++
0 commit comments