make it possible to build without knowing the GCM sender ID.

This commit is contained in:
Eric House 2012-11-22 08:13:06 -08:00
parent daf5a89a0e
commit 0bea58b128
3 changed files with 5 additions and 3 deletions

View file

@ -61,6 +61,7 @@
</exec>
<exec dir="." executable="../scripts/gen_gcmid.sh"
output="src/org/eehouse/android/xw4/GCMConsts.java"
logError="true"
/>
<exec dir=".." executable="./scripts/genvers.sh" output="ant_out.txt">
<arg value="XWords4"/>

View file

@ -74,7 +74,7 @@ public class GCMIntentService extends GCMBaseIntentService {
public static void init( Application app )
{
int sdkVersion = Integer.valueOf( android.os.Build.VERSION.SDK );
if ( 8 <= sdkVersion ) {
if ( 8 <= sdkVersion && 0 < GCMConsts.SENDER_ID.length() ) {
try {
GCMRegistrar.checkDevice( app );
// GCMRegistrar.checkManifest( app );

View file

@ -1,8 +1,9 @@
#!/bin/sh
set -e -u
if [ -z "$GCM_SENDER_ID" ]; then
echo "GCM_SENDER_ID not in env"
exit 1
echo "GCM_SENDER_ID empty; GCM use will be disabled" >&2
fi
cat <<EOF