protected void checkStartParameter(StartParameter startParameter) {
   assertEquals(expectedBuildFile, startParameter.getBuildFile());
   assertEquals(expectedTaskNames, startParameter.getTaskNames());
   assertEquals(buildProjectDependencies, startParameter.isBuildProjectDependencies());
   if (expectedCurrentDir != null) {
     assertEquals(
         expectedCurrentDir.getAbsoluteFile(), startParameter.getCurrentDir().getAbsoluteFile());
   }
   assertEquals(expectedProjectDir, startParameter.getProjectDir());
   assertEquals(expectedSearchUpwards, startParameter.isSearchUpwards());
   assertEquals(expectedProjectProperties, startParameter.getProjectProperties());
   assertEquals(expectedSystemProperties, startParameter.getSystemPropertiesArgs());
   assertEquals(
       expectedGradleUserHome.getAbsoluteFile(),
       startParameter.getGradleUserHomeDir().getAbsoluteFile());
   assertEquals(expectedLogLevel, startParameter.getLogLevel());
   assertEquals(expectedColorOutput, startParameter.isColorOutput());
   assertEquals(expectedConsoleOutput, startParameter.getConsoleOutput());
   assertEquals(expectedDryRun, startParameter.isDryRun());
   assertEquals(expectedShowStackTrace, startParameter.getShowStacktrace());
   assertEquals(expectedExcludedTasks, startParameter.getExcludedTaskNames());
   assertEquals(expectedInitScripts, startParameter.getInitScripts());
   assertEquals(expectedProfile, startParameter.isProfile());
   assertEquals(expectedContinue, startParameter.isContinueOnFailure());
   assertEquals(expectedOffline, startParameter.isOffline());
   assertEquals(expectedRecompileScripts, startParameter.isRecompileScripts());
   assertEquals(expectedRerunTasks, startParameter.isRerunTasks());
   assertEquals(expectedRefreshDependencies, startParameter.isRefreshDependencies());
   assertEquals(expectedProjectCacheDir, startParameter.getProjectCacheDir());
   assertEquals(expectedParallelExecutorCount, startParameter.getParallelThreadCount());
   assertEquals(expectedConfigureOnDemand, startParameter.isConfigureOnDemand());
   assertEquals(expectedMaxWorkersCount, startParameter.getMaxWorkerCount());
   assertEquals(expectedContinuous, startParameter.isContinuous());
 }
 protected CacheRepository createCacheRepository() {
   CacheFactory factory = get(CacheFactory.class);
   return new DefaultCacheRepository(
       startParameter.getGradleUserHomeDir(),
       startParameter.getProjectCacheDir(),
       startParameter.getCacheUsage(),
       factory);
 }
 private DaemonParameters constructDaemonParameters(StartParameter startParameter) {
   Map<String, String> mergedSystemProperties = startParameter.getMergedSystemProperties();
   DaemonParameters daemonParameters = new DaemonParameters();
   daemonParameters.configureFromBuildDir(
       startParameter.getCurrentDir(), startParameter.isSearchUpwards());
   daemonParameters.configureFromGradleUserHome(startParameter.getGradleUserHomeDir());
   daemonParameters.configureFromSystemProperties(mergedSystemProperties);
   return daemonParameters;
 }
 WorkerProcessFactory createWorkerProcessFactory(
     StartParameter startParameter,
     MessagingServer messagingServer,
     ClassPathRegistry classPathRegistry,
     TemporaryFileProvider temporaryFileProvider,
     ExecHandleFactory execHandleFactory) {
   return new DefaultWorkerProcessFactory(
       startParameter.getLogLevel(),
       messagingServer,
       classPathRegistry,
       new LongIdGenerator(),
       startParameter.getGradleUserHomeDir(),
       temporaryFileProvider,
       execHandleFactory);
 }
 public BuildSessionScopeServices(
     final ServiceRegistry parent,
     final StartParameter startParameter,
     ClassPath injectedPluginClassPath) {
   super(parent);
   register(
       new Action<ServiceRegistration>() {
         @Override
         public void execute(ServiceRegistration registration) {
           add(StartParameter.class, startParameter);
           for (PluginServiceRegistry pluginServiceRegistry :
               parent.getAll(PluginServiceRegistry.class)) {
             pluginServiceRegistry.registerBuildSessionServices(registration);
           }
         }
       });
   add(InjectedPluginClasspath.class, new InjectedPluginClasspath(injectedPluginClassPath));
   addProvider(
       new CacheRepositoryServices(
           startParameter.getGradleUserHomeDir(), startParameter.getProjectCacheDir()));
 }
 protected CacheRepository createCacheRepository() {
   return new DefaultCacheRepository(
       startParameter.getGradleUserHomeDir(),
       startParameter.getCacheUsage(),
       get(CacheFactory.class));
 }