Skip to content

Commit

Permalink
Fix codenarc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ferinagy committed Aug 28, 2019
1 parent 118f516 commit e3f310e
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -52,8 +52,8 @@ class DependencyUpdatesTask extends DefaultTask {
@Input
boolean checkForGradleUpdate = true

Object outputFormatter = 'plain';
Action<? super ResolutionStrategyWithCurrent> resolutionStrategy = null;
Object outputFormatter = 'plain'
Action<? super ResolutionStrategyWithCurrent> resolutionStrategyAction = null

DependencyUpdatesTask() {
description = 'Displays the dependency updates for the project.'
@@ -66,7 +66,7 @@ class DependencyUpdatesTask extends DefaultTask {
def dependencyUpdates() {
project.evaluationDependsOnChildren()

def evaluator = new DependencyUpdates(project, resolutionStrategy, revisionLevel(),
def evaluator = new DependencyUpdates(project, resolutionStrategyAction, revisionLevel(),
outputFormatterProp(), outputDirectory(), getReportfileName(), checkForGradleUpdate, gradleReleaseChannelLevel())
DependencyUpdatesReporter reporter = evaluator.run()
reporter?.write()
@@ -77,7 +77,7 @@ class DependencyUpdatesTask extends DefaultTask {
* @param resolutionStrategy the resolution strategy
*/
void resolutionStrategy(final Action<? super ResolutionStrategyWithCurrent> resolutionStrategy) {
this.resolutionStrategy = resolutionStrategy
this.resolutionStrategyAction = resolutionStrategy
}

/** Returns the resolution revision level. */
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ class ComponentSelectionRulesWithCurrent {

ComponentSelectionRulesWithCurrent all(Object ruleSource) {
RuleAction<ComponentSelectionWithCurrent> ruleAction = RuleSourceBackedRuleAction.create(
ModelType.of(ComponentSelectionWithCurrent.class), ruleSource)
ModelType.of(ComponentSelectionWithCurrent), ruleSource)
delegate.all(new Action<ComponentSelection>() {
void execute(ComponentSelection inner) {
ruleAction.execute(wrapComponentSelection(inner), [])
@@ -70,7 +70,7 @@ class ComponentSelectionRulesWithCurrent {

ComponentSelectionRulesWithCurrent withModule(Object id, Object ruleSource) {
RuleAction<ComponentSelectionWithCurrent> ruleAction = RuleSourceBackedRuleAction.create(
ModelType.of(ComponentSelectionWithCurrent.class), ruleSource)
ModelType.of(ComponentSelectionWithCurrent), ruleSource)
delegate.withModule(id, new Action<ComponentSelection>() {
void execute(ComponentSelection inner) {
ruleAction.execute(wrapComponentSelection(inner), [])
@@ -82,8 +82,8 @@ class ComponentSelectionRulesWithCurrent {
private ComponentSelectionWithCurrent wrapComponentSelection(ComponentSelection inner) {
Coordinate candidateCoordinate = Coordinate.from(inner.candidate)
Coordinate current = currentCoordinates.get(candidateCoordinate.key)
ComponentSelectionWithCurrent wrapped = new ComponentSelectionWithCurrent(inner,
current.version)
ComponentSelectionWithCurrent wrapped = new ComponentSelectionWithCurrent(current.version,
inner)
return wrapped
}
}
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ import org.gradle.api.artifacts.ComponentSelection
@TupleConstructor(includeFields=true)
class ComponentSelectionWithCurrent {

final String currentVersion

@Delegate
private final ComponentSelection delegate

public final String currentVersion
}
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@ final class ComponentSelectionRuleSourceSpec extends Specification {
private List<File> pluginClasspath

def 'setup'() {
def pluginClasspathResource = getClass().classLoader.findResource("plugin-classpath.txt")
def pluginClasspathResource = getClass().classLoader.findResource('plugin-classpath.txt')
if (pluginClasspathResource == null) {
throw new IllegalStateException(
"Did not find plugin classpath resource, run `testClasses` build task.")
'Did not find plugin classpath resource, run `testClasses` build task.')
}

pluginClasspath = pluginClasspathResource.readLines().collect { new File(it) }
@@ -28,7 +28,7 @@ final class ComponentSelectionRuleSourceSpec extends Specification {
def classpathString = pluginClasspath
.collect { it.absolutePath.replace('\\', '\\\\') } // escape backslashes in Windows paths
.collect { "'$it'" }
.join(", ")
.join(', ')
def mavenRepoUrl = getClass().getResource('/maven/').toURI()
def srdErrWriter = new StringWriter()

0 comments on commit e3f310e

Please sign in to comment.