private static String getCacheKey(Project project, String prefix) { return prefix + project.getPath(); } }
public Target(Project project, String name) { this.project = project; this.name = name; identifier = project.getPath().replaceFirst(":", ""); path = identifier.replaceAll(":", File.separator); rootProject = project.getRootProject(); }
getProject().getPath().replace(":", File.separator).substring(1) + File.separator;
public void add(Runnable configuration) { if (fired) { String message = "Cannot add deferred configuration for project " + project.getPath(); if (firedSentinel == null) { throw new IllegalStateException(message); } else { throw new IllegalStateException(message, firedSentinel); } } else { this.configuration.add(configuration); } }
@Override public void beforeEvaluate(Project project) { // --configuration-on-demand can sometimes cause projects to be configured after execution phase has started // see ConfigurationOnDemandIntegrationTest final String projectPath = project.getPath().equals(":") ? "root project" : project.getPath(); ProgressLogger currentTask = progressLoggerFactory .newOperation(ProjectEvaluationLogger.class) .start("Configuring ".concat(projectPath), projectPath); currentProjects.put(project.getPath(), currentTask); }
private String[] generateTaskArguments(Project project, List<Object> tasks) { List<String> result = new LinkedList<>(); for (Object task : tasks) { if (task instanceof Task) { result.add(((Task) task).getPath()); } else { result.add(String.format("%s:%s", project.getPath(), task)); } } return result.toArray(new String[result.size()]); }
@Override public void afterEvaluate(Project project, ProjectState state) { ProgressLogger logger = currentProjects.remove(project.getPath()); if (logger != null) { logger.completed(); } } }
public static void requireRootProject(final Project project, final Class<?> clazz, final String explanation) { if (project.getParent() != null) { throw new GradleException("Plugin '" + clazz.getSimpleName() + "' is intended to be applied only root project.\n" + (explanation != null ? explanation + "\n" : "" ) + "Please apply this plugin to the root project instead of '" + project.getPath() + "'."); } } }
public static void requireRootProject(final Project project, final Class<?> clazz, final String explanation) { if (project.getParent() != null) { throw new GradleException("Plugin '" + clazz.getSimpleName() + "' is intended to be applied only root project.\n" + (explanation != null ? explanation + "\n" : "" ) + "Please apply this plugin to the root project instead of '" + project.getPath() + "'."); } } }
@Override public int compareTo(Project otherProject) { int depthCompare = depthCompare(otherProject); if (depthCompare == 0) { return getPath().compareTo(otherProject.getPath()); } else { return depthCompare; } }
/** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { int hash = 0; hash = (31 * hash) + getProject().getPath().hashCode(); hash = (31 * hash) + getConfiguration().getName().hashCode(); return hash; }
@Override public void afterEvaluate(Project project, ProjectState state) { if (project.getGradle() == rootGradle) { logger.afterEvaluate(project.getPath()); } }
@Override public void beforeEvaluate(Project project) { if (project.getGradle() == rootGradle) { logger.beforeEvaluate(project.getPath()); } }
private LoadProjectsBuildOperationType.Result.Project convert(org.gradle.api.Project project) { return new BuildStructureOperationProject( project.getName(), project.getPath(), ((ProjectInternal) project).getIdentityPath().toString(), project.getProjectDir().getAbsolutePath(), project.getBuildFile().getAbsolutePath(), convert(project.getChildProjects().values())); }
public void afterEvaluate(Project project, ProjectState state) { long now = clock.getCurrentTime(); ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath()); projectProfile.getConfigurationOperation().setFinish(now); }
private void configureOverlay(WarOverlay overlay, Project otherProject) { project.evaluationDependsOn(otherProject.getPath()); War otherWar = (War) otherProject.getTasks().getByName(WAR_TASK_NAME); configureOverlay(overlay, otherWar); if (overlay.isEnableCompilation()) { project.getDependencies().add(COMPILE_CLASSPATH_CONFIGURATION_NAME, otherProject); project.getDependencies().add(TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME, otherProject); } }
public void beforeExecute(Task task) { long now = clock.getCurrentTime(); Project project = task.getProject(); ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath()); projectProfile.getTaskProfile(task.getPath()).setStart(now); }
public void afterExecute(Task task, TaskState state) { long now = clock.getCurrentTime(); Project project = task.getProject(); ProjectProfile projectProfile = buildProfile.getProjectProfile(project.getPath()); TaskExecution taskExecution = projectProfile.getTaskProfile(task.getPath()); taskExecution.setFinish(now); taskExecution.completed(state); }