Merge pull request #56 from dpocock/webstart-dp1

Build improvements and embedding utility code
fix-message-formatting
Ingo Bauersachs 11 years ago
commit ca605b2847

@ -23,6 +23,48 @@ public static void main(String[] args) throws Exception
// allow access to everything
System.setSecurityManager(null);
// optional: the name of another class with a main method
// that should be started in the same JVM:
String chainMain = System.getProperty("chain.main.class");
if(chainMain != null)
{
// optional: a space-separated list of arguments to be passed
// to the chained main() method:
String chainArgs = System.getProperty("chain.main.args");
if(chainArgs == null)
{
chainArgs = "";
}
final String[] _chainArgs = chainArgs.split("\\s");
try
{
Class<?> c = Class.forName(chainMain);
final Method m = c.getMethod("main", _chainArgs.getClass());
new Thread()
{
public void run()
{
try
{
m.invoke(null, new Object[]{_chainArgs});
}
catch (Exception ex)
{
ex.printStackTrace();
System.err.println("Exception running the " +
"chained main class, will continue anyway.");
}
}
}.start();
}
catch (Exception ex)
{
ex.printStackTrace();
System.err.println("Exception finding the chained main " +
"class, will continue anyway.");
}
}
// prepare the logger
// needed by the FileHandler-Logger
SIPCommunicator.setScHomeDir(System.getProperty("os.name"));
@ -134,7 +176,32 @@ public static void main(String[] args) throws Exception
{
}
// Handle the "-open" argument from the javaws command line
Vector<String> _args = new Vector<String>();
for(int i = 0; i < args.length ; i++)
{
String arg = args[i];
if(arg.equalsIgnoreCase("-open"))
{
// are we at the last argument or is the next value
// some other option flag?
if(i == (args.length - 1) ||
(args[i+1].length() > 0 &&
"-/".indexOf(args[i+1].charAt(0))>=0))
{
// invalid, can't use "-open" as final argument
System.err.println("Command line argument '-open'"
+ " requires a parameter, usually a URI");
System.exit(1);
}
}
else
{
_args.add(arg);
}
}
// launch the original app
SIPCommunicator.main(args);
SIPCommunicator.main(_args.toArray(new String[] {}));
}
}

@ -17,7 +17,7 @@
<property name="unpack200.path" value="${java.jdk.dir}/bin/unpack200" />
<property name="jarsigner.path" value="${java.jdk.dir}/bin/jarsigner" />
<target name="compile-ant-ext">
<target name="compile-ant-ext" depends="prepare">
<javac srcdir="${ant-ext-src.dir}" destdir="${ant-ext.dir}" includeantruntime="true" />
</target>
@ -147,8 +147,16 @@
</target>
<!-- sign libs -->
<target name="sign-libs" description="Sign all jars within the release folder.">
<target name="sign-libs" description="Sign all jars within the release folder." depends="repack-libs">
<echo message="Signing libs in ${release.dir}" />
<!-- some JARs are distributed with their own SHA-1 signature, we invoke
this once for SHA1 to overwrite that with our signature -->
<signjar alias="${keystore.alias}" keystore="${keystore.file}" storepass="${keystore.password}" lazy="true" digestalg="SHA1">
<path>
<fileset dir="${release.dir}" includes="**/*.jar" />
</path>
</signjar>
<!-- now we apply the default (SHA-256 for JDK 1.7) signature to every JAR -->
<signjar alias="${keystore.alias}" keystore="${keystore.file}" storepass="${keystore.password}" lazy="true">
<path>
<fileset dir="${release.dir}" includes="**/*.jar" />
@ -161,12 +169,13 @@
<echo message="Repacking libs in ${release.dir}" />
<apply executable="${pack200.path}" parallel="false">
<arg value="--repack" />
<arg value="--segment-limit=-1" />
<fileset dir="${release.dir}" includes="**/*.jar" />
</apply>
</target>
<!-- compress libs -->
<target name="compress-libs" description="Comperss all jars within release folder.">
<target name="compress-libs" description="Comperss all jars within release folder." depends="sign-libs">
<echo message="Compressing libs in ${release.dir}" />
<apply executable="${pack200.path}" parallel="false" dest="${release.dir}">
<!--<arg value="- -modification-time=latest"/>-->
@ -266,6 +275,9 @@
<fileset dir="${sc.basedir}/resources/install">
<include name="logging.properties" />
</fileset>
<fileset dir="${sc.basedir}/lib">
<include name="jitsi-default*.properties" />
</fileset>
<fileset dir="${tmp.dir}">
<include name="*.properties" />
</fileset>

@ -64,11 +64,17 @@
<resources os="Linux" arch="i386">
<nativelib href="native/linux.jar"/>
</resources>
<resources os="Linux" arch="x86">
<nativelib href="native/linux.jar"/>
</resources>
<!-- Linux 64 bit -->
<resources os="Linux" arch="amd64">
<nativelib href="native/linux-64.jar"/>
</resources>
<resources os="Linux" arch="x86_64">
<nativelib href="native/linux-64.jar"/>
</resources>
<!-- Mac -->
<resources os="Mac OS X">
@ -83,6 +89,11 @@
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<property name="net.java.sip.communicator.SC_JWS_BASEDIR" value="@URL@"/>
<!-- to run an additional application in the same JVM,
declare the main class and any arguments here and
add the JARs to the list below. -->
<!-- <property name="chain.main.class" value="com.example.MyApp"/> -->
<!-- <property name="chain.main.args" value="arg1 arg2"/> -->
<!-- INTERNAL_COMMENT
Use compressed Jars if available -->
<property name="jnlp.packEnabled" value="@PACKENABLED@"/>
@ -95,6 +106,11 @@
<jar href="lib/bundle/log4j.jar" />
<jar href="lib/bundle/commons-logging.jar" />
@COMMON@
<!-- here, add any other JARs that are needed for
a chained main class or any other purpose -->
<!-- <jar href="com.example.foo.jar" /> -->
</resources>
<application-desc main-class="net.java.sip.communicator.launcher.SIPCommunicatorJWS"/>

Loading…
Cancel
Save