diff --git a/.kokoro/build.bat b/.kokoro/build.bat new file mode 100644 index 000000000..e5324a570 --- /dev/null +++ b/.kokoro/build.bat @@ -0,0 +1,3 @@ +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" github/google-http-java-client/.kokoro/build.sh diff --git a/.kokoro/continuous/java8-win.cfg b/.kokoro/continuous/java8-win.cfg new file mode 100644 index 000000000..b44537d03 --- /dev/null +++ b/.kokoro/continuous/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "google-http-java-client/.kokoro/build.bat" diff --git a/.kokoro/presubmit/java8-win.cfg b/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 000000000..b44537d03 --- /dev/null +++ b/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "google-http-java-client/.kokoro/build.bat" diff --git a/google-http-client/src/test/java/com/google/api/client/util/IOUtilsTest.java b/google-http-client/src/test/java/com/google/api/client/util/IOUtilsTest.java index 39a66dbde..4d3503544 100644 --- a/google-http-client/src/test/java/com/google/api/client/util/IOUtilsTest.java +++ b/google-http-client/src/test/java/com/google/api/client/util/IOUtilsTest.java @@ -16,6 +16,7 @@ import java.io.File; import java.io.IOException; +import java.nio.file.Files; import junit.framework.TestCase; /** @@ -42,24 +43,14 @@ public void testIsSymbolicLink_false() throws IOException { assertFalse(IOUtils.isSymbolicLink(file)); } - public void testIsSymbolicLink_true() throws IOException, InterruptedException { + public void testIsSymbolicLink_true() throws IOException { File file = File.createTempFile("tmp", null); file.deleteOnExit(); File file2 = new File(file.getCanonicalPath() + "2"); file2.deleteOnExit(); - try { - Process process = - Runtime.getRuntime() - .exec(new String[] {"ln", "-s", file.getCanonicalPath(), file2.getCanonicalPath()}); - process.waitFor(); - process.destroy(); - } catch (IOException e) { - // ignore because ln command may not be defined - return; - } - // multiple versions of jdk6 cannot detect the symbolic link. Consider support best-effort on - // jdk6 - boolean jdk6 = System.getProperty("java.version").startsWith("1.6.0_"); - assertTrue(IOUtils.isSymbolicLink(file2) || jdk6); + Files.createSymbolicLink(file2.toPath(), file.toPath()); + + assertTrue(IOUtils.isSymbolicLink(file2)); } } + diff --git a/pom.xml b/pom.xml index 235e2cbf9..a2b5784d0 100644 --- a/pom.xml +++ b/pom.xml @@ -372,7 +372,7 @@ - [3.5.4,4.0.0) + [3.5.2,4.0.0) @@ -558,6 +558,26 @@ + + Windows + + + windows + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + + release-sign-artifacts