Skip to content
This repository has been archived by the owner on Apr 4, 2021. It is now read-only.

Commit

Permalink
building jingle code too
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Kozlov committed Jun 5, 2012
1 parent 6377342 commit 3595a8f
Show file tree
Hide file tree
Showing 5 changed files with 4,235 additions and 6 deletions.
28 changes: 23 additions & 5 deletions build.bash
Expand Up @@ -97,6 +97,9 @@ buildsrc() {
copyfolder "src/harmony" "build/src/trunk" "." copyfolder "src/harmony" "build/src/trunk" "."
copyfolder "src/custom" "build/src/trunk" "." copyfolder "src/custom" "build/src/trunk" "."
copyfolder "src/jbosh/src/main/java" "build/src/trunk" "." copyfolder "src/jbosh/src/main/java" "build/src/trunk" "."
if $BUILD_JINGLE ; then
copyfolder "src/smack/jingle/extension/source/" "build/src/trunk" "."
fi
} }


patchsrc() { patchsrc() {
Expand All @@ -117,7 +120,7 @@ patchsrc() {


build() { build() {
echo "## Step 30: compile" echo "## Step 30: compile"
ant -Dbuild.all=true ant -Dbuild.all=true $JINGLE_ARGS
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit exit
fi fi
Expand All @@ -127,13 +130,17 @@ buildcustom() {
for dir in `find patch -maxdepth 1 -mindepth 1 -type d`; do for dir in `find patch -maxdepth 1 -mindepth 1 -type d`; do
buildsrc buildsrc
patchsrc "patch" patchsrc "patch"
if $BUILD_JINGLE ; then
patchsrc "jingle"
JINGLE_ARGS="-Djingle=lib/jstun.jar"
fi
patchsrc "${dir}" patchsrc "${dir}"
ant -Djar.suffix=`echo ${dir}|sed 's:patch/:-:'` ant -Djar.suffix=`echo ${dir}|sed 's:patch/:-:'` $JINGLE_ARGS
done done
} }


parseopts() { parseopts() {
while getopts r:b:duch OPTION "$@"; do while getopts r:b:duchj OPTION "$@"; do
case $OPTION in case $OPTION in
r) r)
SMACK_REPO="${OPTARG}" SMACK_REPO="${OPTARG}"
Expand All @@ -144,15 +151,20 @@ parseopts() {
d) d)
set -x set -x
;; ;;
j)
BUILD_JINGLE=true
;;
u) u)
UPDATE_REMOTE=false UPDATE_REMOTE=false
;; ;;
c) c)
BUILD_CUSTOM=true BUILD_CUSTOM=true
;; ;;
h) h)
echo "$0 -d -u -r <repo> -b <branch>" echo "$0 -d -c -u -j -r <repo> -b <branch>"
echo "-d: Enable debug" echo "-d: Enable debug"
echo "-j: Build jingle code"
echo "-c: Apply custom patchs from patch directory"
echo "-u: DON'T update remote third party resources" echo "-u: DON'T update remote third party resources"
echo "-r <repo>: Git repository (can be local or remote) for underlying smack repository" echo "-r <repo>: Git repository (can be local or remote) for underlying smack repository"
echo "-b <branch>: Git branch used to build aSmack from underlying smack repository" echo "-b <branch>: Git branch used to build aSmack from underlying smack repository"
Expand Down Expand Up @@ -198,18 +210,24 @@ SMACK_BRANCH=master
SMACK_LOCAL=false SMACK_LOCAL=false
UPDATE_REMOTE=true UPDATE_REMOTE=true
BUILD_CUSTOM=false BUILD_CUSTOM=false
BUILD_JINGLE=false
JINGLE_ARGS=""
SRC_DIR=$(pwd)/src SRC_DIR=$(pwd)/src
WD=$(pwd) WD=$(pwd)


parseopts $@ parseopts $@
echo "Using Smack git repository $SMACK_REPO with branch $SMACK_BRANCH" echo "Using Smack git repository $SMACK_REPO with branch $SMACK_BRANCH"
echo "SMACK_LOCAL: $SMACK_LOCAL UPDATE_REMOTE: $UPDATE_REMOTE BUILD_CUSTOM: $BUILD_CUSTOM" echo "SMACK_LOCAL: $SMACK_LOCAL UPDATE_REMOTE: $UPDATE_REMOTE BUILD_CUSTOM: $BUILD_CUSTOM BUILD_JINGLE: $BUILD_JINGLE"
initialize initialize
copystaticsrc copystaticsrc
testsmackgit testsmackgit
fetchall fetchall
buildsrc buildsrc
patchsrc "patch" patchsrc "patch"
if $BUILD_JINGLE ; then
patchsrc "jingle"
JINGLE_ARGS="-Djingle=lib/jstun.jar"
fi
build build


if $BUILD_CUSTOM ; then if $BUILD_CUSTOM ; then
Expand Down
3 changes: 2 additions & 1 deletion build.xml
Expand Up @@ -2,6 +2,7 @@


<property name="jar.suffix" value="" /> <property name="jar.suffix" value="" />
<property name="build.all" value="false" /> <property name="build.all" value="false" />
<property name="jingle" value="" />
<property file="local.properties" /> <property file="local.properties" />


<condition property="build-3"> <condition property="build-3">
Expand Down Expand Up @@ -80,7 +81,7 @@
target="1.6" target="1.6"
srcdir="build/src/trunk" srcdir="build/src/trunk"
destdir="build/classes/trunk" destdir="build/classes/trunk"
bootclasspath="${sdk-location}/platforms/android-@{version}/android.jar" bootclasspath="${sdk-location}/platforms/android-@{version}/android.jar:${jingle}"
debug="true" debug="true"
debuglevel="source,lines" debuglevel="source,lines"
/> />
Expand Down
171 changes: 171 additions & 0 deletions jingle/60-jingle-ext.patch
@@ -0,0 +1,171 @@
Index: org/jivesoftware/smackx/packet/JingleContentInfo.java
===================================================================
--- org/jivesoftware/smackx/packet/JingleContentInfo.java (revision 11644)
+++ org/jivesoftware/smackx/packet/JingleContentInfo.java (working copy)
@@ -96,7 +96,7 @@
*/
public static class Audio extends JingleContentInfo {

- public static final String NAMESPACE = "urn:xmpp:tmp:jingle:apps:rtp";
+ public static final String NAMESPACE = "urn:xmpp:jingle:apps:rtp:1";

public Audio(final ContentInfo mi) {
super(mi);
Index: org/jivesoftware/smackx/packet/JingleError.java
===================================================================
--- org/jivesoftware/smackx/packet/JingleError.java (revision 11644)
+++ org/jivesoftware/smackx/packet/JingleError.java (working copy)
@@ -27,7 +27,7 @@

public class JingleError implements PacketExtension {

- public static String NAMESPACE = "urn:xmpp:tmp:jingle:errors";
+ public static String NAMESPACE = "urn:xmpp:jingle:errors:1";

public static final JingleError OUT_OF_ORDER = new JingleError("out-of-order");

Index: org/jivesoftware/smackx/packet/JingleTransport.java
===================================================================
--- org/jivesoftware/smackx/packet/JingleTransport.java (revision 11644)
+++ org/jivesoftware/smackx/packet/JingleTransport.java (working copy)
@@ -270,7 +270,7 @@
* RTP-ICE profile
*/
public static class Ice extends JingleTransport {
- public static final String NAMESPACE = "urn:xmpp:tmp:jingle:transports:ice-udp";
+ public static final String NAMESPACE = "urn:xmpp:jingle:transports:ice-udp:1";

public Ice() {
super();
@@ -352,7 +352,7 @@
* Raw UDP profile.
*/
public static class RawUdp extends JingleTransport {
- public static final String NAMESPACE = "http://www.xmpp.org/extensions/xep-0177.html#ns";
+ public static final String NAMESPACE = "urn:xmpp:jingle:transports:raw-udp:1";

public RawUdp() {
super();
Index: org/jivesoftware/smackx/packet/JingleContentDescription.java
===================================================================
--- org/jivesoftware/smackx/packet/JingleContentDescription.java (revision 11644)
+++ org/jivesoftware/smackx/packet/JingleContentDescription.java (working copy)
@@ -66,6 +66,13 @@
public abstract String getNamespace();

/**
+ * Return the media type.
+ *
+ * @return The media type
+ */
+ public abstract String getMediaType();
+
+ /**
* Adds a audio payload type to the packet.
*
* @param pt the audio payload type to add.
@@ -153,7 +160,8 @@
synchronized (payloads) {
if (payloads.size() > 0) {
buf.append("<").append(getElementName());
- buf.append(" xmlns=\"").append(getNamespace()).append("\" >");
+ buf.append(" xmlns=\"").append(getNamespace()).append("\"");
+ buf.append(" media=\"").append(getMediaType()).append("\" >");

Iterator pt = payloads.listIterator();
while (pt.hasNext()) {
@@ -172,7 +180,8 @@
*/
public static class Audio extends JingleContentDescription {

- public static final String NAMESPACE = "urn:xmpp:tmp:jingle:apps:rtp";
+ public static final String NAMESPACE = "urn:xmpp:jingle:apps:rtp:1";
+ public static final String MEDIA_TYPE = "audio";

public Audio() {
super();
@@ -189,6 +198,10 @@
public String getNamespace() {
return NAMESPACE;
}
+
+ public String getMediaType() {
+ return MEDIA_TYPE;
+ }
}

/**
Index: org/jivesoftware/smackx/packet/Jingle.java
===================================================================
--- org/jivesoftware/smackx/packet/Jingle.java (revision 11644)
+++ org/jivesoftware/smackx/packet/Jingle.java (working copy)
@@ -44,7 +44,7 @@

// static

- public static final String NAMESPACE = "urn:xmpp:tmp:jingle";
+ public static final String NAMESPACE = "urn:xmpp:jingle:1";

public static final String NODENAME = "jingle";

Index: org/jivesoftware/smackx/packet/JingleDescription.java
===================================================================
--- org/jivesoftware/smackx/packet/JingleDescription.java (revision 11644)
+++ org/jivesoftware/smackx/packet/JingleDescription.java (working copy)
@@ -69,6 +69,13 @@
public abstract String getNamespace();

/**
+ * Return the media type.
+ *
+ * @return The media type
+ */
+ public abstract String getMediaType();
+
+ /**
* Adds a audio payload type to the packet.
*
* @param pt the audio payload type to add.
@@ -160,7 +167,8 @@
synchronized (payloads) {
if (payloads.size() > 0) {
buf.append("<").append(getElementName());
- buf.append(" xmlns=\"").append(getNamespace()).append("\" >");
+ buf.append(" xmlns=\"").append(getNamespace()).append("\"");
+ buf.append(" media=\"").append(getMediaType()).append("\" >");

for (PayloadType payloadType : payloads) {
if (payloadType != null) {
@@ -179,7 +187,8 @@
*/
public static class Audio extends JingleDescription {

- public static final String NAMESPACE = "urn:xmpp:tmp:jingle:apps:rtp";
+ public static final String NAMESPACE = "urn:xmpp:jingle:apps:rtp:1";
+ public static final String MEDIA_TYPE = "audio";

public Audio() {
super();
@@ -196,5 +205,9 @@
public String getNamespace() {
return NAMESPACE;
}
+
+ public String getMediaType() {
+ return MEDIA_TYPE;
+ }
}
}
Index: org/jivesoftware/smackx/jingle/JingleManager.java
===================================================================
--- org/jivesoftware/smackx/jingle/JingleManager.java (revision 11644)
+++ org/jivesoftware/smackx/jingle/JingleManager.java (working copy)
@@ -255,7 +255,7 @@
*/
public static void setJingleServiceEnabled() {
ProviderManager providerManager = ProviderManager.getInstance();
- providerManager.addIQProvider("jingle", "urn:xmpp:tmp:jingle", new JingleProvider());
+ providerManager.addIQProvider("jingle", "urn:xmpp:jingle:1", new JingleProvider());

// Enable the Jingle support on every established connection
// The ServiceDiscoveryManager class should have been already

0 comments on commit 3595a8f

Please sign in to comment.