Skip to content

Commit 3c74312

Browse files
committed
fix and refactoring
1 parent 265a8eb commit 3c74312

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ class AffectedModuleDetectorPlugin : Plugin<Project> {
233233
internal const val CUSTOM_TASK_GROUP_NAME = "Affected Module Detector custom tasks"
234234

235235
private const val PLUGIN_ANDROID_APPLICATION = "com.android.application"
236-
private const val PLUGIN_ANDROID_LIBRARY = "java"
237-
private const val PLUGIN_JAVA_LIBRARY = "com.android.library"
236+
private const val PLUGIN_ANDROID_LIBRARY = "com.android.library"
237+
private const val PLUGIN_JAVA_LIBRARY = "java"
238238
private const val PLUGIN_KOTLIN = "kotlin"
239239

240240
private const val ANDROID_TEST_PATTERN = "AndroidTest"

affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedTestConfiguration.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ package com.dropbox.affectedmoduledetector
88
*/
99
open class AffectedTestConfiguration {
1010

11-
var assembleAndroidTestTask : String? = "assembleDebugAndroidTest"
12-
var runAndroidTestTask : String? = "connectedDebugAndroidTest"
11+
var assembleAndroidTestTask : String? = DEFAULT_ASSEMBLE_ANDROID_TEST_TASK
12+
var runAndroidTestTask : String? = DEFAULT_ANDROID_TEST_TASK
1313
var jvmTestTask : String? = DEFAULT_JVM_TEST_TASK
1414

1515
companion object {
1616
const val name = "affectedTestConfiguration"
17+
1718
internal const val DEFAULT_JVM_TEST_TASK = "testDebugUnitTest"
19+
internal const val DEFAULT_NON_ANDROID_JVM_TEST_TASK = "test"
20+
internal const val DEFAULT_ASSEMBLE_ANDROID_TEST_TASK = "assembleDebugAndroidTest"
21+
internal const val DEFAULT_ANDROID_TEST_TASK = "connectedDebugAndroidTest"
1822
}
1923
}

affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/InternalTaskType.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ internal enum class InternalTaskType(
88

99
ANDROID_TEST(
1010
commandByImpact = "runAffectedAndroidTests",
11-
originalGradleCommand = "connectedDebugAndroidTest",
11+
originalGradleCommand = AffectedTestConfiguration.DEFAULT_ANDROID_TEST_TASK,
1212
taskDescription = "Runs all affected Android Tests. Requires a connected device."
1313
),
1414

1515
ASSEMBLE_ANDROID_TEST(
1616
commandByImpact = "assembleAffectedAndroidTests",
17-
originalGradleCommand = "assembleDebugAndroidTest",
17+
originalGradleCommand = AffectedTestConfiguration.DEFAULT_ASSEMBLE_ANDROID_TEST_TASK,
1818
taskDescription = "Assembles all affected Android Tests. Useful when working with device labs."
1919
),
2020

2121
ANDROID_JVM_TEST(
2222
commandByImpact = "runAffectedUnitTests",
23-
originalGradleCommand = "testDebugUnitTest",
23+
originalGradleCommand = AffectedTestConfiguration.DEFAULT_JVM_TEST_TASK,
2424
taskDescription = "Runs all affected unit tests."
2525
),
2626

2727
JVM_TEST(
2828
commandByImpact = "", // inner type. This type doesn't registered in gradle
29-
originalGradleCommand = "test",
29+
originalGradleCommand = AffectedTestConfiguration.DEFAULT_NON_ANDROID_JVM_TEST_TASK,
3030
taskDescription = "Runs all affected unit tests for non Android modules."
3131
)
3232
}

0 commit comments

Comments
 (0)