-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from stephanenicolas/dlemures/removing-regist…
…ries TP 2.0
- Loading branch information
Showing
136 changed files
with
1,512 additions
and
2,334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
ext.deps = [// Common | ||
inject : 'javax.inject:javax.inject:1', | ||
|
||
// Compiler | ||
javapoet : 'com.squareup:javapoet:1.11.1', | ||
|
||
// Android | ||
android : 'com.google.android:android:4.1.1.4', | ||
androidPlugin : 'com.android.tools.build:gradle:3.3.0', | ||
coverallPlugin : 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3', | ||
supportv4 : 'com.android.support:support-v4:28.0.0', | ||
androidxv4 : 'androidx.legacy:legacy-support-v4:1.0.0', | ||
butterknife : 'com.jakewharton:butterknife:10.0.0', | ||
butterknife_compiler: 'com.jakewharton:butterknife-compiler:10.0.0', | ||
rxandroid : 'io.reactivex:rxandroid:1.2.1', | ||
|
||
// TP artifacts for composite builds | ||
tp_smoothie : 'com.github.stephanenicolas.toothpick:smoothie:2.0.0', | ||
tp_smoothie_androidx: 'com.github.stephanenicolas.toothpick:smoothie-androidx:2.0.0', | ||
tp_smoothie_support : 'com.github.stephanenicolas.toothpick:smoothie-support:2.0.0', | ||
tp : 'com.github.stephanenicolas.toothpick:toothpick:2.0.0', | ||
tp_runtime : 'com.github.stephanenicolas.toothpick:toothpick-runtime:2.0.0', | ||
tp_compiler : 'com.github.stephanenicolas.toothpick:toothpick-compiler:2.0.0', | ||
tp_testing : 'com.github.stephanenicolas.toothpick:toothpick-testing:2.0.0', | ||
tp_testing_junit4 : 'com.github.stephanenicolas.toothpick:toothpick-testing-junit4:2.0.0', | ||
tp_testing_junit5 : 'com.github.stephanenicolas.toothpick:toothpick-testing-junit5:2.0.0', | ||
|
||
// Test dependencies | ||
junit4 : 'junit:junit:4.12', | ||
junit5_api : 'org.junit.jupiter:junit-jupiter-api:5.3.2', | ||
junit5_engine : 'org.junit.jupiter:junit-jupiter-engine:5.3.2', | ||
hamcrest : 'org.hamcrest:java-hamcrest:2.0.0.0', | ||
truth : 'com.google.truth:truth:0.42', | ||
compiletesting : 'com.google.testing.compile:compile-testing:0.15', | ||
easymock : 'org.easymock:easymock:3.4', | ||
powermock : 'org.powermock:powermock-easymock-release-full:1.6.4', | ||
powermock_rule : 'org.powermock:powermock-module-junit4-rule-agent:1.6.4', | ||
robolectric : 'org.robolectric:robolectric:3.4.2', | ||
|
||
// Android Test Dependencies | ||
espresso : 'com.android.support.test.espresso:espresso-core:2.2.2', | ||
dexmaker : 'com.google.dexmaker:dexmaker:1.2',] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
include ':toothpick' | ||
include ':toothpick-javax-annotations' | ||
include ':toothpick-generated-core' | ||
include ':toothpick-compiler' | ||
include ':toothpick-runtime' | ||
include ':toothpick-testing' | ||
include ':toothpick-sample' | ||
include ':toothpick-testing-junit4' | ||
include ':toothpick-testing-junit5' | ||
include ':smoothie' | ||
include ':smoothie-sample' | ||
include ':smoothie-support' | ||
include ':smoothie-androidx' | ||
|
||
rootProject.name = 'toothpick-parent' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
buildscript { | ||
repositories { | ||
google() | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath deps.androidPlugin | ||
} | ||
|
||
} | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
repositories { | ||
google() | ||
} | ||
|
||
android { | ||
compileSdkVersion 28 | ||
buildToolsVersion '28.0.3' | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_7 | ||
targetCompatibility JavaVersion.VERSION_1_7 | ||
} | ||
|
||
defaultConfig { | ||
minSdkVersion 15 | ||
} | ||
|
||
lintOptions { | ||
textReport true | ||
textOutput 'stdout' | ||
// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. | ||
checkReleaseBuilds false | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly project(':toothpick') | ||
api project(':smoothie') | ||
compileOnly deps.inject | ||
compileOnly deps.androidxv4 | ||
|
||
testImplementation deps.androidxv4 | ||
testImplementation project(':toothpick-testing') | ||
testImplementation deps.junit4 | ||
testImplementation deps.easymock | ||
testImplementation deps.robolectric | ||
} | ||
|
||
apply from: rootProject.file('gradle/gradle-mvn-push.gradle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
POM_ARTIFACT_ID=smoothie-androidx | ||
POM_NAME=smoothie android X | ||
POM_DESCRIPTION='Toothpick package providing Android providers for the android X library' | ||
POM_PACKAGING='aar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="com.github.stephanenicolas.toothpick.smoothie_androidx"/> |
20 changes: 20 additions & 0 deletions
20
...thie-androidx/src/main/java/toothpick/smoothie/module/SmoothieAndroidXActivityModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package toothpick.smoothie.module; | ||
|
||
import android.app.Activity; | ||
import androidx.fragment.app.FragmentActivity; | ||
import androidx.fragment.app.FragmentManager; | ||
import androidx.loader.app.LoaderManager; | ||
import android.view.LayoutInflater; | ||
import toothpick.config.Module; | ||
import toothpick.smoothie.provider.AndroidXFragmentManagerProvider; | ||
import toothpick.smoothie.provider.AndroidXLoaderManagerProvider; | ||
import toothpick.smoothie.provider.LayoutInflaterProvider; | ||
|
||
public class SmoothieAndroidXActivityModule extends Module { | ||
public SmoothieAndroidXActivityModule(FragmentActivity activity) { | ||
bind(Activity.class).toInstance(activity); | ||
bind(FragmentManager.class).toProviderInstance(new AndroidXFragmentManagerProvider(activity)); | ||
bind(LoaderManager.class).toProviderInstance(new AndroidXLoaderManagerProvider(activity)); | ||
bind(LayoutInflater.class).toProviderInstance(new LayoutInflaterProvider(activity)); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...e-androidx/src/main/java/toothpick/smoothie/provider/AndroidXFragmentManagerProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package toothpick.smoothie.provider; | ||
|
||
import android.app.Activity; | ||
import androidx.fragment.app.FragmentActivity; | ||
import androidx.fragment.app.FragmentManager; | ||
import javax.inject.Provider; | ||
|
||
public class AndroidXFragmentManagerProvider implements Provider<FragmentManager> { | ||
Activity activity; | ||
|
||
public AndroidXFragmentManagerProvider(Activity activity) { | ||
this.activity = activity; | ||
} | ||
|
||
@Override | ||
public FragmentManager get() { | ||
return ((FragmentActivity) activity).getSupportFragmentManager(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...hie-androidx/src/main/java/toothpick/smoothie/provider/AndroidXLoaderManagerProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package toothpick.smoothie.provider; | ||
|
||
import android.app.Activity; | ||
import androidx.fragment.app.FragmentActivity; | ||
import androidx.loader.app.LoaderManager; | ||
import javax.inject.Provider; | ||
|
||
public class AndroidXLoaderManagerProvider implements Provider<LoaderManager> { | ||
Activity activity; | ||
|
||
public AndroidXLoaderManagerProvider(Activity activity) { | ||
this.activity = activity; | ||
} | ||
|
||
@Override | ||
public LoaderManager get() { | ||
return ((FragmentActivity) activity).getSupportLoaderManager(); | ||
} | ||
} |
Oops, something went wrong.