Davide Giuseppe Farella
02/05/2019, 10:30 AMbuildSrc
I got something like this, for apply my tests dependencies:
fun DependencyHandler.applyTests() = Libs.run {
listOf( test, test_junit, mockk )
.forEach { add("testImplementation", it ) }
}
fun DependencyHandler.applyAndroidTests() = Libs.Android.run {
listOf( espresso, test_runner )
.forEach { add( "androidTestImplementation", it ) }
}
I would also like to create something for apply my android config
through my Android modules, instead of duplicate every time, but com.android.build.gradle.internal.dsl.BaseAppModuleExtension
is part of the android gardle plugin, so it can’t be resolved in my buildSrc
. Is there any way to achieve that?eskatos
02/05/2019, 10:35 AMbuildSrc
project.
For example if you had:
// build.gradle(.kts)
buildscript {
dependencies {
classpath("com.android.tools.build:gradle:3.3.0")
}
}
You can move it to:
// buildSrc/build.gradle(.kts)
dependencies {
compile("com.android.tools.build:gradle:3.3.0")
}
Davide Giuseppe Farella
02/05/2019, 10:36 AMeskatos
02/05/2019, 10:41 AMDavide Giuseppe Farella
02/05/2019, 10:42 AMDavide Giuseppe Farella
02/05/2019, 3:44 PM