Update.bat question


I want to "patch" a local installation of intellij CE  with modifications I made to the source such that I can then run that modified version of the source and work with it instead of the original Intellij CE from Jetbrains.

According to this:

http://devnet.jetbrains.com/thread/452650?tstart=0

a way to achieve that is by using the script named update.bat (or update.sh), which is located at ..\ideaIC-133.193\build\update.sh

In that script, (which appears in total at the bottom of this post for anyone who might find it useful)   the following line appears:

ANT_CLASSPATH="$DEV_IDEA_HOME/build/lib/gant/lib/jps.jar"

the problem is, there is no such jar file "jps.jar" located at the end of any path, including the one indicated . That is, no matter what you substitute for
$DEV_IDEA_HOME

you will not find a path to

/build/lib/gant/lib/jps.jar

I am wondering if update.sh is outdated for the current Intellij CE release and if I should modify it in some way.

Another thing is, n this script it says the following:


# Before you run the script, ensure you have the following:
# 1. Your project for IntelliJ IDEA CE is fully built (do 'Rebuild Project' if you're not sure)
# 2. WORK_IDEA_HOME points to the directory of IntelliJ IDEA build you want to upgrade
# 3. DEV_IDEA_HOME points to the directory of the project you built at step 1
# 4. You quit IntelliJ IDEA

I am not sure what the difference between WORK_IDEA_HOME and DEV_IDEA_HOME might really be. It seems to me that "IntelliJ IDEA build you want to upgrade" which is the definition of WORK_IDEA_HOME, as per above is not other than "the directory of the project you built at step 1" which is the definition of DEV_IDEA_HOME, as  per above



UPDATE.BAT:

#! /bin/bash
#
# This script updates your IntelliJ IDEA CE installation from the latest compiled classes. This way you can easily
# upgrade your working IDEA to the latest changes.
#
# Before you run the script, ensure you have the following:
# 1. Your project for IntelliJ IDEA CE is fully built (do 'Rebuild Project' if you're not sure)
# 2. WORK_IDEA_HOME points to the directory of IntelliJ IDEA build you want to upgrade
# 3. DEV_IDEA_HOME points to the directory of the project you built at step 1
# 4. You quit IntelliJ IDEA

if [ ! -f "$WORK_IDEA_HOME/bin/inspect.sh" ]; then
  echo "WORK_IDEA_HOME must be defined and point to build you're updating."
  exit 1
fi

if [ ! -f "$DEV_IDEA_HOME/build/update.sh" ]; then
  echo "DEV_IDEA_HOME must be defined and point to source base you're updating from."
  exit 1
fi

echo "Updating $WORK_IDEA_HOME from compiled classes in $DEV_IDEA_HOME"

ANT_HOME="$DEV_IDEA_HOME/lib/ant"
ANT_CLASSPATH="$DEV_IDEA_HOME/build/lib/gant/lib/jps.jar"
java -Xms64m -Xmx512m -Dant.home="$ANT_HOME" -classpath "$ANT_HOME/lib/ant-launcher.jar" org.apache.tools.ant.launch.Launcher \
-lib "$ANT_CLASSPATH" -f $DEV_IDEA_HOME/build/update.xml $TARGET

if [ "$?" != "0" ]; then
  echo "Update failed; work IDEA build not modified."
  rm -rf "$WORK_IDEA_HOME/___tmp___"
  exit 2
fi

rm -rf $WORK_IDEA_HOME/lib
rm -rf $WORK_IDEA_HOME/plugins

cp -R $DEV_IDEA_HOME/out/deploy/* $WORK_IDEA_HOME

OS_TYPE=`uname -s`
if [ "$OS_TYPE" = "Linux" ]; then
  cp -a $DEV_IDEA_HOME/bin/linux/*.so $WORK_IDEA_HOME/bin
  cp -a $DEV_IDEA_HOME/bin/linux/fsnotifier* $WORK_IDEA_HOME/bin
elif [ "$OS_TYPE" = "Darwin" ]; then
  cp -a $DEV_IDEA_HOME/bin/mac/*.jnilib $WORK_IDEA_HOME/bin
  cp -a $DEV_IDEA_HOME/bin/mac/fsnotifier $WORK_IDEA_HOME/bin
  cp -a $DEV_IDEA_HOME/bin/mac/restarter $WORK_IDEA_HOME/bin
fi

Message was edited by: java developer    fixing typos

2 comments

OK I think I can answer my own question here... for starters, the update script I posted was not for Win (my platofrm) but mac or linux and apparently those platforms have significantll different paths, including for the file I cited in my OP :8}.  I even got the name wrong, it's update.cmd ( can you tell I haven't done much Windows scripting?)

Second, here is what appears to be meant by the two scripting variables in the update.cmd script in question-

%DEV_IDEA_HOME% or "the directory of the project you built at step one" is just as you might suppose- the top level directory of the Intellij CE project itself whose source you are editing, so for this release that would be

SOME_LOCATION_ON_YOUR_MACHINE\ ideaIC-133-193 where the directory structure benath it has directories .idea ,  .jps-build-data,   bin,  build,  colorSchemes

I mention those other directories because,  actually, when you unzip the zipped version of the IntellijCE source onto your machine into some containing directory -MyDirectoryForIntellijSource-  at least on my machine using my unzip tool I ended up with an ideaIC-133.193 directory within MyDirectoryForIntellijSource which in turn was within an ideaIC-133.193 directory.  So there is ambiguity there with multiples of same-named ideaIC-133.193 directories hanging around what can arguably be described as "the directory of the project you built at step one"


%WORK_IDEA_HOME% or "the directory of the intellij IDEA build you want to upgrade" turns out to mean the either the directory named:

\out\artifacts\ideaIC-133.SNAPSHOT.win  

directly beneath %DEV_IDEA_HOME%

or the directory named:

out\dist.win.ce

directly beneath %DEV_IDEA_HOME%


and I am working out which one it is right now. I am supposing that, if I use the contents fonund in subdirectories of the "artifacts" directory to launch Intellij CE then I want it in the first one above, because that is wherethe scripts contained there would look for the .class files to use (I dont' know this, I am guessing) .


Anyway hope this helps someone....

Message was edited by: java developer fixed path info

0

Yeah well, none of that worked. :_| If anyone understands how to update sources you've edited other than doing an ant->build all  and waiting 40 minutes, please feel free to pass it along..

0

Please sign in to leave a comment.