Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baseline-refaster-rules can be overridden #827

Merged
merged 7 commits into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-827.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: fix
fix:
description: Excavator PRs that apply other refaster rules (e.g. Witchcraft ones)
will not also apply baseline refaster rules.
links:
- https://github.com/palantir/gradle-baseline/pull/827
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
public final class BaselineErrorProne implements Plugin<Project> {
private static final Logger log = Logging.getLogger(BaselineErrorProne.class);

public static final String REFASTER_CONFIGURATION = "refaster";
public static final String EXTENSION_NAME = "baselineErrorProne";

private static final String ERROR_PRONE_JAVAC_VERSION = "9+181-r4173-1";
Expand All @@ -67,13 +66,15 @@ public void apply(Project project) {
String version = Optional.ofNullable(getClass().getPackage().getImplementationVersion())
.orElse("latest.release");

Configuration refasterConfiguration = project.getConfigurations().create(REFASTER_CONFIGURATION);
Configuration refasterConfiguration = project.getConfigurations().create("refaster", conf -> {
iamdanfox marked this conversation as resolved.
Show resolved Hide resolved
conf.defaultDependencies(deps -> {
deps.add(project.getDependencies().create(
"com.palantir.baseline:baseline-refaster-rules:" + version + ":sources"));
});
});
Configuration refasterCompilerConfiguration = project.getConfigurations()
.create("refasterCompiler", configuration -> configuration.extendsFrom(refasterConfiguration));

project.getDependencies().add(
REFASTER_CONFIGURATION,
"com.palantir.baseline:baseline-refaster-rules:" + version + ":sources");
project.getDependencies().add(
ErrorPronePlugin.CONFIGURATION_NAME,
"com.palantir.baseline:baseline-error-prone:" + version);
Expand Down