private static void populateModulesWithEvolutions() { /** Check that evolutions are enabled **/ if (!isModuleEvolutionDisabled()) { for (Entry<String, VirtualFile> moduleRoot : Play.modules.entrySet()) { if (moduleRoot.getValue().child("db/evolutions").exists()) { if (!isModuleEvolutionDisabled(moduleRoot.getKey())) { modulesWithEvolutions.put(moduleRoot.getKey(), moduleRoot.getValue().child("db/evolutions")); } else { System.out.println("~ '" + moduleRoot.getKey() + "' module evolutions are disabled."); } } } } else { System.out.println("~ Module evolutions are disabled."); } addMainProjectToModuleList(); }
private static void populateModulesWithSpecificModules() { String[] specificModules = System.getProperty("modules").split(","); System.out.println("~ You've requested running evolutions only for these modules: "); for (String specificModule : specificModules) { System.out.println("~~ '" + specificModule + "'"); } System.out.println("~"); boolean weShouldAddTheMainProject = false; for (String specificModule : specificModules) { if (Play.modules.containsKey(specificModule)) { VirtualFile moduleRoot = Play.modules.get(specificModule); if (!isModuleEvolutionDisabled(specificModule) && moduleRoot.child("db/evolutions").exists()) { modulesWithEvolutions.put(specificModule, moduleRoot.child("db/evolutions")); } else { System.out.println( "~ '" + specificModule + "' module doesn't have any evolutions scripts in it or evolutions are disabled."); System.out.println("~"); System.exit(-1); } } else if (Play.configuration.getProperty("application.name").equals(specificModule)) { weShouldAddTheMainProject = true; } else { System.out.println("~ Couldn't find a module with the name '" + specificModule + "'. "); System.exit(-1); } } if (weShouldAddTheMainProject) { addMainProjectToModuleList(); } }