1- import de.mannodermaus.gradle.plugins.junit5.WriteClasspathResource
21import org.apache.tools.ant.filters.ReplaceTokens
32import org.gradle.api.tasks.testing.logging.TestExceptionFormat
43import org.gradle.api.tasks.testing.logging.TestLogEvent
54
65plugins {
76 id(" groovy" )
8- id(" java-gradle-plugin" )
97 id(" java-library" )
108 id(" idea" )
119 id(" jacoco" )
@@ -55,10 +53,10 @@ configurations {
5553val processTestResources = tasks.getByName(" processTestResources" ) as Copy
5654processTestResources.apply {
5755 val tokens = mapOf (
58- " COMPILE_SDK_VERSION" to project.extra[ " android. compileSdkVersion" ] as String ,
59- " BUILD_TOOLS_VERSION" to project.extra[ " android. buildToolsVersion" ] as String ,
60- " MIN_SDK_VERSION" to (project.extra[ " android. sampleMinSdkVersion" ] as Int ) .toString(),
61- " TARGET_SDK_VERSION" to (project.extra[ " android. targetSdkVersion" ] as Int ) .toString()
56+ " COMPILE_SDK_VERSION" to Android . compileSdkVersion,
57+ " BUILD_TOOLS_VERSION" to Android . buildToolsVersion,
58+ " MIN_SDK_VERSION" to Android . sampleMinSdkVersion.toString(),
59+ " TARGET_SDK_VERSION" to Android . targetSdkVersion.toString()
6260 )
6361
6462 inputs.properties(tokens)
@@ -76,44 +74,42 @@ tasks.withType<Test> {
7674 events = setOf (TestLogEvent .PASSED , TestLogEvent .SKIPPED , TestLogEvent .FAILED )
7775 exceptionFormat = TestExceptionFormat .FULL
7876 }
79-
80- // Uncomment this line to run disable running Functional Tests on the local device
81- // environment("CI", "true")
8277}
8378
8479dependencies {
8580 testImplementation(project(" :android-junit5" ))
86- testImplementation(kotlin(" gradle-plugin" , extra[" versions.kotlin" ] as String ))
87- testImplementation(extra[" plugins.android" ] as String )
88- testImplementation(extra[" libs.commonsIO" ] as String )
89- testImplementation(extra[" libs.commonsLang" ] as String )
90- testImplementation(extra[" libs.junit4" ] as String )
91- testImplementation(extra[" libs.junitJupiterApi" ] as String )
92- testImplementation(extra[" libs.junitJupiterParams" ] as String )
93- testImplementation(extra[" libs.spekApi" ] as String )
94- testImplementation(extra[" libs.junitPioneer" ] as String )
95- testImplementation(extra[" libs.assertjCore" ] as String )
96- testImplementation(extra[" libs.mockito" ] as String )
97-
98- testRuntimeOnly(extra[" libs.junitJupiterEngine" ] as String )
99- testRuntimeOnly(extra[" libs.junitVintageEngine" ] as String )
100- testRuntimeOnly(extra[" libs.spekEngine" ] as String )
81+ testImplementation(gradleTestKit())
82+ testImplementation(Libs .kotlin_gradle_plugin)
83+ testImplementation(Libs .com_android_tools_build_gradle)
84+ testImplementation(Libs .commons_io)
85+ testImplementation(Libs .commons_lang)
86+ testImplementation(Libs .junit)
87+ testImplementation(Libs .junit_jupiter_api)
88+ testImplementation(Libs .junit_jupiter_params)
89+ testImplementation(Libs .spek_api)
90+ testImplementation(Libs .junit_pioneer)
91+ testImplementation(Libs .assertj_core)
92+ testImplementation(Libs .mockito_core)
93+
94+ testRuntimeOnly(Libs .junit_jupiter_engine)
95+ testRuntimeOnly(Libs .junit_vintage_engine)
96+ testRuntimeOnly(Libs .spek_junit_platform_engine)
10197
10298 // Compilation of local classpath for functional tests
10399 val functionalTest by configurations
104- functionalTest(kotlin( " compiler-embeddable " , extra[ " versions.kotlin " ] as String ) )
105- functionalTest(extra[ " libs.junit4 " ] as String )
106- functionalTest(extra[ " libs.junitJupiterApi " ] as String )
107- functionalTest(extra[ " libs.junitJupiterEngine " ] as String )
100+ functionalTest(Libs .kotlin_compiler_embeddable )
101+ functionalTest(Libs .junit )
102+ functionalTest(Libs .junit_jupiter_api )
103+ functionalTest(Libs .junit_jupiter_engine )
108104
109105 val functionalTestAgp32X by configurations
110- functionalTestAgp32X(extra[ " plugins .android.32X " ] as String )
106+ functionalTestAgp32X(" com .android.tools.build:gradle:3.2.1 " )
111107
112108 val functionalTestAgp33X by configurations
113- functionalTestAgp33X(extra[ " plugins .android.33X " ] as String )
109+ functionalTestAgp33X(" com .android.tools.build:gradle:3.3.0-rc03 " )
114110
115111 val functionalTestAgp34X by configurations
116- functionalTestAgp34X(extra[ " plugins .android.34X " ] as String )
112+ functionalTestAgp34X(" com .android.tools.build:gradle:3.4.0-alpha09 " )
117113}
118114
119115// Resource Writers
0 commit comments