From a00c5d895ea8ec44a78e52b2dc94d1704b0b1f1d Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 18 Nov 2019 13:52:31 +0800 Subject: [PATCH] Add JDK version check --- settings.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 6139dd65a..2db55773c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,7 +8,14 @@ include(':mirai-demos:mirai-demo-1') include(':mirai-demos:mirai-demo-gentleman') include(':mirai-demos') include(':mirai-demos:mirai-demo-android') -include(':mirai-debug') + +def javaVersion = System.getProperty("java.version") +if (javaVersion.substring(0, javaVersion.indexOf(".")).toInteger() >= 11) { + include(':mirai-debug') +} else { + println("当前使用的 JDK 版本为 ${System.getProperty("java.version")}, 最低需要 JDK 11 才能引入模块 `:mirai-debug`") +} + project(':mirai-demos:mirai-demo-1').projectDir = file('mirai-demos/mirai-demo-1') project(':mirai-demos:mirai-demo-gentleman').projectDir = file('mirai-demos/mirai-demo-gentleman') project(':mirai-demos:mirai-demo-android').projectDir = file('mirai-demos/mirai-demo-android')