Skip to content

Commit

Permalink
Merge branch 'actionbar'
Browse files Browse the repository at this point in the history
Rearrange directory structure to follow Android+Gradle standards.  Since
that renames everything, take the opportunity to remove the "Squeezer"
prefix from class names.
  • Loading branch information
Nik Clayton committed Dec 14, 2013
2 parents 24bb81f + 5cec95e commit 764467f
Show file tree
Hide file tree
Showing 613 changed files with 20,054 additions and 17,913 deletions.
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.\#*
*~
*.apk
build
bin
gen
.classpath
out
local.properties
build.properties
src/com/danga/squeezer/IServiceCallback.java
src/com/danga/squeezer/ISqueezeService.java
src/com/danga/squeezer/R.java
squeezer.properties
.classpath
/ant.properties
.settings/
*.iml
*.patch
.idea
.gradle
83 changes: 0 additions & 83 deletions AndroidManifest.xml

This file was deleted.

40 changes: 40 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
HACKING
=======

This guide assumes you have already downloaded and installed the Android
SDK, in to a directory referred to as $SDK.

Fetch the code
--------------


Android Studio
--------------

* Install the Android Build Tools revision 17.0.0 if not already installed.

Run $SDK/tools/android and select "Android SDK Build-tools",

* Run Android Studio

* If you have no projects open then choose "Import project" from the dialog
that appears.

If you already have a project open then choose File > Import Project...

* In the "Select File or Directory to Import" dialog that appears, navigate
to the directory that you fetched the Squeezer source code in to and
select the build.gradle file that ships with Squeezer.

* In the "Import Project from Gradle" dialog tick "Use auto-import" and
make sure that "Use gradle wrapper (recommended)" is selected.

* Copy ide/intellij/codestyles/AndroidStyle.xml to Android Studio's config
directory.

Linux: ~/.AndroidStudioPreview/config/codestyles
OS X: ~/Library/Preferences/AndroidStudioPreview/codestyles
Windows: ~/.AndroidStudioPreview/config/codestyles

* Go to Settings (or Preferences in Mac OS X) > Code Style > Java, select
"AndroidStyle", as well as Code Style > XML and select "AndroidStyle".
90 changes: 90 additions & 0 deletions Squeezer/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'

repositories {
mavenCentral()
}

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')

// Android support libraries
// Note: these libraries require the "Google Repository" and "Android
// Support Repository" to be installed via the SDK manager.
compile 'com.android.support:support-v4:19.0.+'
compile 'com.android.support:appcompat-v7:19.0.+'

// Third party libraries
compile 'ch.acra:acra:4.5.0'
compile 'com.google.guava:guava:15.0'
// findbugs is required for Proguard to work with Guava.
compile 'com.google.code.findbugs:jsr305:2.0.2'

// Changelogs, see https://github.com/cketti/ckChangeLog.
compile 'de.cketti.library.changelog:ckchangelog:1.2.0'
}

android {
compileSdkVersion 19
buildToolsVersion "19.0.0"

defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}

buildTypes {
release {
runProguard true
// You could use 'proguardFile "proguard.cfg"' here and get the
// same effect, but this ensures that any changes to
// proguard-android-optimize.txt are automatically included.
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
proguardFile "proguard-acra.cfg"
proguardFile "proguard-guava.cfg"
proguardFile "proguard-squeezer.cfg"
}
}

signingConfigs {
if(project.hasProperty("Squeezer.properties")
&& file(project.property("Squeezer.properties")).exists()) {
Properties props = new Properties()
props.load(new FileInputStream(file(project.property("Squeezer.properties"))))
release {
storeFile file("keystore")
storePassword props['key.store.password']
keyAlias "squeezer"
keyPassword props['key.alias.password']
}
} else {
release {
storeFile file("keystore")
storePassword "fakeStorePassword"
keyAlias "squeezer"
keyPassword "fakeKeyPassword"
}
}
}

productFlavors {
beta {
versionCode 16
versionName "1.0-beta-3"
signingConfig android.signingConfigs.release
}

live {
versionCode 13
versionName "0.9.1"
signingConfig android.signingConfigs.release
}
}
}
1 change: 1 addition & 0 deletions Squeezer/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Squeezer.properties=squeezer.properties
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions Squeezer/proguard-acra.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# From: https://github.com/ACRA/acra/wiki/Proguard

# ACRA specifics
# we need line numbers in our stack traces otherwise they are pretty useless
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

# ACRA needs "annotations" so add this...
-keepattributes *Annotation*

# keep this class so that logging will show 'ACRA' and not a obfuscated name like 'a'.
# Note: if you are removing log messages elsewhere in this file then this isn't necessary
-keep class org.acra.ACRA {
*;
}

# keep this around for some enums that ACRA needs
-keep class org.acra.ReportingInteractionMode {
*;
}

-keepnames class org.acra.sender.HttpSender$** {
*;
}

-keepnames class org.acra.ReportField {
*;
}

# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter
{
public void addCustomData(java.lang.String,java.lang.String);
public void putCustomData(java.lang.String,java.lang.String);
public void removeCustomData(java.lang.String);
}

# keep this otherwise it is removed by ProGuard
-keep public class org.acra.ErrorReporter
{
public void handleSilentException(java.lang.Throwable);
}
7 changes: 7 additions & 0 deletions Squeezer/proguard-guava.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Proguard configuration for Guava
#
# Based on https://code.google.com/p/guava-libraries/wiki/UsingProGuardWithGuava.

-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-dontwarn com.google.common.util.concurrent.**
22 changes: 22 additions & 0 deletions Squeezer/proguard-squeezer.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# No sense in obfuscating names since the code is freely available,
# and it makes debugging a little tricker
-keepnames class uk.org.ngo.squeezer.** {
<methods>;
}

# Explicitly keep the model class constructors.
# Without this you get NoSuchMethodExceptions when creating model objects.
-keep public class uk.org.ngo.squeezer.model.** {
<init>(java.lang.String);
<init>(java.util.Map);
<init>(android.os.Parcel);
}

# Needed to support the reflection in BaseItemView.
-keepattributes Signature

# Strip out certain logging calls.
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
}
69 changes: 69 additions & 0 deletions Squeezer/proguard.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This is a configuration file for ProGuard.
# http://proguard.sourceforge.net/index.html#manual/usage.html

# Optimizations: If you don't want to optimize, use the
# proguard-android.txt configuration file instead of this one, which
# turns off the optimization flags. Adding optimization introduces
# certain risks, since for example not all optimizations performed by
# ProGuard works on all versions of Dalvik. The following flags turn
# off various optimizations known to have issues, but the list may not
# be complete or up to date. (The "arithmetic" optimization can be
# used if you are only targeting Android 2.0 or later.) Make sure you
# test thoroughly if you go this route.
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
-optimizationpasses 5
-allowaccessmodification
-dontpreverify

# The remainder of this file is identical to the non-optimized version
# of the Proguard configuration file (except that the other file has
# flags to turn off optimization).

-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose

-keepattributes *Annotation*
-keep public class com.google.vending.licensing.ILicensingService
-keep public class com.android.vending.licensing.ILicensingService

# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
-keepclasseswithmembernames class * {
native <methods>;
}

# keep setters in Views so that animations can still work.
# see http://proguard.sourceforge.net/manual/examples.html#beans
-keepclassmembers public class * extends android.view.View {
void set*(***);
*** get*();
}

# We want to keep methods in Activity that could be used in the XML attribute onClick
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}

# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}

-keepclassmembers class **.R$* {
public static <fields>;
}

# The support library contains references to newer platform versions.
# Don't warn about those in case this app is linking against an older
# platform version. We know about them, and they are safe.
-dontwarn android.support.**

# Squeezer customisations
-include proguard-acra.cfg
-include proguard-guava.cfg
-include proguard-squeezer.cfg
Loading

0 comments on commit 764467f

Please sign in to comment.