This file contains hidden or 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
import org.gradle.api.file.FileCollection | |
import org.gradle.api.tasks.CacheableTask | |
import org.gradle.api.tasks.InputFiles | |
import org.gradle.api.tasks.InputFile | |
import org.gradle.api.tasks.JavaExec | |
import org.gradle.api.tasks.OutputDirectory | |
import java.io.File | |
import javax.inject.Inject | |
@CacheableTask |
This file contains hidden or 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
@Module(includes = [NetworkModule.OkHttpClientModule::class]) | |
abstract class NetworkModule { | |
@Binds abstract fun provideService(retrofitService: RetrofitService): Service | |
@Module | |
object OkHttpClientModule { | |
@JvmStatic | |
@Provides |
This file contains hidden or 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
package au.tilbrook.mvrx.dagger | |
import androidx.fragment.app.FragmentActivity | |
import androidx.lifecycle.ViewModel | |
import com.airbnb.mvrx.BaseMvRxViewModel | |
import com.airbnb.mvrx.MvRxState | |
import com.airbnb.mvrx.MvRxViewModelFactory | |
import javax.inject.Provider | |
This file contains hidden or 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
subprojects { | |
afterEvaluate { project -> | |
BaseExtension android = project.extensions.findByName("android") | |
if (android != null) { | |
enableJacoco(project) | |
} | |
} | |
} |
This file contains hidden or 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
buildscript { | |
dependencies { | |
// android-gradle-plugin | |
// … | |
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" | |
} | |
} |
This file contains hidden or 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
@Target(AnnotationTarget.CLASS) | |
annotation class OpenForTesting |
This file contains hidden or 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
apply plugin: 'kotlin-allopen' | |
allOpen { | |
// allows mocking for classes w/o directly opening them for release builds | |
annotation 'com.android.example.github.testing.OpenClass' | |
} | |
// Forked from https://github.com/googlesamples/android-architecture-components/blob/d81da2cb1e3d61e40f052e631bb15883d0f9f637/GithubBrowserSample/app/build.gradle |
This file contains hidden or 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 annotation allows us to open some classes for mocking purposes while they are final in | |
* release builds. | |
*/ | |
@Target(AnnotationTarget.ANNOTATION_CLASS) | |
annotation class OpenClass | |
/** | |
* Annotate a class with [OpenForTesting] if you want it to be extendable in debug builds. | |
*/ |
This file contains hidden or 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
def mainSrc = [ | |
'src/main/java', | |
"src/$productFlavorName/java", | |
"src/$buildTypeName/java" | |
// Kotlin src folders | |
'src/main/kotlin', | |
"src/$productFlavorName/kotlin", | |
"src/$buildTypeName/kotlin" | |
] |
This file contains hidden or 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
buildscript { | |
repositories { | |
google() | |
jcenter() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:3.2.1' | |
classpath 'org.jacoco:org.jacoco.core:0.8.2' | |
} | |
} |
NewerOlder