Skip to content

Commit 9679067

Browse files
cleanup gradle properties
1 parent e176543 commit 9679067

6 files changed

Lines changed: 61 additions & 39 deletions

File tree

app/build.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,20 @@ dependencies {
4949
testImplementation 'com.googlecode.junit-toolbox:junit-toolbox:2.4'
5050
testImplementation 'junit:junit:4.13.2'
5151
testImplementation 'org.mockito:mockito-core:5.21.0'
52-
testImplementation 'org.mockito.kotlin:mockito-kotlin:6.2.1'
53-
testImplementation 'org.robolectric:robolectric:4.16'
52+
testImplementation 'org.mockito.kotlin:mockito-kotlin:6.2.2'
53+
testImplementation 'org.robolectric:robolectric:4.16.1'
5454
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
5555
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
5656
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
5757
testImplementation 'org.assertj:assertj-core:3.27.6'
58+
testImplementation 'org.hamcrest:hamcrest:3.0'
5859
// Android Test Dependencies
5960
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
6061
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.7.0'
6162
androidTestImplementation 'androidx.test.ext:junit-ktx:1.3.0'
6263
androidTestImplementation 'androidx.test:rules:1.7.0'
6364
androidTestImplementation 'org.assertj:assertj-core:3.27.6'
65+
androidTestImplementation 'org.hamcrest:hamcrest:3.0'
6466
}
6567

6668
android {
@@ -227,3 +229,8 @@ def static writeProperties(propertiesFile, properties) {
227229
properties.store(writer, "Build Properties")
228230
writer.close()
229231
}
232+
233+
configurations.all {
234+
exclude group: 'org.hamcrest', module: 'hamcrest-core'
235+
exclude group: 'org.hamcrest', module: 'hamcrest-library'
236+
}

app/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Build Properties
2-
#Sat Jan 17 13:51:56 EST 2026
3-
version_build=2
2+
#Sat Jan 24 11:44:11 EST 2026
3+
version_build=3
44
version_major=3
55
version_minor=2
66
version_patch=2

app/src/androidTest/kotlin/com/vrem/wifianalyzer/ConnectionInstrumentedTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import androidx.test.espresso.assertion.ViewAssertions.matches
2323
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
2424
import androidx.test.espresso.matcher.ViewMatchers.withId
2525
import androidx.test.espresso.matcher.ViewMatchers.withText
26-
import org.hamcrest.Matchers.matchesPattern
26+
import org.hamcrest.Matchers
2727

2828
internal class ConnectionInstrumentedTest : Runnable {
2929
override fun run() {
@@ -39,7 +39,7 @@ internal class ConnectionInstrumentedTest : Runnable {
3939

4040
private fun verifyIpAddressDisplayed() {
4141
val ipv4Pattern = "\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\b"
42-
onView(withText(matchesPattern(ipv4Pattern))).check(matches(isDisplayed()))
42+
onView(withText(Matchers.matchesPattern(ipv4Pattern))).check(matches(isDisplayed()))
4343
}
4444

4545
private fun verifyConnectionPopup() {

app/src/androidTest/kotlin/com/vrem/wifianalyzer/FilterInstrumentedTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ internal class FilterInstrumentedTest : Runnable {
5050
onView(allOf(withId(R.id.action_filter), isDisplayed())).perform(click())
5151
onView(withText("Filter")).check(matches(isDisplayed()))
5252
onView(withText("5 GHz")).perform(click())
53-
onView(allOf(withId(android.R.id.button3), isDisplayed())).perform(click())
53+
onView(allOf(withId(android.R.id.button3), isDisplayed())).perform(scrollTo(), click())
5454
onView(withText("Filter")).check(doesNotExist())
5555
}
5656

5757
private fun verifySsidFilter() {
5858
onView(allOf(withId(R.id.action_filter), isDisplayed())).perform(click())
5959
onView(withHint("ssid SSID")).perform(typeText("test"), closeSoftKeyboard())
60-
onView(allOf(withId(android.R.id.button3), isDisplayed())).perform(click())
60+
pauseShort()
61+
onView(allOf(withId(android.R.id.button3), isDisplayed())).perform(scrollTo(), click())
6162
onView(withText("Filter")).check(doesNotExist())
6263
onView(allOf(withId(R.id.action_filter), isDisplayed())).perform(click())
6364
onView(allOf(withId(android.R.id.button2), isDisplayed())).perform(scrollTo(), click())

app/src/androidTest/kotlin/com/vrem/wifianalyzer/ThemeInstrumentedTest.kt

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ package com.vrem.wifianalyzer
2020
import androidx.appcompat.app.AppCompatDelegate
2121
import androidx.test.espresso.Espresso.onView
2222
import androidx.test.espresso.action.ViewActions.click
23+
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
2324
import androidx.test.espresso.assertion.ViewAssertions.matches
2425
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
2526
import androidx.test.espresso.matcher.ViewMatchers.withText
26-
import org.junit.Assert.assertEquals
27+
import org.assertj.core.api.Assertions.assertThat
28+
29+
private const val SETTINGS = "Settings"
30+
31+
private const val THEME = "Theme"
2732

2833
internal class ThemeInstrumentedTest : Runnable {
2934
override fun run() {
@@ -41,17 +46,41 @@ internal class ThemeInstrumentedTest : Runnable {
4146
themeName: String,
4247
expectedNightMode: Int,
4348
) {
44-
selectMenuItem(R.id.nav_drawer_settings, "Settings")
45-
scrollToAndVerify("Theme")
46-
onView(withText("Theme")).perform(click())
49+
navigateToTheme()
50+
verifyThemeNotSelected(themeName)
51+
selectTheme(themeName)
4752
pauseShort()
53+
navigateToTheme()
54+
verifyThemeSelected(themeName)
55+
verifyNightMode(themeName, expectedNightMode)
56+
}
57+
58+
private fun verifyThemeNotSelected(themeName: String) {
59+
onView(withText(themeName)).check(doesNotExist())
60+
}
61+
62+
private fun selectTheme(themeName: String) {
63+
onView(withText(THEME)).perform(click())
4864
onView(withText(themeName)).check(matches(isDisplayed()))
4965
onView(withText(themeName)).perform(click())
50-
pauseShort()
51-
assertEquals(
52-
"Theme $themeName should set night mode to $expectedNightMode",
53-
expectedNightMode,
54-
AppCompatDelegate.getDefaultNightMode(),
55-
)
66+
}
67+
68+
private fun verifyThemeSelected(themeName: String) {
69+
onView(withText(themeName)).check(matches(isDisplayed()))
70+
}
71+
72+
private fun verifyNightMode(
73+
themeName: String,
74+
expectedNightMode: Int,
75+
) {
76+
assertThat(AppCompatDelegate.getDefaultNightMode())
77+
.withFailMessage("Theme %s should set night mode to %s", themeName, expectedNightMode)
78+
.isEqualTo(expectedNightMode)
79+
}
80+
81+
private fun navigateToTheme() {
82+
selectMenuItem(R.id.nav_drawer_settings, SETTINGS)
83+
scrollToAndVerify(THEME)
84+
onView(withText(THEME)).check(matches(isDisplayed()))
5685
}
5786
}

gradle.properties

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,16 @@ org.gradle.warning.mode=all
1717
# AndroidX and Jetifier settings
1818
android.useAndroidX=true
1919
android.enableJetifier=true
20-
android.nonFinalResIds=true
2120
android.jetifier.ignorelist=bcprov-jdk15on
2221

2322
# Kotlin code style
2423
kotlin.code.style=official
2524

26-
# Remove these lines entirely (use new defaults):
27-
# new default is false
28-
android.defaults.buildfeatures.resvalues=true
29-
# new default is true
30-
android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
31-
# new default is true
32-
android.enableAppCompileTimeRClass=false
33-
# new default is true
34-
android.usesSdkInManifest.disallowed=false
35-
# new default is true
25+
# Default: true | Low Kotlin version is explicitly managed in `build.gradle`.
3626
android.builtInKotlin=false
37-
# new default is true
27+
# Default: true | Build scripts may need DSL syntax updates.
3828
android.newDsl=false
39-
40-
# Keep these if needed for your project:
41-
android.uniquePackageNames=false
42-
android.dependency.useConstraints=true
43-
android.r8.strictFullModeForKeepRules=false
44-
android.r8.optimizedResourceShrinking=false
45-
46-
# Add this to suppress the constraint warning:
47-
android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false
29+
# Default: false | Release build may fail if R8 rules are incomplete.
30+
android.r8.strictFullModeForKeepRules=true
31+
# Default: false | Resources may be incorrectly removed, causing runtime crashes.
32+
android.r8.optimizedResourceShrinking=true

0 commit comments

Comments
 (0)