1
- import de.mannodermaus.gradle.plugins.junit5.WriteClasspathResource
2
1
import org.apache.tools.ant.filters.ReplaceTokens
3
2
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
4
3
import org.gradle.api.tasks.testing.logging.TestLogEvent
5
4
6
5
plugins {
7
6
id(" groovy" )
8
- id(" java-gradle-plugin" )
9
7
id(" java-library" )
10
8
id(" idea" )
11
9
id(" jacoco" )
@@ -55,10 +53,10 @@ configurations {
55
53
val processTestResources = tasks.getByName(" processTestResources" ) as Copy
56
54
processTestResources.apply {
57
55
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()
62
60
)
63
61
64
62
inputs.properties(tokens)
@@ -76,44 +74,42 @@ tasks.withType<Test> {
76
74
events = setOf (TestLogEvent .PASSED , TestLogEvent .SKIPPED , TestLogEvent .FAILED )
77
75
exceptionFormat = TestExceptionFormat .FULL
78
76
}
79
-
80
- // Uncomment this line to run disable running Functional Tests on the local device
81
- // environment("CI", "true")
82
77
}
83
78
84
79
dependencies {
85
80
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)
101
97
102
98
// Compilation of local classpath for functional tests
103
99
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 )
108
104
109
105
val functionalTestAgp32X by configurations
110
- functionalTestAgp32X(extra[ " plugins .android.32X " ] as String )
106
+ functionalTestAgp32X(" com .android.tools.build:gradle:3.2.1 " )
111
107
112
108
val functionalTestAgp33X by configurations
113
- functionalTestAgp33X(extra[ " plugins .android.33X " ] as String )
109
+ functionalTestAgp33X(" com .android.tools.build:gradle:3.3.0-rc03 " )
114
110
115
111
val functionalTestAgp34X by configurations
116
- functionalTestAgp34X(extra[ " plugins .android.34X " ] as String )
112
+ functionalTestAgp34X(" com .android.tools.build:gradle:3.4.0-alpha09 " )
117
113
}
118
114
119
115
// Resource Writers
0 commit comments