示例#1
0
  private DefaultBuild createProjects(
      ProjectDescriptor rootProjectDescriptor,
      ClassLoader buildScriptClassLoader,
      StartParameter startParameter,
      Map<String, String> externalProjectProperties) {
    DefaultBuild build = new DefaultBuild(startParameter, buildScriptClassLoader);
    ProjectInternal rootProject = projectFactory.createProject(rootProjectDescriptor, null, build);
    build.setRootProject(rootProject);

    addPropertiesToProject(externalProjectProperties, rootProject);
    addProjects(rootProject, rootProjectDescriptor, build, externalProjectProperties);
    return build;
  }
示例#2
0
 /**
  * Creates the {@link BuildInternal} and {@link ProjectInternal} instances for the given root
  * project, ready for the projects to be evaluated.
  */
 public BuildInternal load(
     ProjectDescriptor rootProjectDescriptor,
     ClassLoader buildScriptClassLoader,
     StartParameter startParameter,
     Map<String, String> externalProjectProperties) {
   logger.debug("Loading Project objects");
   Clock clock = new Clock();
   DefaultBuild build =
       createProjects(
           rootProjectDescriptor,
           buildScriptClassLoader,
           startParameter,
           externalProjectProperties);
   ProjectInternal currentProject =
       (ProjectInternal)
           build.getRootProject().getProjectRegistry().getProject(startParameter.getCurrentDir());
   assert currentProject != null;
   build.setCurrentProject(currentProject);
   logger.debug("Timing: Loading projects took: " + clock.getTime());
   return build;
 }