@@ -87,16 +87,16 @@ class IntegrationTest(
87
87
})
88
88
})
89
89
90
- val executeAndroidTests = configuration.pluginConfiguration.getPropertyValue(" executeAndroidTests" , " true" ).toBoolean( )
90
+ val executeAndroidTests = configuration.pluginConfiguration.getPropertyValue(" executeAndroidTests" , true )
91
91
92
92
// Note: rootCodeCoverageReport is the old and deprecated name of the rootCoverageReport task, it is
93
93
// used to check whether the old name properly aliases to the new task name.
94
94
val gradleCommands = if (! executeAndroidTests) {
95
- val runOnGradleManagedDevices = configuration.pluginConfiguration.getPropertyValue(" runOnGradleManagedDevices" ) ? : " false"
95
+ val runOnGradleManagedDevices = configuration.pluginConfiguration.getPropertyValue(" runOnGradleManagedDevices" , false )
96
96
97
97
// Execute Android tests completely separately (as if run on some external service,
98
98
// after which the resulting files have been imported)
99
- if (runOnGradleManagedDevices == " false " ) {
99
+ if (! runOnGradleManagedDevices) {
100
100
executeGradleTasks(listOf (" clean" , " connectedDebugAndroidTest" ))
101
101
} else {
102
102
executeGradleTasks(listOf (" clean" , " nexusoneapi30DebugAndroidTest" ))
@@ -129,7 +129,7 @@ class IntegrationTest(
129
129
}
130
130
131
131
private fun BuildResult.assertCorrectAndroidTestTasksAreExecuted () {
132
- if (configuration.pluginConfiguration.getPropertyValue(" runOnGradleManagedDevices" , " false" ).toBoolean( )) {
132
+ if (configuration.pluginConfiguration.getPropertyValue(" runOnGradleManagedDevices" , false )) {
133
133
val device = configuration.pluginConfiguration.getPropertyValue(" gradleManagedDeviceName" , " allDevices" )
134
134
assertTaskSuccess(" :app:${device} DebugAndroidTest" )
135
135
assertTaskSuccess(" :library_android:${device} DebugAndroidTest" )
@@ -141,14 +141,15 @@ class IntegrationTest(
141
141
}
142
142
143
143
private fun BuildResult.assertCorrectAndroidTestTasksAreNotExecuted () {
144
- if (configuration.pluginConfiguration.getPropertyValue(" runOnGradleManagedDevices" , " false" ).toBoolean( )) {
144
+ if (configuration.pluginConfiguration.getPropertyValue(" runOnGradleManagedDevices" , false )) {
145
145
val device = configuration.pluginConfiguration.getPropertyValue(" gradleManagedDeviceName" , " allDevices" )
146
146
assertTaskNotExecuted(" :app:${device} DebugAndroidTest" )
147
147
assertTaskNotExecuted(" :library_android:${device} DebugAndroidTest" )
148
-
148
+ assertTaskNotExecuted( " :library_android_flavors: ${device} DemoDebugAndroidTest " )
149
149
} else {
150
150
assertTaskNotExecuted(" :app:connectedDebugAndroidTest" )
151
151
assertTaskNotExecuted(" :library_android:connectedDebugAndroidTest" )
152
+ assertTaskNotExecuted(" :library_android_flavors:connectedDemoDebugAndroidTest" )
152
153
}
153
154
}
154
155
@@ -162,6 +163,7 @@ class IntegrationTest(
162
163
163
164
report.assertCoverage(" org.neotech.library.android" , " LibraryAndroidJava" )
164
165
report.assertCoverage(" org.neotech.library.android" , " LibraryAndroidKotlin" )
166
+ report.assertCoverage(" org.neotech.library.android.flavors" , " LibraryAndroidFlavorsKotlin" )
165
167
report.assertCoverage(" org.neotech.app" , " AppJava" )
166
168
report.assertCoverage(" org.neotech.app" , " AppKotlin" )
167
169
report.assertCoverage(" org.neotech.app" , " RobolectricTestedActivity" )
@@ -253,12 +255,11 @@ class IntegrationTest(
253
255
) {
254
256
data class PluginConfiguration (val properties : List <Property > = emptyList()) {
255
257
256
- fun getPropertyValue (name : String , defaultValue : String ): String = getPropertyValue(name) ? : defaultValue
257
-
258
- fun getPropertyValue (name : String ): String? = properties.find { it.name == name }?.value
258
+ fun <T > getPropertyValue (name : String , defaultValue : T ): T = getPropertyValue(name) ? : defaultValue
259
259
260
+ fun <T > getPropertyValue (name : String ): T ? = properties.find { it.name == name }?.value as T ?
260
261
261
- data class Property (val name : String , val value : String )
262
+ data class Property (val name : String , val value : Any )
262
263
}
263
264
264
265
data class ProjectConfiguration (
0 commit comments