private DefaultGradleProject<LaunchableGradleTask> buildHierarchy(Project project) { List<DefaultGradleProject<LaunchableGradleTask>> children = new ArrayList<DefaultGradleProject<LaunchableGradleTask>>(); for (Project child : project.getChildProjects().values()) { children.add(buildHierarchy(child)); } DefaultGradleProject<LaunchableGradleTask> gradleProject = new DefaultGradleProject<LaunchableGradleTask>() .setPath(project.getPath()) .setName(project.getName()) .setDescription(project.getDescription()) .setBuildDirectory(project.getBuildDir()) .setProjectDirectory(project.getProjectDir()) .setChildren(children); gradleProject.getBuildScript().setSourceFile(project.getBuildFile()); gradleProject.setTasks(tasks(gradleProject, (TaskContainerInternal) project.getTasks())); for (DefaultGradleProject child : children) { child.setParent(gradleProject); } return gradleProject; }
private DefaultProjectOutcomes buildProjectOutput(Project project, ProjectOutcomes parent) { DefaultProjectOutcomes projectOutput = new DefaultProjectOutcomes( project.getName(), project.getPath(), project.getDescription(), project.getProjectDir(), getFileOutcomes(project), parent); for (Project child : project.getChildProjects().values()) { projectOutput.addChild(buildProjectOutput(child, projectOutput)); } return projectOutput; }
private String _getAppJavadocGroupName(Project project) { String groupName = project.getDescription(); if (Validator.isNull(groupName)) { groupName = project.getName(); } TaskContainer taskContainer = project.getTasks(); WritePropertiesTask recordArtifactTask = (WritePropertiesTask) taskContainer.findByName(LiferayRelengPlugin.RECORD_ARTIFACT_TASK_NAME); if (recordArtifactTask != null) { String artifactURL = null; File artifactPropertiesFile = recordArtifactTask.getOutputFile(); if (artifactPropertiesFile.exists()) { Properties properties = GUtil.loadProperties(artifactPropertiesFile); artifactURL = properties.getProperty("artifact.url"); } if (Validator.isNotNull(artifactURL)) { int start = artifactURL.lastIndexOf('/') + 1; int end = artifactURL.lastIndexOf('.'); int pos = artifactURL.indexOf('-', start); String moduleName = artifactURL.substring(start, pos); String moduleVersion = artifactURL.substring(pos + 1, end); StringBuilder sb = new StringBuilder(); sb.append("Module "); sb.append(moduleName); sb.append(' '); sb.append(moduleVersion); sb.append(" - "); sb.append(groupName); groupName = sb.toString(); } } return groupName; }