Permalink
Browse files

building jingle code too

  • Loading branch information...
Nikita Kozlov
Nikita Kozlov committed Jun 5, 2012
1 parent 6377342 commit 3595a8f172be26658b9adbf214792ca8581c863c
Showing with 4,235 additions and 6 deletions.
  1. +23 −5 build.bash
  2. +2 −1 build.xml
  3. +171 −0 jingle/60-jingle-ext.patch
  4. +4,039 −0 jingle/60-remove-jingle_mediaimpl.patch
  5. BIN lib/jstun.jar
View
@@ -97,6 +97,9 @@ buildsrc() {
copyfolder "src/harmony" "build/src/trunk" "."
copyfolder "src/custom" "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() {
@@ -117,7 +120,7 @@ patchsrc() {
build() {
echo "## Step 30: compile"
- ant -Dbuild.all=true
+ ant -Dbuild.all=true $JINGLE_ARGS
if [ $? -ne 0 ]; then
exit
fi
@@ -127,13 +130,17 @@ buildcustom() {
for dir in `find patch -maxdepth 1 -mindepth 1 -type d`; do
buildsrc
patchsrc "patch"
+ if $BUILD_JINGLE ; then
+ patchsrc "jingle"
+ JINGLE_ARGS="-Djingle=lib/jstun.jar"
+ fi
patchsrc "${dir}"
- ant -Djar.suffix=`echo ${dir}|sed 's:patch/:-:'`
+ ant -Djar.suffix=`echo ${dir}|sed 's:patch/:-:'` $JINGLE_ARGS
done
}
parseopts() {
- while getopts r:b:duch OPTION "$@"; do
+ while getopts r:b:duchj OPTION "$@"; do
case $OPTION in
r)
SMACK_REPO="${OPTARG}"
@@ -144,15 +151,20 @@ parseopts() {
d)
set -x
;;
+ j)
+ BUILD_JINGLE=true
+ ;;
u)
UPDATE_REMOTE=false
;;
c)
BUILD_CUSTOM=true
;;
h)
- echo "$0 -d -u -r <repo> -b <branch>"
+ echo "$0 -d -c -u -j -r <repo> -b <branch>"
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 "-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"
@@ -198,18 +210,24 @@ SMACK_BRANCH=master
SMACK_LOCAL=false
UPDATE_REMOTE=true
BUILD_CUSTOM=false
+BUILD_JINGLE=false
+JINGLE_ARGS=""
SRC_DIR=$(pwd)/src
WD=$(pwd)
parseopts $@
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
copystaticsrc
testsmackgit
fetchall
buildsrc
patchsrc "patch"
+if $BUILD_JINGLE ; then
+ patchsrc "jingle"
+ JINGLE_ARGS="-Djingle=lib/jstun.jar"
+fi
build
if $BUILD_CUSTOM ; then
View
@@ -2,6 +2,7 @@
<property name="jar.suffix" value="" />
<property name="build.all" value="false" />
+<property name="jingle" value="" />
<property file="local.properties" />
<condition property="build-3">
@@ -80,7 +81,7 @@
target="1.6"
srcdir="build/src/trunk"
destdir="build/classes/trunk"
- bootclasspath="${sdk-location}/platforms/android-@{version}/android.jar"
+ bootclasspath="${sdk-location}/platforms/android-@{version}/android.jar:${jingle}"
debug="true"
debuglevel="source,lines"
/>
View
@@ -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
Oops, something went wrong.

0 comments on commit 3595a8f

Please sign in to comment.