From 3a01b6d98a737d55d85faefe90bfbb80c817335e Mon Sep 17 00:00:00 2001 From: "caikang.ck" Date: Sun, 19 Apr 2020 17:49:56 +0800 Subject: [PATCH] code compatibility with new idea version --- idea-plugin/p3c-common/build.gradle | 8 ++++---- idea-plugin/p3c-idea/build.gradle | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/idea-plugin/p3c-common/build.gradle b/idea-plugin/p3c-common/build.gradle index 94a1976..9031bd3 100644 --- a/idea-plugin/p3c-common/build.gradle +++ b/idea-plugin/p3c-common/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'maven' apply plugin: 'signing' javadoc { - options.tags = [ "date" ] + options.tags = ["date"] } task javadocJar(type: Jar, dependsOn: javadoc) { @@ -27,12 +27,12 @@ artifacts { } def myPlugins = [] - -if (idea_version.startsWith('193.') || idea_version.startsWith('2019.3')) { +def versionDotIndex = idea_version.indexOf('.') +def intVersion = versionDotIndex == -1 ? Integer.parseInt(idea_version) : Integer.parseInt(idea_version.substring(0, versionDotIndex)) +if (intVersion >= 2019 || (intVersion < 1000 && intVersion >= 193)) { myPlugins = ['java'] } - intellij { version idea_version plugins = myPlugins diff --git a/idea-plugin/p3c-idea/build.gradle b/idea-plugin/p3c-idea/build.gradle index da6309d..992f534 100644 --- a/idea-plugin/p3c-idea/build.gradle +++ b/idea-plugin/p3c-idea/build.gradle @@ -5,8 +5,9 @@ apply plugin: 'kotlin' apply plugin: 'idea' def myPlugins = ['git4idea'] - -if (idea_version.startsWith('193.') || idea_version.startsWith('2019.3')) { +def versionDotIndex = idea_version.indexOf('.') +def intVersion = versionDotIndex == -1 ? Integer.parseInt(idea_version) : Integer.parseInt(idea_version.substring(0, versionDotIndex)) +if (intVersion >= 2019 || (intVersion < 1000 && intVersion >= 193)) { myPlugins = ['git4idea', 'java'] } -- GitLab