forked from BelledonneCommunications/linphone-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deliver_sdk.sh
executable file
·172 lines (153 loc) · 6.17 KB
/
deliver_sdk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/bin/sh
copy()
{
todir="$2/`dirname $1`"
echo "Copying $1 to $2/$1"
mkdir -p $todir
cp -r $1 $todir
}
androidize()
{
D=$1
mkdir -p $D/gen
# Add sources to eclipse .classpath
cat > $D/.classpath <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="gen"/>
<classpathentry excluding="org/linphone/mediastream/MediastreamerActivity.java" kind="src" path="submodules/linphone/mediastreamer2/java/src"/>
<classpathentry kind="src" path="submodules/linphone/java/j2se"/>
<classpathentry kind="src" path="submodules/linphone/java/common"/>
<classpathentry kind="src" path="submodules/linphone/java/impl"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="lib" path="libs/aXMLRPC.jar"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
<classpathentry kind="lib" path="libs/gcm.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
EOF
# Fix package name
(
cd $D
grep -R "org.linphone.R" . -l | grep java | xargs sed -i 's/org\.linphone\.R/org\.linphone\.sdk\.R/g'
)
# Create a basic AndroidManifest.xml
cat > $D/AndroidManifest.xml <<EOF
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.linphone" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="4"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"></uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
<uses-permission android:name="android.permission.BOOT_COMPLETED"></uses-permission>
<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
<uses-permission android:name="android.permission.CAMERA" />
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>
<application>
<activity android:name="org.linphone.TestConferenceActivity"
android:label="Conf test"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.linphone.core.tutorials.TutorialHelloWorldActivity"
android:label="Hello World"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.linphone.core.tutorials.TutorialRegistrationActivity"
android:label="Registration"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.linphone.core.tutorials.TutorialBuddyStatusActivity"
android:label="Buddy status"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.linphone.core.tutorials.TutorialChatRoomActivity"
android:label="Chat Room"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.mediastreamer2.test.Ring"
android:label="Ring+Echo"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
EOF
cat > $D/default.properties <<EOF
target=`android list target -c | grep android | tail -n1`
EOF
mkdir -p $D/.settings
cat > $D/.settings/org.eclipse.jdt.core.prefs <<EOF
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
EOF
}
DBASE="liblinphone-android-sdk"
D="../$DBASE"
rm -rf $D.zip $D
copy submodules/linphone/coreapi/help/java $D
copy libs $D
copy submodules/linphone/java/j2se $D
copy submodules/linphone/java/common $D
copy submodules/linphone/java/impl $D
copy submodules/linphone/mediastreamer2/java/src $D
androidize $D
echo "Creating zip $D"
(
cd ..
zip -rq liblinphone-android-sdk.zip $DBASE
rm -rf $DBASE
)
DBASE="liblinphone-android-javadoc"
D="../$DBASE.zip"
if grep -r "javadoc.dir" local.properties
then
echo "javadoc.dir already defined"
else
echo "javadoc.dir=$DBASE" >> local.properties
fi
echo "Generating javadoc to $D"
ant javadoc
rm -rf $D
zip -rq $D $DBASE
rm -rf $DBASE