Hi guys,
I think I'm the only one that commits something compiled to our
branches, but i'm giving feedback in case anyone else does it, and has
experienced the same problems I have.
As you know, I've been working the last months in dbsourcemanager. As
you also probably know, dbsourcemanager is a precompiled .jar file we
currently store in our Openbravo branches. Up until version 2.50, the
required version of Java for Openbravo was Java 5. However, in version
2.50, we are going to require Java 6. This, in turn, forces us
developers to upgrade to Java 6.
However, after having done just that, I got the message that I had
mistakenly committed a version of dbsourcemanager to the branch 2.40
which was incorrect, as it was compiled with Java 6, and our 2.40 branch
should support Java 5.
This means that from now on, when I'm working in the 2.40 and previous
releases of dbsourcemanager, I have to use Java 5, and I have to use
Java 6 in subsequent releases. Changing this is annoying, and really
prone to errors. Fortunately, Juan Pablo has helped me (and, therefore,
us :-)) by preparing a script that automatically changes the version of
the Java SDK you are using while running ant tasks, depending on the
directory you are working in. The script is a file called "ant", located
in ~/bin/, and looks like this:
================================
#!/bin/sh
CURRENTDIR=$(echo $(pwd) | sed 's,.*/\([^/]*\),\1,')
restore_jdk () {
sudo /usr/sbin/update-java-alternatives -s java-6-sun > /dev/null 2>&1
}
if [ "$CURRENTDIR" = "DBSourceManager 0.7x" ] || [ "$CURRENTDIR" =
"DBSourceManager 0.8x" ]; then
export JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun"
sudo /usr/sbin/update-java-alternatives -s java-1.5.0-sun > /dev/null
2>&1
fi
/home/openbravo/apache-ant-1.7.0/bin/ant $* && { restore_jdk && exit 0;
} || { restore_jdk && exit 1; }
================================
If you use it, remember to change the name of the directories to the
ones in which you need to use Java 5, and remember also to adapt the
last line, specifying the path to your ant installation.
Hope it helps. Regards,
Antonio.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Openbravo-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-development