ExternalSystemTaskExecutionSettings (String rootProjectPath) { ExternalSystemTaskExecutionSettings settings = new ExternalSystemTaskExecutionSettings(); File projectFile = new File(rootProjectPath); final String projectName; if (projectFile.isFile()) { projectName = projectFile.getParentFile().getName(); } else { projectName = projectFile.getName(); } String executionName = GradleBundle.message("gradle.execution.name.build.project.", projectName); settings.setExecutionName(executionName); settings.setExternalProjectPath(rootProjectPath); List<@NlsSafe String> taskNames = ContainerUtil.collect(getTasksToExecute(rootProjectPath).iterator()); settings.setTaskNames(taskNames); settings.setVmOptions(gradleVmOptions); settings.setExternalSystemIdString(GradleConstants.SYSTEM_ID.getId()); return settings; }