Skip to content

Commit 85aafef

Browse files
authoredMay 14, 2020
Fix test src dir and detekt (airbnb#392)
airbnb#373 broke tests by including the wrong source dir. Detekt was also not run and was failing in several places. @BenSchwab can we ensure that Detekt runs on CI. cc @elihart @marukami
1 parent 42274c5 commit 85aafef

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed
 

‎buildSrc/build.gradle.kts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import java.util.Properties
2-
31
repositories {
42
google()
53
maven(url = "https://plugins.gradle.org/m2/")

‎buildSrc/settings.gradle.kts

Whitespace-only changes.

‎buildSrc/src/main/java/com/airbnb/mvrx/AndroidMetaModulePlugin.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,12 @@ class AndroidMetaModulePlugin : Plugin<Project> {
5959
setSrcDirs(srcDirs + file("src/main/kotlin"))
6060
}
6161
getByName("test").java.apply {
62-
setSrcDirs(srcDirs + file("src/main/kotlin"))
62+
setSrcDirs(srcDirs + file("src/test/kotlin"))
6363
}
6464
}
6565
}
6666
}
6767
}
6868
}
6969
}
70-
7170
}

‎buildSrc/src/main/java/com/airbnb/mvrx/JacocoReportTask.kt

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ open class JacocoReportTask : JacocoReport() {
2222
)
2323
val buildDir = project.buildDir
2424

25-
val debugTree = project.fileTree("${buildDir}/intermediates/classes/debug") {
25+
val debugTree = project.fileTree(buildDir.toString() + "/intermediates/classes/debug") {
2626
exclude(excludes)
2727
}
28-
val kotlinDebugTree = project.fileTree("${buildDir}/tmp/kotlin-classes/debug") {
28+
val kotlinDebugTree = project.fileTree(buildDir.toString() + "/tmp/kotlin-classes/debug") {
2929
exclude(excludes)
3030
}
3131

@@ -37,4 +37,3 @@ open class JacocoReportTask : JacocoReport() {
3737
executionData.from("$buildDir/jacoco/testDebugUnitTest.exec")
3838
}
3939
}
40-

‎todomvrx/src/main/java/com/airbnb/mvrx/todomvrx/MainActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MainActivity : AppCompatActivity() {
3838
}
3939
}
4040

41-
override fun onOptionsItemSelected(item: MenuItem?) = when (item?.itemId ?: 0) {
41+
override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId ?: 0) {
4242
android.R.id.home -> {
4343
if (navController.currentDestination?.isDrawerDestination() == true) {
4444
drawerLayout.openDrawer(GravityCompat.START)

0 commit comments

Comments
 (0)
Please sign in to comment.