Skip to content

Commit

Permalink
Upgrades to Kotlin 1.0.0, Moved from Dagger to Injekt
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Egan committed Feb 19, 2016
1 parent 14cacc7 commit 0eadf3b
Show file tree
Hide file tree
Showing 33 changed files with 148 additions and 1,133 deletions.
4 changes: 2 additions & 2 deletions bansa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}

buildscript {
ext.kotlin_version = '1.0.0-rc-1036'
ext.kotlin_version = '1.0.0'
repositories {
mavenCentral()
}
Expand All @@ -25,7 +25,7 @@ dependencies {
compile 'io.reactivex:rxjava:1.0.16'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

testCompile "org.jetbrains.spek:spek:0.1.194"
testCompile "org.jetbrains.spek:spek:0.1.195"
testCompile 'org.assertj:assertj-core:1.7.1'
}

Expand Down
9 changes: 5 additions & 4 deletions examples/counter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repositories {
}

buildscript {
ext.kotlin_version = '1.0.0-rc-1036'
ext.kotlin_version = '1.0.0'
repositories {
mavenCentral()
}
Expand All @@ -35,15 +35,16 @@ buildscript {
dependencies {
compile project(':bansa')

compile "com.android.support:appcompat-v7:23.1.1"
compile 'com.android.support:design:23.1.1'

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'co.trikita:anvil-sdk15:0.2.0'
compile 'io.reactivex:rxjava:1.0.16'
compile "uy.kohesive.injekt:injekt-core:1.12.+"
compile "uy.kohesive.injekt:injekt-core:1.14.0"
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.android.support:design:23.1.1'

testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'

}

7 changes: 2 additions & 5 deletions examples/counterPair/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repositories {
}

buildscript {
ext.kotlin_version = '1.0.0-rc-1036'
ext.kotlin_version = '1.0.0'
repositories {
mavenCentral()
}
Expand All @@ -33,15 +33,12 @@ buildscript {
}

dependencies {
kapt 'com.squareup.dagger:dagger-compiler:1.2.2'

compile project(':bansa')

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'co.trikita:anvil-sdk15:0.2.0'
compile 'com.squareup.dagger:dagger:1.2.2'
compile 'io.reactivex:rxjava:1.0.16'
compile 'io.reactivex:rxandroid:1.0.1'
compile "uy.kohesive.injekt:injekt-core:1.14.0"
compile 'com.android.support:design:23.1.1'
compile 'com.jakewharton.rxbinding:rxbinding:0.3.0'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.3.0'
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package com.brianegan.bansa.counterPair

import dagger.ObjectGraph
import com.brianegan.bansa.Action
import com.brianegan.bansa.Store
import com.brianegan.bansa.createStore
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.InjektMain
import uy.kohesive.injekt.api.InjektRegistrar
import uy.kohesive.injekt.api.fullType
import uy.kohesive.injekt.api.get

class Application : android.app.Application() {
var objectGraph: ObjectGraph? = null

override fun onCreate() {
super.onCreate()
instance = this
objectGraph = ObjectGraph.create(ApplicationModule(this), StoreModule())
companion object : InjektMain() {
override fun InjektRegistrar.registerInjectables() {
addSingleton(
fullType<Store<ApplicationState, Action>>(),
createStore(ApplicationState(), applicationReducer));
}
}

companion object {
private var instance: Application? = null
val store = Injekt.get(fullType<Store<ApplicationState, Action>>())

fun getObjectGraph(): ObjectGraph? {
return instance?.objectGraph
}
override fun onCreate() {
super.onCreate()
store.dispatch(INIT()) // Initialize the store
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.brianegan.bansa.Action
import com.brianegan.bansa.Store
import javax.inject.Inject
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.fullType
import uy.kohesive.injekt.api.get

public open class RootActivity : AppCompatActivity() {
@Inject lateinit var store: Store<ApplicationState, Action>
val store: Store<ApplicationState, Action> = Injekt.get(fullType<Store<ApplicationState, Action>>())

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Application.getObjectGraph()?.inject(this)
store.dispatch(INIT()) // Initialize the store
setContentView(RootView(this, store)) // Set the root view
super.onCreate(savedInstanceState);
setContentView(RootView(this, store))
}
}
14 changes: 6 additions & 8 deletions examples/listOfCounters/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repositories {
}

buildscript {
ext.kotlin_version = '1.0.0-rc-1036'
ext.kotlin_version = '1.0.0'
repositories {
mavenCentral()
}
Expand All @@ -36,20 +36,18 @@ buildscript {
}

dependencies {
kapt 'com.squareup.dagger:dagger-compiler:1.2.2'

compile project(':bansa')

compile "com.android.support:appcompat-v7:23.1.1"
compile 'com.android.support:design:23.1.1'

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'co.trikita:anvil-sdk15:0.2.0'
compile 'com.squareup.dagger:dagger:1.2.2'
compile "uy.kohesive.injekt:injekt-core:1.14.0"
compile 'io.reactivex:rxjava:1.0.16'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.jakewharton.rxbinding:rxbinding:0.3.0'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.3.0'

testCompile "org.jetbrains.spek:spek:0.1.194"
testCompile "org.jetbrains.spek:spek:0.1.195"
testCompile 'org.assertj:assertj-core:1.7.1'
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
package com.brianegan.bansa.listOfCounters

import com.brianegan.bansa.listOfCounters.ApplicationModule
import com.brianegan.bansa.listOfCounters.StoreModule
import dagger.ObjectGraph
import com.brianegan.bansa.Action
import com.brianegan.bansa.Store
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.InjektMain
import uy.kohesive.injekt.api.InjektRegistrar
import uy.kohesive.injekt.api.fullType
import uy.kohesive.injekt.api.get

class Application : android.app.Application() {
var objectGraph: ObjectGraph? = null

override fun onCreate() {
super.onCreate()
instance = this
objectGraph = ObjectGraph.create(ApplicationModule(this), StoreModule())
companion object : InjektMain() {
override fun InjektRegistrar.registerInjectables() {
addSingleton(
fullType<Store<ApplicationState, Action>>(),
com.brianegan.bansa.createStore(ApplicationState(), applicationReducer));
}
}

companion object {
private var instance: Application? = null
val store = Injekt.get(fullType<Store<ApplicationState, Action>>())

fun getObjectGraph(): ObjectGraph? {
return instance?.objectGraph
}
override fun onCreate() {
super.onCreate()
store.dispatch(INIT())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.brianegan.bansa.Action
import com.brianegan.bansa.Store
import javax.inject.Inject
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.fullType
import uy.kohesive.injekt.api.get

public open class RootActivity : AppCompatActivity() {
@Inject lateinit var store: Store<ApplicationState, Action>
val store = Injekt.get(fullType<Store<ApplicationState, Action>>())

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Application.getObjectGraph()?.inject(this)
store.dispatch(INIT()) // Initialize the store
setContentView(RootView(this, store)) // Set the root view
setContentView(RootView(this, store))
}
}
17 changes: 6 additions & 11 deletions examples/listOfCountersVariant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repositories {
}

buildscript {
ext.kotlin_version = '1.0.0-rc-1036'
ext.kotlin_version = '1.0.0'
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
Expand All @@ -42,26 +42,21 @@ buildscript {
}

dependencies {
kapt 'com.squareup.dagger:dagger-compiler:1.2.2'

compile project(':bansa')

compile 'com.facebook.rebound:rebound:0.3.8'
compile 'com.tumblr:backboard:0.1.0'
compile "com.android.support:appcompat-v7:23.1.1"
compile 'com.android.support:design:23.1.1'

compile "uy.kohesive.injekt:injekt-core:1.14.0"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'co.trikita:anvil-sdk15:0.2.0'
compile 'com.github.brianegan:anvil-recyclerview:1.3'
compile 'com.squareup.dagger:dagger:1.2.2'
compile 'io.reactivex:rxjava:1.0.16'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.jakewharton.rxbinding:rxbinding:0.3.0'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.andrewoma.dexx:kollection:0.4'
compile 'com.github.andrewoma.dexx:kollection:0.5'

testCompile 'org.assertj:assertj-core:1.7.1'
testCompile "org.jetbrains.spek:spek:0.1.194"
testCompile "org.jetbrains.spek:spek:0.1.195"
}

This file was deleted.

Loading

0 comments on commit 0eadf3b

Please sign in to comment.