void (String sources, Module module) { VirtualFile contentRoot = getContentRoot(sources); ModuleRootModificationUtil.updateModel(module, model -> { ContentEntry contentEntry = model.addContentEntry(contentRoot); contentEntry.addSourceFolder(contentRoot.getUrl() + "/src", false); contentEntry.addSourceFolder(contentRoot.getUrl() + "/test", true); CompilerModuleExtension moduleExtension = model.getModuleExtension(CompilerModuleExtension.class); moduleExtension.inheritCompilerOutputPath(false); moduleExtension.setCompilerOutputPath(contentRoot.findFileByRelativePath("out/production")); moduleExtension.setCompilerOutputPathForTests(contentRoot.findFileByRelativePath("out/test")); }); }