If you are looking for Jitsi Meet, the WebRTC compatible video conferencing product click here.

previous | TOC | next

How to write GUI plugins

Compile and run a plugin

In order to compile and run your plugin you must add the appropriate target in the build.xml file. This is the list of all bundles that exist in Jitsi.

In your bundle target you should specify the name of the created jar file and where to find the source of the bundle. Follow the example below to make your own target.

Note: A target is a wrapper for a sequence of actions. If you want to learn more see the ant tutorial. Note: Put your target in the end of the build.xml file, after the last target.

<!-- BUNDLE-PLUGIN-EXAMPLE PLUGIN -->
    <target name="bundle-plugin-exampleplugin">
        <!-- Creates a bundle for the plugin SIP Account Registration Wizard.-->
        <jar compress="false" destfile="${bundles.dest}/exampleplugin.jar"
            manifest="${src}/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf">

            <zipfileset dir="${dest}/net/java/sip/communicator/plugin/exampleplugin"
                prefix="net/java/sip/communicator/plugin/exampleplugin"/>

        </jar>
    </target>

Now to make your new target to be used copy the name of your target and put it in the list of targets that are in the depends attribute of the bundles target. This means that each time when the bundles target is invoked your target will be invoked. This is the list of all the bundles that will actually be compiled on build.

Note: The actual list you see here will be considerably longer.

<!--ALL BUNDLES-->
     <target name="bundles"
         depends="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,
                 bundle-slick-runner,bundle-sip,bundle-sip-slick,bundle-fileaccess,
                 bundle-fileaccess-slick,bundle-media,bundle-media-slick,
                 bundle-protocol,bundle-icq,bundle-icq-slick,bundle-mock,
                 bundle-jabber,bundle-jabber-slick,bundle-swing-ui,
                 bundle-msn,bundle-msn-slick,
                 bundle-contactlist,meta-contactlist,meta-contactlist-slick,
                 bundle-plugin-icqaccregwizz,bundle-plugin-jabberaccregwizz,
                 bundle-plugin-msnaccregwizz,bundle-plugin-sipaccregwizz,
                 bundle-version,bundle-version-impl,bundle-shutdown,
                 bundle-growlnotification,bundle-example-plugin"
/>

Once finished with this you could compile your code by running ant rebuild. If everything is done correctly you should see the following line in the console:

bundle-example-plugin:

[jar] Building jar: /projecthomedir/sip-communicator/sc-bundles/exampleplugin.jar

This finishes the compilation part. Now to run your plugin in the project you should do one more thing, add your jar in the felix.client.run.properties file. You could find it in the lib directory of the project. Your jar should appear at the end of the felix.auto.start.67 list. Note that back slashes should be exactly one space after the jar definition, and that the last line does not get a trailing back slash.

Note: The actual list you see here will be considerably longer.

felix.auto.start.67= \
 reference:file:sc-bundles/accountinfo.jar \
 reference:file:sc-bundles/chatalerter.jar \
 reference:file:sc-bundles/shutdown.jar \
 reference:file:sc-bundles/autoaway.jar \
 reference:file:sc-bundles/keybindingChooser.jar \
 reference:file:sc-bundles/generalconfig.jar \
 reference:file:sc-bundles/dictaccregwizz.jar \
 reference:file:sc-bundles/exampleplugin.jar

previous | TOC | next