From 26054cefbaa8f688708f7eadf3ce5e6f7a4024bc Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 25 Jan 2010 20:36:29 +0300 Subject: [PATCH] scrambling in PyCharm build --- python/build/pycharm_build.gant | 43 +++++++++++++++++++ .../python/PythonFileTypeFactory.java | 2 + python/python-plugin.iml | 2 + 3 files changed, 47 insertions(+) rename python/{src => pluginSrc}/com/jetbrains/python/PythonFileTypeFactory.java (90%) diff --git a/python/build/pycharm_build.gant b/python/build/pycharm_build.gant index c97dfb22f465..067ef2f84260 100644 --- a/python/build/pycharm_build.gant +++ b/python/build/pycharm_build.gant @@ -164,6 +164,7 @@ target('default': "Build artifacts") { build_searchable_options() wire_build_date(buildName) layoutFull(paths.distAll, usedJars) + scramble() layoutWin(paths.distWin) layoutMac(buildName: buildName, @@ -223,6 +224,48 @@ def build_searchable_options() { } } +def zkmScramble(String script, String dir, String jarName) { + ant.java(classname: "ZKM", fork: "true", failonerror: "true") { + jvmarg(value: "-Xmx1100m") + arg(value: "-v") + arg(value: script) + classpath { + fileset(dir: dir) { + include(name: "*.jar") + exclude(name: jarName) + } + + fileset(dir: "$home/lib") { + include(name: "*.jar") + } + + pathelement(location: "$home/build/lib/ZKM.jar") + } + } + + ant.delete(file: "$dir/${jarName}.BACKUP", failonerror: "false") +} + +def scramble() { + ant.copy(file: "$home/build/conf/script.zkm.stub", tofile: "$paths.sandbox/script.zkm", overwrite: "true") { + filterset(begintoken: "__", endtoken: "__") { + filter(token: "CLASSES", value: "\"${paths.distAll}/lib/pycharm.jar\"") + filter(token: "SCRAMBLED_CLASSES", value: "${paths.distAll}/") + filter(token: "INCREMENTAL", value: "") + } + } + ant.mkdir(dir: "$paths.artifacts/pycharm.unscrambled") + ant.copy(file: "$paths.distAll/lib/pycharm.jar", todir: "$paths.artifacts/pycharm.unscrambled") + zkmScramble("$paths.sandbox/script.zkm", "$paths.distAll/lib", "pycharm.jar") + ant.zip(destfile: "$paths.artifacts/logs.zip") { + fileset(file: "ChangeLog.txt") + fileset(file: "ZKM_log.txt") + fileset(file: "$paths.sandbox/script.zkm") + } + ant.delete(file: "ChangeLog.txt") + ant.delete(file: "ZKM_log.txt") +} + String appInfoFile() { return "$home/out/pycharm/classes/production/python-ide/idea/PythonApplicationInfo.xml" } diff --git a/python/src/com/jetbrains/python/PythonFileTypeFactory.java b/python/pluginSrc/com/jetbrains/python/PythonFileTypeFactory.java similarity index 90% rename from python/src/com/jetbrains/python/PythonFileTypeFactory.java rename to python/pluginSrc/com/jetbrains/python/PythonFileTypeFactory.java index f3d3d88a705e..f7daf643b6f3 100644 --- a/python/src/com/jetbrains/python/PythonFileTypeFactory.java +++ b/python/pluginSrc/com/jetbrains/python/PythonFileTypeFactory.java @@ -8,6 +8,8 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; /** + * Plugin version of file type factory - uses UltimateVerifier. + * * @author yole */ public class PythonFileTypeFactory extends FileTypeFactory { diff --git a/python/python-plugin.iml b/python/python-plugin.iml index 64c4df63a585..8c254f5c8330 100644 --- a/python/python-plugin.iml +++ b/python/python-plugin.iml @@ -12,6 +12,8 @@ + +