提交 40cfe298 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Test Java 9 multi-release code when launched on Java 9+

上级 5b089ae3
......@@ -1013,6 +1013,10 @@ public class Build extends BuildBase {
File.pathSeparator + "ext/slf4j-api-1.6.0.jar" +
File.pathSeparator + "ext/slf4j-nop-1.6.0.jar" +
File.pathSeparator + javaToolsJar;
int version = getJavaVersion();
if (version >= 9) {
cp = "src/java9/precompiled" + File.pathSeparator + cp;
}
int ret;
if (travis) {
ret = execJava(args(
......
......@@ -925,6 +925,25 @@ public class BuildBase {
return System.getProperty("java.specification.version");
}
/**
* Get the current Java version as integer value.
*
* @return the Java version (7, 8, 9, 10, 11, etc)
*/
protected static int getJavaVersion() {
int version = 7;
String v = getJavaSpecVersion();
if (v != null) {
int idx = v.indexOf('.');
if (idx >= 0) {
// 1.7, 1.8
v = v.substring(idx + 1);
}
version = Integer.parseInt(v);
}
return version;
}
private static List<String> getPaths(FileList files) {
StringList list = new StringList();
for (File f : files) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论