-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add android checks and unit tests
- Loading branch information
1 parent
f5a6fd8
commit c50a7e3
Showing
7 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
ruby 3.2.2 | ||
java temurin-17.0.9+9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
plugins { | ||
//trick: for the same plugin versions in all sub-modules | ||
// trick: for the same plugin versions in all sub-modules | ||
alias(libs.plugins.androidApplication).apply(false) | ||
alias(libs.plugins.androidLibrary).apply(false) | ||
alias(libs.plugins.kotlinAndroid).apply(false) | ||
alias(libs.plugins.kotlinMultiplatform).apply(false) | ||
id("com.diffplug.spotless").version("6.21.0") | ||
} | ||
|
||
spotless { | ||
kotlinGradle { | ||
ktlint() | ||
} | ||
} | ||
|
||
subprojects { | ||
apply(plugin = "com.diffplug.spotless") | ||
|
||
spotless { | ||
kotlin { | ||
target("src/**/*.kt") | ||
ktfmt().kotlinlangStyle() | ||
} | ||
kotlinGradle { ktfmt().kotlinlangStyle() } | ||
} | ||
} | ||
|
||
tasks.getByName("clean", Delete::class) { | ||
delete(rootProject.buildDir) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
shared/src/androidUnitTest/kotlin/com/mbta/tid/mbta_app/Test.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package com.mbta.tid.mbta_app | ||
|
||
import org.junit.Assert.assertTrue | ||
import org.junit.Assert.assertFalse | ||
import org.junit.Test | ||
|
||
class AndroidGreetingTest { | ||
|
||
@Test | ||
fun testExample() { | ||
assertTrue("Check Android is mentioned", Greeting().greet().contains("Android")) | ||
// TODO: Switch back to assertTrue. See how test failure is represented in CI | ||
assertFalse("Check Android is mentioned", Greeting().greet().contains("Android")) | ||
} | ||
} | ||
} |