diff --git a/build.gradle b/build.gradle index dedcd190..37fac06f 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ buildscript { repositories { maven { - url "https://plugins.gradle.org/m2/" + url = "https://plugins.gradle.org/m2/" } } dependencies { @@ -90,7 +90,7 @@ dependencies { compileOnly "com.netflix.nebula:nebula-test:10.+" - testImplementation 'org.ow2.asm:asm-util:5.2' + testImplementation 'org.ow2.asm:asm-util:9.7.1' testImplementation 'joda-time:joda-time:latest.release' testImplementation 'com.netflix.nebula:gradle-info-plugin:latest.release' } diff --git a/gradle.lockfile b/gradle.lockfile index d8903d3f..016ee1fb 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -6,8 +6,9 @@ com.google.guava:guava:19.0=compileClasspath,runtimeClasspath,testCompileClasspa com.jcraft:jzlib:1.1.2=integTestRuntimeClasspath,testRuntimeClasspath com.netflix.nebula:gradle-contacts-plugin:7.0.1=integTestRuntimeClasspath,testRuntimeClasspath com.netflix.nebula:gradle-info-plugin:13.3.0=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.netflix.nebula:nebula-gradle-interop:2.2.0=compileClasspath,integTestRuntimeClasspath,runtimeClasspath,shadow,testCompileClasspath,testRuntimeClasspath -com.netflix.nebula:nebula-test:10.6.1=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.netflix.nebula:nebula-gradle-interop:2.2.0=integTestRuntimeClasspath +com.netflix.nebula:nebula-gradle-interop:2.3.0=compileClasspath,runtimeClasspath,shadow,testCompileClasspath,testRuntimeClasspath +com.netflix.nebula:nebula-test:10.6.2=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.perforce:p4java:2015.2.1365273=integTestRuntimeClasspath,testRuntimeClasspath commons-lang:commons-lang:2.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath dev.gradleplugins:gradle-api:7.6=compileClasspath @@ -34,20 +35,18 @@ org.eclipse.jgit:org.eclipse.jgit:5.0.1.201806211838-r=compileClasspath,runtimeC org.eclipse.sisu:org.eclipse.sisu.inject:0.3.5=compileClasspath,runtimeClasspath,shadow,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest-core:1.3=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:2.2=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:2.0.20=shadow -org.jetbrains.kotlin:kotlin-stdlib:2.1.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jetbrains.kotlin:kotlin-stdlib:2.1.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,shadow,testCompileClasspath,testRuntimeClasspath org.jetbrains:annotations:13.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,shadow,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.9.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.9.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.multiverse:multiverse-core:0.7.0=compileClasspath,runtimeClasspath,shadow,testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:2.4=integTestRuntimeClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.2.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:5.2=integTestCompileClasspath,integTestRuntimeClasspath -org.ow2.asm:asm-tree:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:5.2=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm:5.2=integTestCompileClasspath,integTestRuntimeClasspath -org.ow2.asm:asm:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.7.1=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.7.1=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.3-groovy-3.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-junit4:2.3-groovy-3.0=compileClasspath,integTestCompileClasspath,integTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath empty=annotationProcessor,compile,integTestAnnotationProcessor,integTestCompile,integTestCompileOnly,integTestRuntime,runtime,testAnnotationProcessor,testCompile,testCompileOnly,testRuntime diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c82..41c00d09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https://services.gradle.org/distributions-snapshots/gradle-8.12-20241210012659+0000-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/groovy/com/netflix/nebula/lint/plugin/FixGradleLintTask.groovy b/src/main/groovy/com/netflix/nebula/lint/plugin/FixGradleLintTask.groovy index bc54f521..23f807cd 100644 --- a/src/main/groovy/com/netflix/nebula/lint/plugin/FixGradleLintTask.groovy +++ b/src/main/groovy/com/netflix/nebula/lint/plugin/FixGradleLintTask.groovy @@ -30,6 +30,7 @@ import org.gradle.api.tasks.Internal import org.gradle.api.tasks.Optional import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.VerificationTask +import org.gradle.internal.deprecation.DeprecationLogger import static com.netflix.nebula.lint.StyledTextService.Styling.* @@ -55,22 +56,26 @@ abstract class FixGradleLintTask extends DefaultTask implements VerificationTask @TaskAction void lintCorrections() { - def violations = new LintService().lint(project, false).violations - .unique { v1, v2 -> v1.is(v2) ? 0 : 1 } + //TODO: address Invocation of Task.project at execution time has been deprecated. + DeprecationLogger.whileDisabled { + def violations = new LintService().lint(project, false).violations + .unique { v1, v2 -> v1.is(v2) ? 0 : 1 } - (userDefinedListeners.get() + infoBrokerAction + new GradleLintPatchAction(project)).each { - it.lintFinished(violations) - } + (userDefinedListeners.get() + infoBrokerAction + new GradleLintPatchAction(project)).each { + it.lintFinished(violations) + } - def patchFile = new File(project.layout.buildDirectory.asFile.get(), GradleLintPatchAction.PATCH_NAME) - if (patchFile.exists()) { - new ApplyCommand(new NotNecessarilyGitRepository(project.projectDir)).setPatch(patchFile.newInputStream()).call() - } + def patchFile = new File(project.layout.buildDirectory.asFile.get(), GradleLintPatchAction.PATCH_NAME) + if (patchFile.exists()) { + new ApplyCommand(new NotNecessarilyGitRepository(project.projectDir)).setPatch(patchFile.newInputStream()).call() + } - (userDefinedListeners.get() + infoBrokerAction + consoleOutputAction()).each { - it.lintFixesApplied(violations) + (userDefinedListeners.get() + infoBrokerAction + consoleOutputAction()).each { + it.lintFixesApplied(violations) + } } + } GradleLintViolationAction consoleOutputAction() { diff --git a/src/main/groovy/com/netflix/nebula/lint/plugin/GradleLintReportTask.groovy b/src/main/groovy/com/netflix/nebula/lint/plugin/GradleLintReportTask.groovy index de8d49f6..e5144e14 100644 --- a/src/main/groovy/com/netflix/nebula/lint/plugin/GradleLintReportTask.groovy +++ b/src/main/groovy/com/netflix/nebula/lint/plugin/GradleLintReportTask.groovy @@ -36,6 +36,7 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.VerificationTask +import org.gradle.internal.deprecation.DeprecationLogger import org.gradle.internal.reflect.Instantiator import javax.inject.Inject @@ -85,29 +86,31 @@ abstract class GradleLintReportTask extends DefaultTask implements VerificationT @TaskAction void generateReport() { - if (reports.any { it.required.isPresent() && it.required.get()}) { - def lintService = new LintService() - def results = lintService.lint(project, false) - filterOnlyFixableViolations(results) - def violationCount = results.violations.size() - def textOutput = new StyledTextService(getServices()) - - textOutput.text('Generated a report containing information about ') - textOutput.withStyle(Bold).text("$violationCount lint violation${violationCount == 1 ? '' : 's'}") - textOutput.println(' in this project') - - reports.each { - if(it.required.isPresent() && it.required.get()) { - it.write(new AnalysisContext(ruleSet: lintService.ruleSet(project)), results) + //TODO: address Invocation of Task.project at execution time has been deprecated. + DeprecationLogger.whileDisabled { + if (reports.any { it.required.isPresent() && it.required.get()}) { + def lintService = new LintService() + def results = lintService.lint(project, false) + filterOnlyFixableViolations(results) + def violationCount = results.violations.size() + def textOutput = new StyledTextService(getServices()) + + textOutput.text('Generated a report containing information about ') + textOutput.withStyle(Bold).text("$violationCount lint violation${violationCount == 1 ? '' : 's'}") + textOutput.println(' in this project') + + reports.each { + if(it.required.isPresent() && it.required.get()) { + it.write(new AnalysisContext(ruleSet: lintService.ruleSet(project)), results) + } } - } - int errors = results.violations.count { Violation v -> v.rule.priority == 1 } - if (errors > 0) { - throw new GradleException("This build contains $errors critical lint violation${errors == 1 ? '' : 's'}") + int errors = results.violations.count { Violation v -> v.rule.priority == 1 } + if (errors > 0) { + throw new GradleException("This build contains $errors critical lint violation${errors == 1 ? '' : 's'}") + } } } - } diff --git a/src/main/groovy/com/netflix/nebula/lint/plugin/LintGradleTask.groovy b/src/main/groovy/com/netflix/nebula/lint/plugin/LintGradleTask.groovy index 3f238855..ee4d4604 100644 --- a/src/main/groovy/com/netflix/nebula/lint/plugin/LintGradleTask.groovy +++ b/src/main/groovy/com/netflix/nebula/lint/plugin/LintGradleTask.groovy @@ -25,6 +25,7 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal import org.gradle.api.tasks.Optional import org.gradle.api.tasks.TaskAction +import org.gradle.internal.deprecation.DeprecationLogger import static com.netflix.nebula.lint.StyledTextService.Styling.* @@ -57,12 +58,16 @@ abstract class LintGradleTask extends DefaultTask { @TaskAction void lint() { - def violations = new LintService().lint(project, onlyCriticalRules.get()).violations - .unique { v1, v2 -> v1.is(v2) ? 0 : 1 } + //TODO: address Invocation of Task.project at execution time has been deprecated. + DeprecationLogger.whileDisabled { + def violations = new LintService().lint(project, onlyCriticalRules.get()).violations + .unique { v1, v2 -> v1.is(v2) ? 0 : 1 } - (getListeners() + new GradleLintPatchAction(project) + new GradleLintInfoBrokerAction(project) + consoleOutputAction).each { - it.lintFinished(violations) + (getListeners() + new GradleLintPatchAction(project) + new GradleLintInfoBrokerAction(project) + consoleOutputAction).each { + it.lintFinished(violations) + } } + } @Internal diff --git a/src/test/groovy/com/netflix/nebula/lint/plugin/GradleLintPluginSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/plugin/GradleLintPluginSpec.groovy index 69be8ec3..49333f87 100644 --- a/src/test/groovy/com/netflix/nebula/lint/plugin/GradleLintPluginSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/plugin/GradleLintPluginSpec.groovy @@ -793,6 +793,8 @@ class GradleLintPluginSpec extends BaseIntegrationTestKitSpec { @Unroll def 'lint task does not run for task #taskName'() { when: + //TODO: remove ignoreDeprecations once https://github.com/gradle/gradle/issues/31691 is addressed + System.setProperty('ignoreDeprecations', 'true') disableConfigurationCache() // component and model report are not config cache compatible anyway buildFile << """ plugins { diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/GradleLintRuleSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/GradleLintRuleSpec.groovy index 76971678..01aa417b 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/GradleLintRuleSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/GradleLintRuleSpec.groovy @@ -205,7 +205,7 @@ class GradleLintRuleSpec extends AbstractRuleSpec { project.buildFile << """ buildscript { repositories { - maven { url 'https://plugins.gradle.org/m2/' } + maven { url = 'https://plugins.gradle.org/m2/' } } dependencies { diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/BypassedForcesWithResolutionRulesSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/BypassedForcesWithResolutionRulesSpec.groovy index b59d4762..9c31896b 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/BypassedForcesWithResolutionRulesSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/BypassedForcesWithResolutionRulesSpec.groovy @@ -285,7 +285,7 @@ test.nebula:a:1.2.0\n""") allprojects { apply plugin: 'nebula.lint' repositories { - maven { url '${mavenrepo.absolutePath}' } + maven { url = '${mavenrepo.absolutePath}' } } gradleLint.rules = ['bypassed-forces'] } @@ -874,7 +874,7 @@ test.nebula:a:1.3.0\n""") buildFile << """\ buildscript { repositories { - maven { url "https://plugins.gradle.org/m2/" } + maven { url = "https://plugins.gradle.org/m2/" } } dependencies { classpath("com.netflix.nebula:nebula-dependency-recommender:9.0.2") { @@ -968,7 +968,7 @@ test.nebula:a:1.3.0\n""") buildFile << """\ plugins { id 'java' - id "com.netflix.nebula.resolution-rules" version "10.1.0" + id "com.netflix.nebula.resolution-rules" version "11.4.1" id 'nebula.lint' } @@ -976,7 +976,7 @@ test.nebula:a:1.3.0\n""") resolutionRules files('$rulesJsonFile') } repositories { - maven { url '${mavenrepo.absolutePath}' } + maven { url = '${mavenrepo.absolutePath}' } } gradleLint.rules = ['bypassed-forces'] """.stripIndent() @@ -987,16 +987,16 @@ test.nebula:a:1.3.0\n""") buildFile << """\ buildscript { - repositories { maven { url "https://plugins.gradle.org/m2/" } } + repositories { maven { url = "https://plugins.gradle.org/m2/" } } dependencies { - classpath "com.netflix.nebula:gradle-resolution-rules-plugin:10.1.0" + classpath "com.netflix.nebula:gradle-resolution-rules-plugin:11.4.1" } } allprojects { apply plugin: 'nebula.lint' apply plugin: 'com.netflix.nebula.resolution-rules' repositories { - maven { url '${mavenrepo.absolutePath}' } + maven { url = '${mavenrepo.absolutePath}' } } gradleLint.rules = ['bypassed-forces'] } diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/DependencyServiceSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/DependencyServiceSpec.groovy index b0a038e1..1c48a106 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/DependencyServiceSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/DependencyServiceSpec.groovy @@ -87,9 +87,11 @@ class DependencyServiceSpec extends BaseIntegrationTestKitSpec { [implementation: 'compileClasspath', testImplementation: 'testCompileClasspath'].each { declaredConf, resolvedConf -> task "\${declaredConf}Unused"(dependsOn: compileTestJava) { doLast { - new File(projectDir, "\${declaredConf}Unused.txt").text = DependencyService.forProject(project) - .unusedDependencies(resolvedConf, declaredConf) - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "\${declaredConf}Unused.txt").text = DependencyService.forProject(project) + .unusedDependencies(resolvedConf, declaredConf) + .join('\\n') + } } } @@ -132,9 +134,11 @@ class DependencyServiceSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}Undeclared"(dependsOn: compileTestJava) { doLast { - new File(projectDir, "\${conf}Undeclared.txt").text = DependencyService.forProject(project) - .undeclaredDependencies(conf) - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "\${conf}Undeclared.txt").text = DependencyService.forProject(project) + .undeclaredDependencies(conf) + .join('\\n') + } } } } @@ -202,13 +206,17 @@ class DependencyServiceSpec extends BaseIntegrationTestKitSpec { task compileClasspathSourceSetOutput { doLast { - println('@@' + DependencyService.forProject(project).sourceSetByConf('compileClasspath').java.classesDirectory.get()) + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + println('@@' + DependencyService.forProject(project).sourceSetByConf('compileClasspath').java.classesDirectory.get()) + } } } task integTestSourceSetOutput { doLast { - println('@@' + DependencyService.forProject(project).sourceSetByConf('integTestCompileClasspath').java.classesDirectory.get()) + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + println('@@' + DependencyService.forProject(project).sourceSetByConf('integTestCompileClasspath').java.classesDirectory.get()) + } } } """ @@ -258,10 +266,12 @@ class DependencyServiceSpec extends BaseIntegrationTestKitSpec { task coreContents { doLast { - new File(projectDir, "coreContents.txt").text = DependencyService.forProject(project) - .jarContents(configurations.compileClasspath.resolvedConfiguration.firstLevelModuleDependencies[0].module.id.module) - .classes - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "coreContents.txt").text = DependencyService.forProject(project) + .jarContents(configurations.compileClasspath.resolvedConfiguration.firstLevelModuleDependencies[0].module.id.module) + .classes + .join('\\n') + } } } """ @@ -315,9 +325,11 @@ class DependencyServiceSpec extends BaseIntegrationTestKitSpec { task resolvableAndResolvedConfigurations { doLast { - new File(projectDir, "resolvableAndResolvedConfigurations.txt").text = DependencyService.forProject(project) - .resolvableAndResolvedConfigurations() - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "resolvableAndResolvedConfigurations.txt").text = DependencyService.forProject(project) + .resolvableAndResolvedConfigurations() + .join('\\n') + } } } """.stripIndent() diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/FindMethodReferencesSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/FindMethodReferencesSpec.groovy index 57eab89b..1267fa6d 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/FindMethodReferencesSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/FindMethodReferencesSpec.groovy @@ -28,9 +28,11 @@ class FindMethodReferencesSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}MethodReferences"(dependsOn: compileTestJava) { doLast { - new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) - .methodReferences(conf) - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) + .methodReferences(conf) + .join('\\n') + } } } @@ -80,9 +82,11 @@ class FindMethodReferencesSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}MethodReferences"(dependsOn: compileTestJava) { doLast { - new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) - .methodReferencesExcluding(conf) - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) + .methodReferencesExcluding(conf) + .join('\\n') + } } } @@ -131,9 +135,11 @@ class FindMethodReferencesSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}MethodReferences"(dependsOn: compileTestJava) { doLast { - new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) - .methodReferencesIncludeOnly(conf, ['com/google/common/collect']) - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) + .methodReferencesIncludeOnly(conf, ['com/google/common/collect']) + .join('\\n') + } } } @@ -182,9 +188,11 @@ class FindMethodReferencesSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}MethodReferences"(dependsOn: compileTestJava) { doLast { - new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) - .methodReferencesExcluding(conf, ['com/google/common/collect']) - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) + .methodReferencesExcluding(conf, ['com/google/common/collect']) + .join('\\n') + } } } @@ -234,9 +242,12 @@ class FindMethodReferencesSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}MethodReferences"(dependsOn: compileTestJava) { doLast { - new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) - .methodReferencesExcluding(conf) - .join('\\n') + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + + new File(projectDir, "\${conf}MethodReferences.txt").text = DependencyService.forProject(project) + .methodReferencesExcluding(conf) + .join('\\n') + } } } @@ -297,7 +308,9 @@ class FindMethodReferencesSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}MethodReferences"(dependsOn: compileTestJava) { doLast { - println new JsonBuilder( DependencyService.forProject(project).methodReferences(conf) ).toPrettyString() + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + println new JsonBuilder( DependencyService.forProject(project).methodReferences(conf) ).toPrettyString() + } } } } @@ -410,7 +423,9 @@ class FindMethodReferencesSpec extends BaseIntegrationTestKitSpec { project.configurations.collect { it.name }.each { conf -> task "\${conf}MethodReferences"(dependsOn: compileTestJava) { doLast { - println new JsonBuilder( DependencyService.forProject(project).methodReferencesExcluding(conf) ).toPrettyString() + org.gradle.internal.deprecation.DeprecationLogger.whileDisabled { + println new JsonBuilder( DependencyService.forProject(project).methodReferencesExcluding(conf) ).toPrettyString() + } } } } diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/MultiProjectCircularDependencyRuleSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/MultiProjectCircularDependencyRuleSpec.groovy index f49b5f0c..e0031cb5 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/MultiProjectCircularDependencyRuleSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/MultiProjectCircularDependencyRuleSpec.groovy @@ -221,7 +221,7 @@ class MultiProjectCircularDependencyRuleSpec extends BaseIntegrationTestKitSpec def result = runTasksAndFail('fixGradleLint') then: - result.output.contains("Could not get unknown property ':foo' for DefaultProjectDependency{identityPath=':bar', configuration='default'}") + result.output.contains("Could not get unknown property ':foo' for project ':bar' of type org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency") } def 'detects circular dependencies in multi project - with bad syntax excludes fails but not in lint'() { diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/SupportJavaLibrarySpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/SupportJavaLibrarySpec.groovy index f9b7eea3..60b5666f 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/SupportJavaLibrarySpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/SupportJavaLibrarySpec.groovy @@ -115,7 +115,7 @@ class SupportJavaLibrarySpec extends BaseIntegrationTestKitSpec { | } | gradleLint.rules=['all-dependency'] | repositories { - | maven { url "${repo.toURI().toURL()}" } + | maven { url = "${repo.toURI().toURL()}" } | mavenCentral() | } |} diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UndeclaredDependencyRuleSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UndeclaredDependencyRuleSpec.groovy index 3d95face..07c5aa45 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UndeclaredDependencyRuleSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UndeclaredDependencyRuleSpec.groovy @@ -155,7 +155,7 @@ class UndeclaredDependencyRuleSpec extends BaseIntegrationTestKitSpec { buildscript { repositories { maven { - url "https://plugins.gradle.org/m2/" + url = "https://plugins.gradle.org/m2/" } } dependencies { @@ -418,7 +418,7 @@ class UndeclaredDependencyRuleSpec extends BaseIntegrationTestKitSpec { gradleLint.rules = ['undeclared-dependency'] repositories { - maven { url "${repo.toURI().toURL()}" } + maven { url = "${repo.toURI().toURL()}" } mavenCentral() } @@ -664,7 +664,7 @@ class UndeclaredDependencyRuleSpec extends BaseIntegrationTestKitSpec { buildscript { repositories { maven { - url "https://plugins.gradle.org/m2/" + url = "https://plugins.gradle.org/m2/" } } dependencies { @@ -717,7 +717,7 @@ apply plugin: "io.freefair.lombok" apply plugin: '$languagePlugin' gradleLint.rules = ['undeclared-dependency'] repositories { - maven { url "${repo.toURI().toURL()}" } + maven { url = "${repo.toURI().toURL()}" } mavenCentral() } """.stripIndent() @@ -730,7 +730,7 @@ apply plugin: "io.freefair.lombok" apply plugin: 'java' gradleLint.rules = ['undeclared-dependency'] repositories { - maven { url "${repo.toURI().toURL()}" } + maven { url = "${repo.toURI().toURL()}" } mavenCentral() } """.stripIndent() diff --git a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UnusedDependencyRuleSpec.groovy b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UnusedDependencyRuleSpec.groovy index 933fccd2..a3fa6710 100644 --- a/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UnusedDependencyRuleSpec.groovy +++ b/src/test/groovy/com/netflix/nebula/lint/rule/dependency/UnusedDependencyRuleSpec.groovy @@ -297,7 +297,7 @@ class UnusedDependencyRuleSpec extends BaseIntegrationTestKitSpec { def 'suggest that dependencies should be moved - used in only 1 nested configuration'() { buildFile.text = """ buildscript { - repositories { maven { url "https://plugins.gradle.org/m2/" } } + repositories { maven { url = "https://plugins.gradle.org/m2/" } } dependencies { classpath "com.netflix.nebula:nebula-project-plugin:10.1.4" } @@ -336,7 +336,7 @@ class UnusedDependencyRuleSpec extends BaseIntegrationTestKitSpec { def 'suggest that dependencies should be moved - used in 2 configurations in a hierarchy'() { buildFile.text = """ buildscript { - repositories { maven { url "https://plugins.gradle.org/m2/" } } + repositories { maven { url = "https://plugins.gradle.org/m2/" } } dependencies { classpath "com.netflix.nebula:nebula-project-plugin:10.1.4" }