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

Improve BWC distribution mismatch error message #88911

Merged
merged 4 commits into from Aug 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,6 +24,7 @@
import org.gradle.language.base.plugins.LifecycleBasePlugin;

import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -249,9 +250,10 @@ static void createBuildBwcTask(
@Override
public void execute(Task task) {
if (expectedOutputFile.exists() == false) {
throw new InvalidUserDataException(
"Building " + bwcVersion.get() + " didn't generate expected artifact " + expectedOutputFile
);
Path relativeOutputPath = project.getRootDir().toPath().relativize(expectedOutputFile.toPath());
final String message = "Building %s didn't generate expected artifact [%s]. The working branch may be "
+ "out-of-date - try merging in the latest upstream changes to the branch.";
throw new InvalidUserDataException(message.formatted(bwcVersion.get(), relativeOutputPath));
}
}
});
Expand Down