Skip to content

Commit

Permalink
Merge pull request #42 from izumin5210/apply-java-plugin
Browse files Browse the repository at this point in the history
Change droidux and droidux-thunk to java library
  • Loading branch information
Masayuki IZUMI committed Jan 13, 2016
2 parents f248ae0 + 1633546 commit 30285e2
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 128 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ store.dispatch(new ClearCountAction()).subscribe(); // Counter: 0
### Data Binding

```java
// If you use databinding, yor store interface must extend `android.databinding.Observable`.
@Store(CounterReducer.class)
public interface CounterStore extends BaseStore {
public interface CounterStore extends BaseStore, android.databinding.Observable {
// You should annotate the getter method with @Bindable
@Bindable Counter getCounter();
}
Expand Down
9 changes: 5 additions & 4 deletions droidux-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ dependencies {
compile 'com.google.auto:auto-common:0.5'
compile 'com.google.auto.service:auto-service:1.0-rc2'

compile "io.reactivex:rxjava:${project.rxJavaVersion}"
compile "com.android.databinding:baseLibrary:${project.databindingBaseLibraryVersion}"
compile fileTree(dir: './libs', includes: ['*.jar'])

testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:2.2.0'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'com.google.testing.compile:compile-testing:0.6'
testCompile files(Jvm.current().getToolsJar())
compile "io.reactivex:rxjava:${project.rxJavaVersion}"
compile 'com.google.android:android:4.1.1.4'
compile "com.android.databinding:baseLibrary:${project.databindingBaseLibraryVersion}"
compile fileTree(dir: './libs', includes: ['*.jar'])
testCompile 'com.google.android:android:4.1.1.4'
}

publish {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static class BindableCounter {
"import info.izumin.android.droidux.processor.fixture.CounterReducer;",
"import rx.Observable;",
"@Store({CounterReducer.class})",
"public interface RootStore extends BaseStore {",
"public interface RootStore extends BaseStore, android.databinding.Observable {",
" @Bindable Counter counter();",
" Observable<Counter> observeCounter();",
"}"
Expand Down Expand Up @@ -423,7 +423,7 @@ public static class CombinedReducerAndBindableReducer {
"import info.izumin.android.droidux.processor.fixture.TodoList;",
"import rx.Observable;",
"@Store({CounterReducer.class, TodoListReducer.class})",
"public interface RootStore extends BaseStore {",
"public interface RootStore extends BaseStore, android.databinding.Observable {",
" Counter counter();",
" Observable<Counter> observeCounter();",
" @Bindable TodoList todoList();",
Expand Down
34 changes: 5 additions & 29 deletions droidux/build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,13 @@
apply plugin: 'com.android.library'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'groovyx.grooid.groovy-android'

android {
compileSdkVersion project.compileSdkVersion
buildToolsVersion project.buildToolsVersion

defaultConfig {
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_7

dependencies {
provided "io.reactivex:rxjava:${project.rxJavaVersion}"
provided "com.android.databinding:baseLibrary:${project.databindingBaseLibraryVersion}"
compile "io.reactivex:rxjava:${project.rxJavaVersion}"

testCompile 'junit:junit:4.12'
testCompile "org.spockframework:spock-core:${project.spockCoreVersion}"
testCompile "cglib:cglib-nodep:${project.cglibVersion}"
}
Expand Down

This file was deleted.

9 changes: 0 additions & 9 deletions droidux/src/main/AndroidManifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/**
* Created by izumin on 12/6/15.
*/
public interface BaseStore extends android.databinding.Observable {
public interface BaseStore {
rx.Observable<Action> dispatch(Action action);
}
3 changes: 0 additions & 3 deletions droidux/src/main/res/values/strings.xml

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
* Created by izumin on 12/6/15.
*/
@Store(CounterReducer.class)
public interface RootStore extends BaseStore {
public interface RootStore extends BaseStore, android.databinding.Observable {
@Bindable Counter getCounter();
}
27 changes: 5 additions & 22 deletions middlewares/droidux-thunk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
apply plugin: 'com.android.library'
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'groovyx.grooid.groovy-android'

android {
compileSdkVersion project.compileSdkVersion
buildToolsVersion project.buildToolsVersion

defaultConfig {
minSdkVersion project.minSdkVersion
targetSdkVersion project.targetSdkVersion
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_7

dependencies {
provided "com.android.databinding:library:${project.databindingLibraryVersion}"
provided "io.reactivex:rxjava:${project.rxJavaVersion}"
provided project(':droidux')
compile project(':droidux')

testCompile "org.spockframework:spock-core:${spockCoreVersion}"
testCompile "cglib:cglib-nodep:${project.cglibVersion}"
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 30285e2

Please sign in to comment.