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

--write-locks no longer implicitly runs checkClassUniqueness task #1389

Merged
merged 2 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions changelog/@unreleased/pr-1389.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: improvement
improvement:
description: Running `./gradlew --write-locks` should be faster now, as it doesn't
update your `baseline-class-uniqueness.lock` file implicitly anymore. To update
this, you need to run `./gradlew checkClassUniqueness --write-locks`.
links:
- https://github.com/palantir/gradle-baseline/pull/1389
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

package com.palantir.baseline.plugins;

import com.google.common.collect.ImmutableList;
import com.palantir.baseline.tasks.CheckClassUniquenessLockTask;
import java.util.List;
import org.gradle.StartParameter;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.plugins.JavaPlugin;
Expand Down Expand Up @@ -53,16 +50,5 @@ public final void apply(Project project) {
t.dependsOn(runtimeClasspath);
});
});

// Wire up dependencies so running `./gradlew --write-locks` will update the lock file
StartParameter startParam = project.getGradle().getStartParameter();
if (startParam.isWriteDependencyLocks()
&& !startParam.getTaskNames().contains(checkClassUniqueness.getName())) {
List<String> taskNames = ImmutableList.<String>builder()
.addAll(startParam.getTaskNames())
.add(checkClassUniqueness.getName())
.build();
startParam.setTaskNames(taskNames);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class BaselineClassUniquenessPluginIntegrationTest extends AbstractPluginTest {
result.getOutput().contains("javax.el.ArrayELResolver");
!lockfile.exists()

with("--write-locks").build()
with("checkClassUniqueness", "--write-locks").build()
lockfile.exists()

File expected = new File("src/test/resources/com/palantir/baseline/baseline-class-uniqueness.expected.lock")
Expand Down