use of org.gradle.tooling.model.gradle.BasicGradleProject in project gradle by gradle.
the class UseGradleBuildToFetchProjectModel method execute.
public Map<String, CustomModel> execute(BuildController controller) {
GradleBuild gradleBuild = controller.getBuildModel();
Map<String, CustomModel> projects = new HashMap<String, CustomModel>();
for (BasicGradleProject project : gradleBuild.getProjects()) {
projects.put(project.getName(), controller.getModel(project, CustomModel.class));
}
return projects;
}
use of org.gradle.tooling.model.gradle.BasicGradleProject in project gradle by gradle.
the class FetchProjectModelsBuildAction method execute.
public List<Object> execute(BuildController controller) {
List<Object> models = new ArrayList<Object>();
for (BasicGradleProject project : controller.getBuildModel().getProjects()) {
Object model = controller.getModel(project, modelType);
models.add(model);
}
return models;
}
use of org.gradle.tooling.model.gradle.BasicGradleProject in project grails-core by grails.
the class FetchAllTaskSelectorsBuildAction method execute.
public AllTasksModel execute(BuildController controller) {
AllTasksModel model = new AllTasksModel();
Map<String, Set<String>> allTaskSelectors = new LinkedHashMap<String, Set<String>>();
model.allTaskSelectors = allTaskSelectors;
Map<String, Set<String>> allTasks = new LinkedHashMap<String, Set<String>>();
model.allTasks = allTasks;
Map<String, String> projectPaths = new HashMap<String, String>();
model.projectPaths = projectPaths;
for (BasicGradleProject project : controller.getBuildModel().getProjects()) {
BuildInvocations entryPointsForProject = controller.getModel(project, BuildInvocations.class);
Set<String> selectorNames = new LinkedHashSet<String>();
for (TaskSelector selector : entryPointsForProject.getTaskSelectors()) {
selectorNames.add(selector.getName());
}
allTaskSelectors.put(project.getName(), selectorNames);
Set<String> taskNames = new LinkedHashSet<String>();
for (Task task : entryPointsForProject.getTasks()) {
taskNames.add(task.getName());
}
allTasks.put(project.getName(), taskNames);
projectPaths.put(project.getName(), project.getPath());
if (project.getProjectDirectory().getAbsolutePath().equals(currentProjectPath)) {
model.currentProject = project.getName();
}
}
return model;
}
use of org.gradle.tooling.model.gradle.BasicGradleProject in project gradle by gradle.
the class GetModel method execute.
@Override
public Map<String, AndroidProject> execute(BuildController controller) {
System.out.println("* Building models");
Timer timer = new Timer();
GradleBuild build = controller.getBuildModel();
Map<String, AndroidProject> result = new TreeMap<String, AndroidProject>();
for (BasicGradleProject project : build.getProjects()) {
AndroidProject androidProject = controller.findModel(project, AndroidProject.class);
result.put(project.getPath(), androidProject);
}
timer.stop();
System.out.println("building models took " + timer.duration());
// new Inspector().inspectModel(result);
return result;
}
use of org.gradle.tooling.model.gradle.BasicGradleProject in project gradle by gradle.
the class FetchAllTaskSelectorsBuildAction method execute.
public Map<String, Set<String>> execute(BuildController controller) {
Map<String, Set<String>> model = new HashMap<String, Set<String>>();
for (BasicGradleProject project : controller.getBuildModel().getProjects()) {
BuildInvocations entryPointsForProject = controller.getModel(project, BuildInvocations.class);
Set<String> selectorNames = new HashSet<String>();
for (TaskSelector selector : entryPointsForProject.getTaskSelectors()) {
selectorNames.add(selector.getName());
}
model.put(project.getName(), selectorNames);
}
return model;
}
Aggregations