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

[Build] Cache spotless p2 dependencies when baking ci image #118523

Merged
merged 2 commits into from
Dec 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import org.gradle.api.Project;

import java.io.File;
import java.util.Arrays;
import java.util.Map;

/**
* This plugin configures formatting for Java source using Spotless
Expand Down Expand Up @@ -66,8 +64,7 @@ public void apply(Project project) {
java.importOrderFile(new File(elasticsearchWorkspace, importOrderPath));

// Most formatting is done through the Eclipse formatter
java.eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/"))
.configFile(new File(elasticsearchWorkspace, formatterConfigPath));
java.eclipse().configFile(new File(elasticsearchWorkspace, formatterConfigPath));

// Ensure blank lines are actually empty. Since formatters are applied in
// order, apply this one last, otherwise non-empty blank lines can creep
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ allprojects {
if (project.path.contains(":distribution:docker")) {
enabled = false
}

if (project.path.contains(":libs:cli")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we are just arbitrarily picking a project here, yes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

// ensure we resolve p2 dependencies for the spotless eclipse formatter
dependsOn "spotlessJavaCheck"
}
}

plugins.withId('lifecycle-base') {
Expand Down