Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected def getMigrationPackages(modules: Seq[String] = Nil) = {
- val migratedModules = if (modules.isEmpty) {
- val deps = this.getClass.getClassLoader.getResources(".")
- val modules = new mutable.HashSet[String]
- val pattern = "^.*/modules/([A-Za-z0-9-_]+)/.*$".r
- while (deps.hasMoreElements) {
- val depPath = deps.nextElement.getPath
- depPath match {
- case pattern(module) =>
- if (!modules.contains(module)) {
- val migrationsDir = new File(s"$depPath$module/migrations")
- if (migrationsDir.exists && migrationsDir.listFiles.length > 0) {
- modules.add(module)
- }
- }
- case _ =>
- }
- }
- modules.toSeq
- } else {
- modules
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement