Skip to content

Configure Kokoro CI for Windows #716

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

Merged
merged 4 commits into from
Jun 16, 2019
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
3 changes: 3 additions & 0 deletions .kokoro/build.bat
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .kokoro/continuous/java8-win.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "google-http-java-client/.kokoro/build.bat"
3 changes: 3 additions & 0 deletions .kokoro/presubmit/java8-win.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "google-http-java-client/.kokoro/build.bat"
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import junit.framework.TestCase;

/**
Expand All @@ -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));
}
}

22 changes: 21 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
<configuration>
<rules>
<requireMavenVersion>
<version>[3.5.4,4.0.0)</version>
<version>[3.5.2,4.0.0)</version>
</requireMavenVersion>
</rules>
</configuration>
Expand Down Expand Up @@ -558,6 +558,26 @@
</properties>

<profiles>
<profile>
<id>Windows</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>release-sign-artifacts</id>
<activation>
Expand Down