From 477e65e659f0dfb26ec1d9d26f8fc78c00a9c1ca Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 28 Jan 2015 01:07:39 +0100 Subject: [PATCH] Set Python plugin version from PyCharm ApplicationInfo.xml --- python/build/python_plugin_build.gant | 13 +++++++++++++ python/pluginResources/META-INF/plugin.xml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/python/build/python_plugin_build.gant b/python/build/python_plugin_build.gant index 5b24d78089e1..5d50648ac6a7 100644 --- a/python/build/python_plugin_build.gant +++ b/python/build/python_plugin_build.gant @@ -172,6 +172,19 @@ target(name: "compile", description: "Compile module python") { fileset(file: "${pluginHome}/build/python-plugin-dependencies.xml") } + // set version to PyCharm current version from ApplicationInfo.xml + ant.loadfile(property: "appInfo", srcFile: "${home}/python/resources/idea/PyCharmCoreApplicationInfo.xml") { + } + + major = ("${appInfo}" =~ /major\s*=\s*\"([^"])\"/)[0][1] + minor = ("${appInfo}" =~ /minor\s*=\s*\"([^"])\"/)[0][1] + + + ant.replaceregexp(file: path, + match: "@@PYCHARM_VERSION@@", + replace: "${major}.${minor}") + + // set since-build to the current idea build number ant.replace(file: "${classesDir}/META-INF/plugin.xml") { replacefilter(token: "@@BUILD_NUMBER@@", value: "${buildNumber}") } diff --git a/python/pluginResources/META-INF/plugin.xml b/python/pluginResources/META-INF/plugin.xml index c75e264faf5a..92421ad0cc2d 100644 --- a/python/pluginResources/META-INF/plugin.xml +++ b/python/pluginResources/META-INF/plugin.xml @@ -16,7 +16,7 @@ The Python plug-in provides smart editing for Python scripts. The feature set of ]]> - 4.1 @@BUILD_NUMBER@@ EAP + @@PYCHARM_VERSION@@ @@BUILD_NUMBER@@ EAP com.intellij.modules.java