forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove duplicate definition of checkstyle version in use (elastic#88339)
We only rely on the checkstyle version in the buildLibs.toml gradle version catalogue with this change. Also added some hints for gradle best practices. This is an aftermath of elastic#88283
- Loading branch information
Showing
7 changed files
with
101 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...oovy/org/elasticsearch/gradle/internal/precommit/CheckstylePrecommitPluginFuncTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.gradle.internal.precommit | ||
|
||
import org.elasticsearch.gradle.fixtures.AbstractGradleInternalPluginFuncTest | ||
import org.elasticsearch.gradle.fixtures.LocalRepositoryFixture | ||
import org.elasticsearch.gradle.internal.conventions.precommit.PrecommitPlugin | ||
import org.gradle.testkit.runner.TaskOutcome | ||
import org.junit.ClassRule | ||
import spock.lang.Shared | ||
|
||
/** | ||
* This just tests basic plugin configuration, wiring and compatibility and not checkstyle itself | ||
* */ | ||
class CheckstylePrecommitPluginFuncTest extends AbstractGradleInternalPluginFuncTest { | ||
Class<? extends PrecommitPlugin> pluginClassUnderTest = CheckstylePrecommitPlugin.class | ||
|
||
@Shared | ||
@ClassRule | ||
public LocalRepositoryFixture repository = new LocalRepositoryFixture() | ||
|
||
def setup() { | ||
withVersionCatalogue() | ||
buildFile << """ | ||
apply plugin:'java' | ||
""" | ||
repository.configureBuild(buildFile) | ||
repository.generateJar("org.elasticsearch", "build-conventions", "unspecified", 'org.acme.CheckstyleStuff') | ||
repository.generateJar("com.puppycrawl.tools", "checkstyle", "10.3", 'org.puppycral.CheckstyleStuff') | ||
|
||
} | ||
|
||
def "can configure checkstyle tasks"() { | ||
when: | ||
def result = gradleRunner("precommit").build() | ||
then: | ||
result.task(":checkstyleMain").outcome == TaskOutcome.NO_SOURCE | ||
result.task(":checkstyleTest").outcome == TaskOutcome.NO_SOURCE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters