public GradleExecuter copyTo(GradleExecuter executer) { executer.withGradleUserHomeDir(gradleUserHomeDir); executer.withDaemonIdleTimeoutSecs(daemonIdleTimeoutSecs); executer.withDaemonBaseDir(daemonBaseDir); if (workingDir != null) { executer.inDirectory(workingDir); } if (projectDir != null) { executer.usingProjectDirectory(projectDir); } if (buildScript != null) { executer.usingBuildScript(buildScript); } if (settingsFile != null) { executer.usingSettingsFile(settingsFile); } if (javaHome != null) { executer.withJavaHome(javaHome); } for (File initScript : initScripts) { executer.usingInitScript(initScript); } executer.withTasks(tasks); executer.withArguments(args); executer.withEnvironmentVars(getAllEnvironmentVars()); executer.usingExecutable(executable); if (quiet) { executer.withQuietLogging(); } if (taskList) { executer.withTaskList(); } if (dependencyList) { executer.withDependencyList(); } if (userHomeDir != null) { executer.withUserHomeDir(userHomeDir); } if (stdin != null) { executer.withStdIn(stdin); } if (defaultCharacterEncoding != null) { executer.withDefaultCharacterEncoding(defaultCharacterEncoding); } executer.withGradleOpts(gradleOpts.toArray(new String[gradleOpts.size()])); if (noDefaultJvmArgs) { executer.withNoDefaultJvmArgs(); } executer.setAllowExtraLogging(allowExtraLogging); if (!deprecationChecksOn) { executer.withDeprecationChecksDisabled(); } if (!stackTraceChecksOn) { executer.withStackTraceChecksDisabled(); } executer.requireGradleHome(isRequireGradleHome()); return executer; }