From 627f713c623203e50133260c9a1ba87195f38b76 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 23 Aug 2018 10:23:17 +0300 Subject: [PATCH 1/2] Fix plugin build test on Windows Replace slashes for windows --- .../java/org/elasticsearch/gradle/BuildExamplePluginsIT.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java b/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java index 9b63d6f45e06b..727a2850a5c96 100644 --- a/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java +++ b/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java @@ -158,7 +158,8 @@ private String getLocalTestRepoPath() { Objects.requireNonNull(property, "test.local-test-repo-path not passed to tests"); File file = new File(property); assertTrue("Expected " + property + " to exist, but it did not!", file.exists()); - return file.getAbsolutePath(); + // Use / on Windows too + return file.getAbsolutePath().replace("\\", "/"); } } From 058347f83fbfb3af26dc42a91d43c1a167af8dc9 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 27 Aug 2018 09:23:59 +0300 Subject: [PATCH 2/2] Add conditional --- .../org/elasticsearch/gradle/BuildExamplePluginsIT.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java b/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java index 727a2850a5c96..3e18b0b80af3f 100644 --- a/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java +++ b/buildSrc/src/test/java/org/elasticsearch/gradle/BuildExamplePluginsIT.java @@ -158,8 +158,12 @@ private String getLocalTestRepoPath() { Objects.requireNonNull(property, "test.local-test-repo-path not passed to tests"); File file = new File(property); assertTrue("Expected " + property + " to exist, but it did not!", file.exists()); - // Use / on Windows too - return file.getAbsolutePath().replace("\\", "/"); + if (File.separator.equals("\\")) { + // Use / on Windows too, the build script is not happy with \ + return file.getAbsolutePath().replace(File.separator, "/"); + } else { + return file.getAbsolutePath(); + } } }