Commit d195e1ce authored by Jochen Sprickerhof's avatar Jochen Sprickerhof Committed by John David Taylor

Add F-Droid build flavor (Closes #128) (#162)

* Move getSafeNameForSensor to StardroidApplication

It's only used there and allows use to make Analytics an interface
later.

* Cleanup build script

- Add -e to error on build failures.
- Use subshell instead of cd ..
- Manually fix classpath because gradle has problems with flavors

* Extract Analytics.java content into an interface

* Add AbstractGooglePlayServicesChecker.java

This adds an abstract class for the gms independent parts of
GooglePlayServicesChecker.java.

* Add support-v4 compile dependency

This is used in GooglePlayServicesChecker.java

* Add AbstractDynamicStarMapModule.java

This adds a base class for the gms independent parts of
DynamicStarMapModule.java.

* Separate build flavors for gms and fdroid

This adds two build flavors. One using gms (analytics and location) and
one without for F-Droid. All classes using gms are moved to the flavor
source path and a version without gms is added or the fdroid flavor.
parent cb560fb1
......@@ -46,4 +46,4 @@ before_script:
- android-wait-for-emulator
script:
- ./gradlew app:connectedAndroidTest -PdisablePreDex
\ No newline at end of file
- ./gradlew app:connectedGmsDebugAndroidTest -PdisablePreDex
......@@ -45,7 +45,7 @@ The apk can be found in `app/build/outputs/apk/`.
## Running tests
./gradlew app:connectedAndroidTest
./gradlew app:connectedGmsDebugAndroidTest
## Regenerating the star data files
......
......@@ -52,14 +52,27 @@ android {
timeOutInMs 10 * 60 * 1000 // 10 minutes
installOptions "-d", "-t"
}
productFlavors {
// includes gms Google servies
gms {
resValue "string", "analytics_enabled", "true"
}
// uses only open source software
fdroid {
resValue "string", "analytics_enabled", "false"
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-annotations:23.2.1'
compile 'com.google.guava:guava:19.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
gmsCompile 'com.google.android.gms:play-services-analytics:8.4.0'
gmsCompile 'com.google.android.gms:play-services-location:8.4.0'
compile "com.android.support:support-v4:24.0.0"
compile 'com.google.dagger:dagger:2.0.2'
provided 'javax.annotation:jsr250-api:1.0' // For annotations not in Android but needed by Dagger
apt 'com.google.dagger:dagger-compiler:2.0.2'
......
package com.google.android.stardroid.activities;
import com.google.android.stardroid.inject.PerActivity;
import dagger.Module;
import dagger.Provides;
/**
* Dagger module
* Created by johntaylor on 3/29/16.
*/
@Module
public class DynamicStarMapModule extends AbstractDynamicStarMapModule {
public DynamicStarMapModule(DynamicStarMapActivity activity) {
super(activity);
}
}
package com.google.android.stardroid.activities.util;
import android.app.Activity;
import android.app.FragmentManager;
import android.content.SharedPreferences;
import android.util.Log;
import com.google.android.stardroid.activities.dialogs.LocationPermissionRationaleFragment;
import com.google.android.stardroid.control.LocationController;
import javax.inject.Inject;
/**
* Created by johntaylor on 4/2/16.
*/
public class GooglePlayServicesChecker extends AbstractGooglePlayServicesChecker {
@Inject
GooglePlayServicesChecker(Activity parent, SharedPreferences preferences,
LocationPermissionRationaleFragment rationaleDialog,
FragmentManager fragmentManager) {
super(parent, preferences, rationaleDialog, fragmentManager);
}
/**
* Checks whether play services is available and up to date and prompts the user
* if necessary.
* <p/>
* Note that at present we only need it for location services so if the user is setting
* their location manually we don't do the check.
*/
public void maybeCheckForGooglePlayServices() {
Log.d(TAG, "Google Play Services check");
if (preferences.getBoolean(LocationController.NO_AUTO_LOCATE, false)) {
Log.d(TAG, "Auto location disabled - not checking for GMS");
return;
}
super.checkLocationServicesEnabled();
}
}
// Copyright 2010 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.android.stardroid.util;
import com.google.android.stardroid.StardroidApplication;
import javax.inject.Inject;
/**
* Encapsulates interactions with Google Analytics, allowing it to be
* disabled etc.
*
* @author John Taylor
*/
public class Analytics implements AnalyticsInterface {
@Inject
Analytics(StardroidApplication application) { }
public void setEnabled(boolean enabled) { }
/**
* Tracks a screen view.
*/
public void trackPageView(String page) { }
/**
* Tracks and event.
*
* @see com.google.android.gms.analytics.HitBuilders.EventBuilder
*/
public void trackEvent(String category, String action, String label, long value) { }
/**
* Sets custom variables for slicing.
*/
public void setCustomVar(Slice slice, String value) { }
}
package com.google.android.stardroid.activities;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.stardroid.inject.PerActivity;
import dagger.Module;
import dagger.Provides;
/**
* Dagger module
* Created by johntaylor on 3/29/16.
*/
@Module
public class DynamicStarMapModule extends AbstractDynamicStarMapModule {
public DynamicStarMapModule(DynamicStarMapActivity activity) {
super(activity);
}
@Provides
@PerActivity
GoogleApiAvailability providePlayServicesApiAvailability() {
return GoogleApiAvailability.getInstance();
}
}
package com.google.android.stardroid.activities.util;
import android.app.Activity;
import android.app.FragmentManager;
import android.content.SharedPreferences;
import android.util.Log;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.stardroid.R;
import com.google.android.stardroid.activities.DynamicStarMapActivity;
import com.google.android.stardroid.activities.dialogs.LocationPermissionRationaleFragment;
import com.google.android.stardroid.control.LocationController;
import javax.inject.Inject;
/**
* Created by johntaylor on 4/2/16.
*/
public class GooglePlayServicesChecker extends AbstractGooglePlayServicesChecker {
private final GoogleApiAvailability apiAvailability;
@Inject
GooglePlayServicesChecker(Activity parent, SharedPreferences preferences,
GoogleApiAvailability apiAvailability,
LocationPermissionRationaleFragment rationaleDialog,
FragmentManager fragmentManager) {
super(parent, preferences, rationaleDialog, fragmentManager);
this.apiAvailability = apiAvailability;
}
/**
* Checks whether play services is available and up to date and prompts the user
* if necessary.
* <p/>
* Note that at present we only need it for location services so if the user is setting
* their location manually we don't do the check.
*/
public void maybeCheckForGooglePlayServices() {
Log.d(TAG, "Google Play Services check");
if (preferences.getBoolean(LocationController.NO_AUTO_LOCATE, false)) {
Log.d(TAG, "Auto location disabled - not checking for GMS");
return;
}
int googlePlayServicesAvailability = apiAvailability.isGooglePlayServicesAvailable(parent);
if (googlePlayServicesAvailability == ConnectionResult.SUCCESS) {
Log.d(TAG, "Google Play Services is available and up to date");
} else {
Log.d(TAG, "Google Play Status availability: " + googlePlayServicesAvailability);
if (apiAvailability.isUserResolvableError(googlePlayServicesAvailability)) {
Log.d(TAG, "...but we can fix it");
apiAvailability.getErrorDialog(parent, googlePlayServicesAvailability,
DynamicStarMapActivity.GOOGLE_PLAY_SERVICES_REQUEST_CODE).show();
} else {
Log.d(TAG, "...and we can't fix it");
// For now just warn the user, though we may need to do something like disable
// auto location.
Toast.makeText(parent, R.string.play_services_error, Toast.LENGTH_LONG).show();
}
}
super.checkLocationServicesEnabled();
}
}
......@@ -14,8 +14,6 @@
package com.google.android.stardroid.util;
import android.hardware.Sensor;
import android.os.Build;
import android.util.Log;
import com.google.android.gms.analytics.GoogleAnalytics;
......@@ -33,13 +31,12 @@ import javax.inject.Inject;
*
* @author John Taylor
*/
public class Analytics {
public class Analytics implements AnalyticsInterface {
/**
* Analytics ID associated with http://stardroid-server.appspot.com
*/
private static final String WEB_PROPERTY_ID = BuildConfig.GOOGLE_ANALYTICS_CODE;
private static final int DISPATCH_INTERVAL_SECS = 10;
public static final String PREF_KEY = "enable_analytics";
private static volatile Analytics instance;
private final HitBuilders.ScreenViewBuilder screenViewBuilder = new HitBuilders.ScreenViewBuilder();
private final HitBuilders.EventBuilder eventBuilder = new HitBuilders.EventBuilder();
......@@ -47,73 +44,6 @@ public class Analytics {
private Tracker tracker;
private static final String TAG = MiscUtil.getTag(Analytics.class);
/**
* Returns either the name of the sensor or a string version of the sensor type id, depending
* on the supported OS level along with some context.
*/
public static String getSafeNameForSensor(Sensor sensor) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
return "Sensor type: " + sensor.getStringType() + ": " + sensor.getType();
} else {
return "Sensor type: " + sensor.getType();
}
}
/**
* Custom vars (for slicing and dicing)
* At most 5 can be defined.
*/
public static enum Slice {
ANDROID_OS, SKYMAP_VERSION, DEVICE_NAME, NEW_USER;
}
// Page Views
public static final String APPLICATION_CREATE = "/ApplicationCreate";
public static final String COMPASS_CALIBRATION_ACTIVITY = "/MainPage/Calibration";
public static final String DIAGNOSTICS_ACTIVITY = "/MainPage/Diagnostics";
public static final String DYNAMIC_STARMAP_ACTIVITY = "/MainPage";
public static final String EDIT_SETTINGS_ACTIVITY = "/MainPage/EditSettings";
public static final String SPLASH_SCREEN_ACTIVITY = "/SplashScreen";
public static final String IMAGE_GALLERY_ACTIVITY = "/MainPage/ImageGallery";
public static final String IMAGE_DISPLAY_ACTIVITY = "/MainPage/ImageGallery/ImageDisplay";
// Events & Categories
public static final String TOS_ACCEPT = "Terms Of Service";
public static final String APP_CATEGORY = "Application";
public static final String TOS_ACCEPTED = "TOS Accepted";
public static final String TOS_REJECTED = "TOS Rejected";
public static final String INSTALL_CATEGORY = "Installation";
public static final String INSTALL_EVENT = "Installed Version: ";
public static final String PREVIOUS_VERSION = "Prevous Version: ";
public static final String PREFERENCE_TOGGLE = "Preference toggled";
public static final String PREFERENCE_BUTTON_TOGGLE = "Preference button toggled";
public static final String USER_ACTION_CATEGORY = "User Action";
public static final String TOGGLED_MANUAL_MODE_LABEL = "Toggled Manual Mode";
public static final String MENU_ITEM = "Pressed Menu Item";
public static final String TOGGLED_NIGHT_MODE_LABEL = "Toggled Night Mode";
public static final String SEARCH_REQUESTED_LABEL = "Search Requested";
public static final String SETTINGS_OPENED_LABEL = "Settings Opened";
public static final String HELP_OPENED_LABEL = "Help Opened";
public static final String CALIBRATION_OPENED_LABEL = "Calibration Opened";
public static final String TIME_TRAVEL_OPENED_LABEL = "Time Travel Opened";
public static final String GALLERY_OPENED_LABEL = "Gallery Opened";
public static final String TOS_OPENED_LABEL = "TOS Opened";
public static final String DIAGNOSTICS_OPENED_LABEL = "Diagnostics Opened";
public static final String SEARCH = "Search";
public static final String GENERAL_CATEGORY = "General";
public static final String START_HOUR = "Start up hour";
public static final String SENSOR_CATEGORY = "Sensors";
public static final String SESSION_LENGTH_BUCKET = "Session length bucket";
public static final String SENSOR_AVAILABILITY = "Minimal Sensor Availability";
public static final String ROT_SENSOR_AVAILABILITY = "Rotation Sensor Availability";
public static final String SENSOR_TYPE = "Sensor Type - ";
public static final String SENSOR_NAME = "Sensor Name";
public static final String HIGH_SENSOR_ACCURACY_ACHIEVED = "High Accuracy Achieved";
public static final String SENSOR_ACCURACY_CHANGED = "Sensor Accuracy Changed";
// Phone claims to have a sensor, but then doesn't allow registration of a listener.
public static final String SENSOR_LIAR = "Sensor Liar!";
@Inject
Analytics(StardroidApplication application) {
googleAnalytics = GoogleAnalytics.getInstance(application);
......
......@@ -28,7 +28,7 @@ import android.util.Log;
import com.google.android.stardroid.layers.LayerManager;
import com.google.android.stardroid.util.Analytics;
import com.google.android.stardroid.util.Analytics.Slice;
import com.google.android.stardroid.util.AnalyticsInterface.Slice;
import com.google.android.stardroid.util.MiscUtil;
import com.google.android.stardroid.util.PreferenceChangeAnalyticsTracker;
import com.google.android.stardroid.views.PreferencesButton;
......@@ -186,6 +186,18 @@ public class StardroidApplication extends Application {
backgroundExecutor.submit(runnable);
}
/**
* Returns either the name of the sensor or a string version of the sensor type id, depending
* on the supported OS level along with some context.
*/
public static String getSafeNameForSensor(Sensor sensor) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
return "Sensor type: " + sensor.getStringType() + ": " + sensor.getType();
} else {
return "Sensor type: " + sensor.getType();
}
}
/**
* Check what features are available to this phone and report back to analytics
* so we can judge when to add/drop support.
......@@ -273,7 +285,7 @@ public class StardroidApplication extends Application {
Set<String> sensorTypes = new HashSet<>();
for (Sensor sensor : allSensors) {
Log.i(TAG, sensor.getName());
sensorTypes.add(Analytics.getSafeNameForSensor(sensor));
sensorTypes.add(getSafeNameForSensor(sensor));
}
Log.d(TAG, "All sensors summary:");
for (String sensorType : sensorTypes) {
......@@ -306,7 +318,7 @@ public class StardroidApplication extends Application {
dummy, sensor, SensorManager.SENSOR_DELAY_UI);
if (!success) {
analytics.trackEvent(
Analytics.SENSOR_CATEGORY, Analytics.SENSOR_LIAR, Analytics.getSafeNameForSensor(sensor),
Analytics.SENSOR_CATEGORY, Analytics.SENSOR_LIAR, getSafeNameForSensor(sensor),
1);
}
sensorManager.unregisterListener(dummy);
......
......@@ -9,7 +9,6 @@ import android.util.Log;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.stardroid.R;
import com.google.android.stardroid.activities.dialogs.EulaDialogFragment;
import com.google.android.stardroid.activities.dialogs.HelpDialogFragment;
......@@ -31,11 +30,11 @@ import dagger.Provides;
* Created by johntaylor on 3/29/16.
*/
@Module
public class DynamicStarMapModule {
public class AbstractDynamicStarMapModule {
private static final String TAG = MiscUtil.getTag(DynamicStarMapModule.class);
private DynamicStarMapActivity activity;
public DynamicStarMapModule(DynamicStarMapActivity activity) {
public AbstractDynamicStarMapModule(DynamicStarMapActivity activity) {
Log.d(TAG, "Creating activity module for " + activity);
this.activity = activity;
}
......@@ -132,11 +131,4 @@ public class DynamicStarMapModule {
LocationPermissionRationaleFragment provideLocationFragment() {
return new LocationPermissionRationaleFragment();
}
@Provides
@PerActivity
GoogleApiAvailability providePlayServicesApiAvailability() {
return GoogleApiAvailability.getInstance();
}
}
......@@ -9,35 +9,27 @@ import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.stardroid.R;
import com.google.android.stardroid.activities.DynamicStarMapActivity;
import com.google.android.stardroid.activities.dialogs.LocationPermissionRationaleFragment;
import com.google.android.stardroid.control.LocationController;
import com.google.android.stardroid.util.MiscUtil;
import javax.inject.Inject;
/**
* Created by johntaylor on 4/2/16.
*/
public class GooglePlayServicesChecker implements LocationPermissionRationaleFragment.Callback {
private static final String TAG = MiscUtil.getTag(GooglePlayServicesChecker.class);
private final Activity parent;
private final SharedPreferences preferences;
private final GoogleApiAvailability apiAvailability;
public abstract class AbstractGooglePlayServicesChecker implements LocationPermissionRationaleFragment.Callback {
protected static final String TAG = MiscUtil.getTag(GooglePlayServicesChecker.class);
protected final Activity parent;
protected final SharedPreferences preferences;
private final LocationPermissionRationaleFragment rationaleDialog;
private final FragmentManager fragmentManager;
@Inject
GooglePlayServicesChecker(Activity parent, SharedPreferences preferences,
GoogleApiAvailability apiAvailability,
AbstractGooglePlayServicesChecker(Activity parent, SharedPreferences preferences,
LocationPermissionRationaleFragment rationaleDialog,
FragmentManager fragmentManager) {
this.parent = parent;
this.preferences = preferences;
this.apiAvailability = apiAvailability;
this.rationaleDialog = rationaleDialog;
this.fragmentManager = fragmentManager;
rationaleDialog.setCallback(this);
......@@ -50,32 +42,9 @@ public class GooglePlayServicesChecker implements LocationPermissionRationaleFra
* Note that at present we only need it for location services so if the user is setting
* their location manually we don't do the check.
*/
public void maybeCheckForGooglePlayServices() {
Log.d(TAG, "Google Play Services check");
if (preferences.getBoolean(LocationController.NO_AUTO_LOCATE, false)) {
Log.d(TAG, "Auto location disabled - not checking for GMS");
return;
}
int googlePlayServicesAvailability = apiAvailability.isGooglePlayServicesAvailable(parent);
if (googlePlayServicesAvailability == ConnectionResult.SUCCESS) {
Log.d(TAG, "Google Play Services is available and up to date");
} else {
Log.d(TAG, "Google Play Status availability: " + googlePlayServicesAvailability);
if (apiAvailability.isUserResolvableError(googlePlayServicesAvailability)) {
Log.d(TAG, "...but we can fix it");
apiAvailability.getErrorDialog(parent, googlePlayServicesAvailability,
DynamicStarMapActivity.GOOGLE_PLAY_SERVICES_REQUEST_CODE).show();
} else {
Log.d(TAG, "...and we can't fix it");
// For now just warn the user, though we may need to do something like disable
// auto location.
Toast.makeText(parent, R.string.play_services_error, Toast.LENGTH_LONG).show();
}
}
checkLocationServicesEnabled();
}
public abstract void maybeCheckForGooglePlayServices();
private void checkLocationServicesEnabled() {
protected void checkLocationServicesEnabled() {
if (ActivityCompat.checkSelfPermission(parent, Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
Log.d(TAG, "Location permission not enabled - maybe prompting user");
......
// Copyright 2010 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.android.stardroid.util;
import com.google.android.stardroid.StardroidApplication;
import javax.inject.Inject;
/**
* Encapsulates interactions with Google Analytics, allowing it to be
* disabled etc.
*
* @author John Taylor
*/
public interface AnalyticsInterface {
static final String PREF_KEY = "enable_analytics";
/**
* Custom vars (for slicing and dicing)
* At most 5 can be defined.
*/
static enum Slice {
ANDROID_OS, SKYMAP_VERSION, DEVICE_NAME, NEW_USER;
}
// Page Views
static final String APPLICATION_CREATE = "/ApplicationCreate";
static final String COMPASS_CALIBRATION_ACTIVITY = "/MainPage/Calibration";
static final String DIAGNOSTICS_ACTIVITY = "/MainPage/Diagnostics";
static final String DYNAMIC_STARMAP_ACTIVITY = "/MainPage";
static final String EDIT_SETTINGS_ACTIVITY = "/MainPage/EditSettings";
static final String SPLASH_SCREEN_ACTIVITY = "/SplashScreen";
static final String IMAGE_GALLERY_ACTIVITY = "/MainPage/ImageGallery";
static final String IMAGE_DISPLAY_ACTIVITY = "/MainPage/ImageGallery/ImageDisplay";
// Events & Categories
static final String TOS_ACCEPT = "Terms Of Service";
static final String APP_CATEGORY = "Application";
static final String TOS_ACCEPTED = "TOS Accepted";
static final String TOS_REJECTED = "TOS Rejected";
static final String INSTALL_CATEGORY = "Installation";
static final String INSTALL_EVENT = "Installed Version: ";
static final String PREVIOUS_VERSION = "Prevous Version: ";
static final String PREFERENCE_TOGGLE = "Preference toggled";
static final String PREFERENCE_BUTTON_TOGGLE = "Preference button toggled";
static final String USER_ACTION_CATEGORY = "User Action";
static final String TOGGLED_MANUAL_MODE_LABEL = "Toggled Manual Mode";
static final String MENU_ITEM = "Pressed Menu Item";
static final String TOGGLED_NIGHT_MODE_LABEL = "Toggled Night Mode";
static final String SEARCH_REQUESTED_LABEL = "Search Requested";
static final String SETTINGS_OPENED_LABEL = "Settings Opened";
static final String HELP_OPENED_LABEL = "Help Opened";
static final String CALIBRATION_OPENED_LABEL = "Calibration Opened";
static final String TIME_TRAVEL_OPENED_LABEL = "Time Travel Opened";
static final String GALLERY_OPENED_LABEL = "Gallery Opened";
static final String TOS_OPENED_LABEL = "TOS Opened";
static final String DIAGNOSTICS_OPENED_LABEL = "Diagnostics Opened";
static final String SEARCH = "Search";
static final String GENERAL_CATEGORY = "General";
static final String START_HOUR = "Start up hour";
static final String SENSOR_CATEGORY = "Sensors";
static final String SESSION_LENGTH_BUCKET = "Session length bucket";
static final String SENSOR_AVAILABILITY = "Minimal Sensor Availability";
static final String ROT_SENSOR_AVAILABILITY = "Rotation Sensor Availability";
static final String SENSOR_TYPE = "Sensor Type - ";
static final String SENSOR_NAME = "Sensor Name";
static final String HIGH_SENSOR_ACCURACY_ACHIEVED = "High Accuracy Achieved";
static final String SENSOR_ACCURACY_CHANGED = "Sensor Accuracy Changed";
// Phone claims to have a sensor, but then doesn't allow registration of a listener.
static final String SENSOR_LIAR = "Sensor Liar!";
void setEnabled(boolean enabled);
/**
* Tracks a screen view.
*/
void trackPageView(String page);
/**
* Tracks and event.
*
* @see com.google.android.gms.analytics.HitBuilders.EventBuilder
*/
void trackEvent(String category, String action, String label, long value);
/**
* Sets custom variables for slicing.
*/
void setCustomVar(Slice slice, String value);
}
......@@ -50,7 +50,7 @@
android:key="sound_effects"/>
<!-- Keep in sync with value in utils.Analytics -->
<CheckBoxPreference
android:defaultValue="true"
android:defaultValue="@string/analytics_enabled"
android:title="@string/enable_analytics"
android:summary="@string/enable_analytics_desc"
android:key="enable_analytics"/>
......
#!/bin/bash
#!/bin/sh -e
# Temporary script to regenerate the data and build the app.
# TODO(jontayler): retire it once gradle can do this or
# or we get rid of the data generation step.
./gradlew clean assemble installDist
cd tools
./gradlew clean assembleGms installDist
(cd tools
# Gah. Gradle gets the classpath for the tools wrong. Fix:
sed -i -e 's/app-release.apk//g' build/install/datagen/bin/datagen
sed -i -e 's#CLASSPATH=#CLASSPATH=$APP_HOME/lib/:#g' build/install/datagen/bin/datagen
./generate.sh
./rewrite.sh
./binary.sh
cd ..
./gradlew assemble
./binary.sh)
./gradlew assembleGms
#!/bin/sh -e
# Temporary script to regenerate the data and build the app.
# TODO(jontayler): retire it once gradle can do this or
# or we get rid of the data generation step.
sed -i -e 's/gms/fdroid/' tools/build.gradle
sed -i -e '/gmsCompile/d' app/build.gradle
sed -i -e '/com.google.gms.google-services/d' app/build.gradle
./gradlew clean assembleFdroid installDist
(cd tools
# Gah. Gradle gets the classpath for the tools wrong. Fix:
sed -i -e 's#CLASSPATH=#CLASSPATH=$APP_HOME/lib/:#g' build/install/datagen/bin/datagen
./generate.sh
./rewrite.sh
./binary.sh)
./gradlew assembleFdroid
......@@ -7,7 +7,7 @@ dependencies {
compile project(':app')
compile 'com.google.guava:guava:19.0'
// TODO(jontayler): Terrible hack that should go when we revamp the tools.
compile files('../app/build/intermediates/classes/release/')
compile files('../app/build/intermediates/classes/gms/release/')
compile fileTree(include: ['*.jar'], dir: 'libs')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment