Skip to content

Commit

Permalink
Improve BWC distribution mismatch error message (elastic#88911)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Aug 22, 2022
1 parent f942bad commit 5c28a51
Showing 1 changed file with 5 additions and 3 deletions.
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 @@ -251,9 +252,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

0 comments on commit 5c28a51

Please sign in to comment.