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()); }
public void addResolutionRules(ResolutionRules resolutionRules) { if (startParameter.isOffline()) { resolutionRules.eachDependency( new Action<DependencyResolutionControl>() { public void execute(DependencyResolutionControl dependencyResolutionControl) { dependencyResolutionControl.useCachedResult(); } }); resolutionRules.eachModule( new Action<ModuleResolutionControl>() { public void execute(ModuleResolutionControl moduleResolutionControl) { moduleResolutionControl.useCachedResult(); } }); resolutionRules.eachArtifact( new Action<ArtifactResolutionControl>() { public void execute(ArtifactResolutionControl artifactResolutionControl) { artifactResolutionControl.useCachedResult(); } }); } else if (startParameter.isRefreshDependencies()) { resolutionRules.eachDependency( new Action<DependencyResolutionControl>() { public void execute(DependencyResolutionControl dependencyResolutionControl) { dependencyResolutionControl.cacheFor(0, TimeUnit.SECONDS); } }); resolutionRules.eachModule( new Action<ModuleResolutionControl>() { public void execute(ModuleResolutionControl moduleResolutionControl) { moduleResolutionControl.cacheFor(0, TimeUnit.SECONDS); } }); resolutionRules.eachArtifact( new Action<ArtifactResolutionControl>() { public void execute(ArtifactResolutionControl artifactResolutionControl) { artifactResolutionControl.cacheFor(0, TimeUnit.SECONDS); } }); } }