Applied Lubomir's patch to handle .sip-communicator directories on MAC, and to

build sc-launcher as a bundle.
cusax-fix
Romain Kuntz 18 years ago
parent 1c83fd74c8
commit 39d19dffa4

@ -153,6 +153,7 @@
<path id="project.class.path">
<pathelement location="${lib}"/>
<pathelement location="${bundles.dest}/sc-launcher.jar"/>
<!-- Add this bundle to the global class path as we need
the ScLogFormatter there-->
<pathelement location="${bundles.dest}/util.jar"/>
@ -206,9 +207,21 @@
<javac classpathref="compile.class.path" debug="true"
deprecation="true" destdir="${dest}" nowarn="false"
source="1.5" target="1.5" memoryMaximumSize="400M" fork="true">
<src path="${src}"/>
<src path="${src2}"/>
<include name="**/*.java" />
<src path="${src}"/>
<src path="${src2}"/>
<include name="**/*.java" />
<exclude name="net/java/sip/communicator/launcher/*.java" />
</javac>
<!--
sc-launcher.jar needs to be compatible with 1.4 in order to enable
notifying the user that a higher version of the jre is necessary.
-->
<javac classpathref="compile.class.path" debug="true"
deprecation="true" destdir="${dest}" nowarn="false"
source="1.4" target="1.4" memoryMaximumSize="400M" fork="true">
<src path="${src}"/>
<src path="${src2}"/>
<include name="net/java/sip/communicator/launcher/*.java" />
</javac>
</target>
@ -612,7 +625,7 @@
<!-- - - - - - - - - - - - - - BUNDLE BUILDING TARGETS - - - - - - - - - -->
<!--ALL BUNDLES-->
<target name="bundles"
depends="bundle-util,bundle-configuration,bundle-configuration-slick,
depends="bundle-sc-launcher,bundle-util,bundle-configuration,bundle-configuration-slick,
bundle-history,bundle-history-slick,bundle-messagehistory, bundle-msghistory-slick,
bundle-callhistory, bundle-callhistory-slick,
bundle-netaddr,bundle-netaddr-slick,bundle-slickless,
@ -647,6 +660,14 @@
bundle-plugin-simpleaccreg,bundle-plugin-generalconfig,
bundle-plugin-googletalkaccregwizz"/>
<!--BUNDLE-SC-LAUNCHER-->
<target name="bundle-sc-launcher">
<jar compress="false" destfile="${bundles.dest}/sc-launcher.jar">
<zipfileset dir="${dest}/net/java/sip/communicator/launcher"
prefix="net/java/sip/communicator/launcher"/>
</jar>
</target>
<!--BUNDLE-HISTORY-->
<target name="bundle-history">
<jar compress="false" destfile="${bundles.dest}/history.jar"

@ -139,7 +139,7 @@ felix.auto.start.60= \
#Specify the directory where oscar should deploy its bundles
#felix.cache.profiledir=sip-communicator.bin
felix.cache.profiledir=${user.home}/.sip-communicator/sip-communicator.bin
felix.cache.profiledir=${net.java.sip.communicator.SC_HOME_DIR_LOCATION}/${net.java.sip.communicator.SC_HOME_DIR_NAME}/sip-communicator.bin
felix.startlevel.framework=100
felix.startlevel.bundle=100

Binary file not shown.

@ -27,7 +27,7 @@ javabin=`which java`
SCDIR=/usr/lib/sip-communicator
LIBPATH=$SCDIR/lib
CLASSPATH=$LIBPATH/jdic_stub.jar:$LIBPATH/jdic-all.jar:$LIBPATH/felix.jar:$LIBPATH/sc-launcher.jar:$SCDIR/sc-bundles/util.jar
CLASSPATH=$LIBPATH/jdic_stub.jar:$LIBPATH/jdic-all.jar:$LIBPATH/felix.jar:$SCDIR/sc-bundles/sc-launcher.jar:$SCDIR/sc-bundles/util.jar
FELIX_CONFIG=$LIBPATH/felix.client.run.properties
LOG_CONFIG=$LIBPATH/logging.properties
COMMAND="$javabin -classpath $CLASSPATH -Dfelix.config.properties=file:$FELIX_CONFIG -Djava.util.logging.config.file=$LOG_CONFIG net.java.sip.communicator.launcher.SIPCommunicator"

@ -1,4 +1,4 @@
mkdir -p $HOME/.sip-communicator/log
export PATH=$PATH:native
java -classpath "lib/jdic-all.jar:lib/jdic_stub.jar:lib/felix.jar:lib/sc-launcher.jar:sc-bundles/util.jar" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
java -classpath "lib/jdic-all.jar:lib/jdic_stub.jar:lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator

@ -2,4 +2,4 @@ mkdir -p $HOME/.sip-communicator/log
export PATH=$PATH:native
export JAVA_HOME=jre
${JAVA_HOME}/bin/java -classpath "lib/jdic-all.jar:lib/jdic_stub.jar:lib/felix.jar:lib/sc-launcher.jar:sc-bundles/util.jar" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator
${JAVA_HOME}/bin/java -classpath "lib/jdic-all.jar:lib/jdic_stub.jar:lib/felix.jar:sc-bundles/sc-launcher.jar:sc-bundles/util.jar" -Djava.library.path=native -Dfelix.config.properties=file:./lib/felix.client.run.properties -Djava.util.logging.config.file=lib/logging.properties net.java.sip.communicator.launcher.SIPCommunicator

Binary file not shown.

@ -10,7 +10,7 @@
<classPath>lib\felix.jar</classPath>
<classPath>lib\jdic-all.jar</classPath>
<classPath>lib\jdic_stub.jar</classPath>
<classPath>lib\sc-launcher.jar</classPath>
<classPath>sc-bundles\sc-launcher.jar</classPath>
<currentDirectory>${EXECUTABLEPATH}</currentDirectory>
<embeddedJar>false</embeddedJar>
<executableName>run.exe</executableName>

@ -15,9 +15,16 @@
* Starts the SIP Communicator.
*
* @author Yana Stamcheva
* @author Lubomir Marinov
*/
public class SIPCommunicator
{
private static final String PNAME_SC_HOME_DIR_LOCATION =
"net.java.sip.communicator.SC_HOME_DIR_LOCATION";
private static final String PNAME_SC_HOME_DIR_NAME =
"net.java.sip.communicator.SC_HOME_DIR_NAME";
/**
* Starts the SIP Communicator.
*
@ -30,44 +37,13 @@ public static void main(String[] args)
String vmVendor = System.getProperty("java.vendor");
String osName = System.getProperty("os.name");
/**
* Check whether default config folder exists.
* If it exists we use it. Otherwise use the settings coming
* from system properties. And set SC_HOME_DIR_LOCATION
* as we cannot set it when building dmg packet.
* This is done cause moving the config folder and preventing
* not using existing data for users already using default folder.
/*
* SC_HOME_DIR_* are specific to the OS so make sure they're configured
* accordingly before any other application-specific logic depending on
* them starts (e.g. Felix).
*/
if (osName.startsWith("Mac"))
{
String scDefultDirName = ".sip-communicator";
String scHomeDirLocation =
System.getProperty("net.java.sip.communicator.SC_HOME_DIR_LOCATION");
if(scHomeDirLocation == null)
{
String defaultAppDirName =
System.getProperty("user.home") +
File.separator +
scDefultDirName;
if(new File(defaultAppDirName).exists())
{
System.setProperty("net.java.sip.communicator.SC_HOME_DIR_LOCATION",
System.getProperty("user.home"));
System.setProperty("net.java.sip.communicator.SC_HOME_DIR_NAME",
scDefultDirName);
}
else
{
System.setProperty("net.java.sip.communicator.SC_HOME_DIR_LOCATION",
System.getProperty("user.home") + File.separator +
"Library" + File.separator + "Application Support");
}
}
}
setScHomeDir(osName);
if (version.startsWith("1.4") || vmVendor.startsWith("Gnu"))
{
String os = "";
@ -94,4 +70,77 @@ else if (osName.startsWith("Windows"))
Main.main(args);
}
/**
* Sets the system properties net.java.sip.communicator.SC_HOME_DIR_LOCATION
* and net.java.sip.communicator.SC_HOME_DIR_NAME (if they aren't already
* set) in accord with the OS conventions specified by the name of the OS.
*
* @param osName the name of the OS according to which the SC_HOME_DIR_*
* properties are to be set
*/
private static void setScHomeDir(String osName)
{
/*
* Though we'll be setting the SC_HOME_DIR_* property values depending
* on the OS running the application, we have to make sure we are
* compatible with earlier releases i.e. use
* ${user.home}/.sip-communicator if it exists (and the new path isn't
* already in use).
*/
String location = System.getProperty(PNAME_SC_HOME_DIR_LOCATION);
String name = System.getProperty(PNAME_SC_HOME_DIR_NAME);
if ((location == null) || (name == null))
{
String defaultLocation = System.getProperty("user.home");
String defaultName = ".sip-communicator";
if (osName.startsWith("Mac"))
{
if (location == null)
location =
System.getProperty("user.home") + File.separator
+ "Library" + File.separator
+ "Application Support";
if (name == null)
name = "SIP Communicator";
}
else if (osName.startsWith("Windows"))
{
/*
* Primarily important on Vista because Windows Explorer opens
* in %USERPROFILE% so .sip-communicator is always visible. But
* it may be a good idea to follow the OS recommendations and
* use APPDATA on pre-Vista systems as well.
*/
if (location == null)
location = System.getenv("APPDATA");
if (name == null)
name = "SIP Communicator";
}
/* If there're no OS specifics, use the defaults. */
if (location == null)
location = defaultLocation;
if (name == null)
name = defaultName;
/*
* As it was noted earlier, make sure we're compatible with previous
* releases.
*/
if ((new File(location, name).isDirectory() == false)
&& new File(defaultLocation, defaultName).isDirectory())
{
location = defaultLocation;
name = defaultName;
}
System.setProperty(PNAME_SC_HOME_DIR_LOCATION, location);
System.setProperty(PNAME_SC_HOME_DIR_NAME, name);
}
}
}

Loading…
Cancel
Save