CR-IC-7402 IDEA-146068

This commit is contained in:
Vladimir Krivosheev
2015-10-07 09:57:05 +02:00
parent 5b4e765f05
commit f065882dff
+3 -2
View File
@@ -664,8 +664,9 @@ def setPluginVersionAndSince(String moduleName, String version) {
if (file.isFile()) {
def text = file.text
if (!text.contains("<version>")) {
def nextMajorVersion = Integer.parseInt(version.substring(0, version.indexOf('.'))) + 1
file.text = text.replace("</id>", "</id>\n <version>${version}</version>\n <idea-version since-build=\"${version}\" until-build=\"${nextMajorVersion}.0\"/>\n")
def dotIndex = version.indexOf('.')
def untilBuild = dotIndex > 0 ? (Integer.parseInt(version.substring(0, dotIndex)) + 1).toString() + ".0" : version
file.text = text.replace("</id>", "</id>\n <version>${version}</version>\n <idea-version since-build=\"${version}\" until-build=\"${untilBuild}\"/>\n")
}
}
}