diff --git a/build.gradle b/build.gradle
index 6b42096..185ba99 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,9 +4,6 @@ buildscript {
repositories {
mavenCentral()
}
- dependencies {
- classpath 'com.android.tools.build:gradle:0.8.+'
- }
}
allprojects {
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index fe862f5..eb26b34 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Feb 01 01:39:34 CST 2014
+#Mon Jul 14 20:08:28 FET 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
diff --git a/objectcache/build.gradle b/objectcache/build.gradle
index fba0056..bfd6140 100644
--- a/objectcache/build.gradle
+++ b/objectcache/build.gradle
@@ -1,34 +1,34 @@
-apply plugin: 'android-library'
+apply plugin: 'java'
repositories {
mavenCentral()
}
-android {
- compileSdkVersion 19
- buildToolsVersion "19.0.1"
-
- defaultConfig {
- minSdkVersion 8
- targetSdkVersion 19
- versionCode 1
- versionName "1.0"
- }
- release {
- runProguard false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
- }
-}
-
apply plugin: 'maven'
group = 'com.iainconnor'
-version = '0.0.17-SNAPSHOT'
+version = '2.0.0-SNAPSHOT'
project.ext.description = "A simple cache for your objects."
dependencies {
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.jakewharton:disklrucache:2.0.2'
+ compile 'com.netflix.rxjava:rxjava-android:0.19.6'
+}
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+}
+
+artifacts {
+ archives sourcesJar
+ archives javadocJar
}
uploadArchives {
@@ -41,5 +41,7 @@ uploadArchives {
repository url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
repository url: 'file://' + new File("./maven").absolutePath
}
+
+
}
-}
\ No newline at end of file
+}
diff --git a/objectcache/src/main/AndroidManifest.xml b/objectcache/src/main/AndroidManifest.xml
deleted file mode 100644
index 0ed1992..0000000
--- a/objectcache/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
diff --git a/objectcache/src/main/java/com/iainconnor/objectcache/CacheManager.java b/objectcache/src/main/java/com/iainconnor/objectcache/CacheManager.java
index 7b86341..d3a2035 100644
--- a/objectcache/src/main/java/com/iainconnor/objectcache/CacheManager.java
+++ b/objectcache/src/main/java/com/iainconnor/objectcache/CacheManager.java
@@ -1,268 +1,143 @@
package com.iainconnor.objectcache;
-import android.os.AsyncTask;
import com.google.gson.Gson;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
-public class CacheManager {
- private final static int CACHE_RUSH_SECONDS = 60 * 2;
- private static CacheManager ourInstance;
- private DiskCache diskCache;
- private HashMap runtimeCache;
-
- public static CacheManager getInstance ( DiskCache diskCache ) {
- if (ourInstance == null) {
- ourInstance = new CacheManager(diskCache);
- }
-
- return ourInstance;
- }
-
- private CacheManager ( DiskCache diskCache ) {
- this.diskCache = diskCache;
- runtimeCache = new HashMap();
- }
-
- public boolean exists ( String key ) {
- boolean result = false;
-
- try {
- result = diskCache.contains(key);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- return result;
- }
-
- public Object get ( String key, Class objectClass, Type objectType ) {
- Object result = null;
-
- CachedObject runtimeCachedObject = runtimeCache.get(key);
- if (runtimeCachedObject != null && !runtimeCachedObject.isExpired()) {
- result = new Gson().fromJson(runtimeCachedObject.getPayload(), objectType);
- } else if (runtimeCachedObject != null && runtimeCachedObject.isSoftExpired()) {
- result = new SoftCachedObject