Skip to content

Commit

Permalink
fix: editorconfig-linters dependency declaration scope
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-perczynski committed Jan 23, 2024
1 parent 22deea5 commit e9bf477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ repositories {
}

dependencies {
val ec4jLintersVersion = "0.2.1"

compileOnly(gradleApi())
compileOnly(localGroovy())
implementation("org.ec4j.linters:editorconfig-lint-api:0.2.1")
// Keep in sync with org.ec4j.gradle.EditorconfigGradlePlugin.LINTERS_VERSION */
implementation("org.ec4j.linters:editorconfig-linters:$ec4jLintersVersion")
implementation("org.ec4j.linters:editorconfig-lint-api:$ec4jLintersVersion")

testImplementation("junit:junit:4.13.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.1")
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/org/ec4j/gradle/EditorconfigGradlePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.dsl.DependencyHandler;

/**
* Adds {@link EditorconfigExtension}, {@link EditorconfigCheckTask} and {@link EditorconfigFormatTask}.
Expand All @@ -27,17 +26,12 @@
*/
public class EditorconfigGradlePlugin implements Plugin<Project> {
public static final String CONFIGURATION_NAME = "editorconfig";
/** The version of {@code org.ec4j.linters:editorconfig-linters} keep in sync with the version in {@code build.gradle} */
private static final String LINTERS_VERSION = "0.2.1";

/** {@inheritDoc} */
@Override
public void apply(Project project) {
project.getExtensions().create(EditorconfigExtension.NAME, EditorconfigExtension.class);
project.getRepositories().add(project.getRepositories().mavenCentral());
project.getConfigurations().maybeCreate(CONFIGURATION_NAME);
final DependencyHandler dependencies = project.getDependencies();
dependencies.add(CONFIGURATION_NAME, "org.ec4j.linters:editorconfig-linters:" + LINTERS_VERSION);

project.getTasks().create(EditorconfigCheckTask.NAME, EditorconfigCheckTask.class);
project.getTasks().create(EditorconfigFormatTask.NAME, EditorconfigFormatTask.class);
Expand Down

0 comments on commit e9bf477

Please sign in to comment.