private Compiler<JavaCompileSpec> createTargetCompiler(CompileOptions options) {
    if (options.isFork() && options.getForkOptions().getExecutable() != null) {
      return new CommandLineJavaCompiler(
          createSerializableTempFileProvider(), project.getProjectDir());
    }

    Compiler<JavaCompileSpec> compiler = inProcessCompilerFactory.create(options);
    if (options.isFork() && !jointCompilation) {
      return new DaemonJavaCompiler(project, compiler, compilerDaemonManager);
    }

    return compiler;
  }
示例#2
0
 private void addPropertiesToProject(
     Map<String, String> externalProperties, ProjectInternal project) {
   Properties projectProperties = new Properties();
   File projectPropertiesFile = new File(project.getProjectDir(), Project.GRADLE_PROPERTIES);
   logger.debug("Looking for project properties from: {}", projectPropertiesFile);
   if (projectPropertiesFile.isFile()) {
     projectProperties = GUtil.loadProperties(projectPropertiesFile);
     logger.debug(
         "Adding project properties (if not overwritten by user properties): {}",
         projectProperties.keySet());
   } else {
     logger.debug("project property file does not exists. We continue!");
   }
   projectProperties.putAll(externalProperties);
   for (Object key : projectProperties.keySet()) {
     project.setProperty((String) key, projectProperties.get(key));
   }
 }
 protected FileResolver createFileResolver() {
   return new BaseDirFileResolver(get(FileSystem.class), project.getProjectDir());
 }