Skip to content

Commit 8f74d70

Browse files
Merge branch 'main' into On-this-day-refactor
2 parents 4ebf22b + e91f63e commit 8f74d70

File tree

473 files changed

+20105
-5616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+20105
-5616
lines changed

.github/workflows/android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v5
12-
- uses: actions/setup-java@v4
12+
- uses: actions/setup-java@v5
1313
with:
1414
distribution: 'temurin'
1515
java-version: '17'
@@ -48,7 +48,7 @@ jobs:
4848
- name: Sleep for 30 seconds, to allow the tag to be deleted
4949
run: sleep 30s
5050
shell: bash
51-
- uses: ncipollo/release-action@v1.18.0
51+
- uses: ncipollo/release-action@v1.20.0
5252
name: Create new tag and release and upload artifacts
5353
with:
5454
name: latest

.github/workflows/android_branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v5
13-
- uses: actions/setup-java@v4
13+
- uses: actions/setup-java@v5
1414
with:
1515
distribution: 'temurin'
1616
java-version: '17'

.github/workflows/android_offline_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v5
15-
- uses: actions/setup-java@v4
15+
- uses: actions/setup-java@v5
1616
with:
1717
distribution: 'temurin'
1818
java-version: '17'

.github/workflows/android_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v5
13-
- uses: gradle/actions/wrapper-validation@v4
14-
- uses: actions/setup-java@v4
13+
- uses: gradle/actions/wrapper-validation@v5
14+
- uses: actions/setup-java@v5
1515
with:
1616
distribution: 'temurin'
1717
java-version: '17'

.github/workflows/android_smoke_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v5
15-
- uses: actions/setup-java@v4
15+
- uses: actions/setup-java@v5
1616
with:
1717
distribution: 'temurin'
1818
java-version: '17'

app/build.gradle

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
id 'com.android.application'
35
id 'com.google.devtools.ksp'
@@ -18,27 +20,27 @@ static def computeVersionName(versionCode, label) {
1820
return "2.7.${versionCode}-${label}-${(new Date()).format('yyyy-MM-dd')}"
1921
}
2022

21-
final JavaVersion JAVA_VERSION = JavaVersion.VERSION_17
22-
2323
android {
24-
compileSdk 35
24+
compileSdk = 36
2525

2626
compileOptions {
27-
coreLibraryDesugaringEnabled true
27+
coreLibraryDesugaringEnabled = true
2828

29-
sourceCompatibility = JAVA_VERSION
30-
targetCompatibility = JAVA_VERSION
29+
sourceCompatibility = JavaVersion.VERSION_17
30+
targetCompatibility = JavaVersion.VERSION_17
3131
}
3232

33-
kotlinOptions {
34-
jvmTarget = JAVA_VERSION
33+
kotlin {
34+
compilerOptions {
35+
jvmTarget = JvmTarget.JVM_17
36+
}
3537
}
3638

3739
defaultConfig {
3840
applicationId 'org.wikipedia'
39-
minSdk 21
40-
targetSdk 35
41-
versionCode 50544
41+
minSdk = 23
42+
targetSdk = 36
43+
versionCode 50555
4244
testApplicationId 'org.wikipedia.test'
4345
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4446
testInstrumentationRunnerArguments clearPackageData: 'true'
@@ -205,6 +207,7 @@ dependencies {
205207
implementation libs.photoview
206208
implementation libs.balloon
207209
implementation libs.retrofit2.kotlinx.serialization.converter
210+
implementation(libs.paging.compose)
208211

209212
implementation libs.android.sdk
210213
implementation libs.android.plugin.annotation.v9

app/src/androidTest/java/org/wikipedia/base/BaseTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ data class DataInjector(
3838
val intentBuilder: (Intent.() -> Unit)? = null,
3939
val showOneTimeCustomizeToolbarTooltip: Boolean = false,
4040
val readingListShareTooltipShown: Boolean = true,
41-
val otdEntryDialogShown: Boolean = true
41+
val otdEntryDialogShown: Boolean = true,
42+
val enableYearInReview: Boolean = false,
4243
)
4344

4445
abstract class BaseTest<T : AppCompatActivity>(
@@ -70,6 +71,7 @@ abstract class BaseTest<T : AppCompatActivity>(
7071
Prefs.showOneTimeCustomizeToolbarTooltip = dataInjector.showOneTimeCustomizeToolbarTooltip
7172
Prefs.readingListShareTooltipShown = dataInjector.readingListShareTooltipShown
7273
Prefs.otdEntryDialogShown = dataInjector.otdEntryDialogShown
74+
Prefs.isYearInReviewEnabled = dataInjector.enableYearInReview
7375
dataInjector.overrideEditsContribution?.let {
7476
Prefs.overrideSuggestedEditContribution = it
7577
}

app/src/androidTest/java/org/wikipedia/base/actions/ListActions.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,23 @@ class ListActions {
206206
)
207207
}
208208

209+
fun verifyItemExistWithText(
210+
recyclerViewId: Int,
211+
text: String
212+
) {
213+
onView(withId(recyclerViewId))
214+
.check(
215+
matches(
216+
hasDescendant(
217+
allOf(
218+
withText(text),
219+
isDisplayed()
220+
)
221+
)
222+
)
223+
)
224+
}
225+
209226
private fun verifyItemAtPosition(
210227
recyclerViewId: Int,
211228
position: Int,

app/src/androidTest/java/org/wikipedia/database/AppDatabaseTests.kt

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ import androidx.room.Room
55
import androidx.test.core.app.ApplicationProvider
66
import androidx.test.ext.junit.runners.AndroidJUnit4
77
import androidx.test.platform.app.InstrumentationRegistry
8-
import kotlinx.coroutines.*
9-
import kotlinx.coroutines.flow.count
10-
import kotlinx.coroutines.flow.first
11-
import org.hamcrest.CoreMatchers.*
8+
import kotlinx.coroutines.CoroutineExceptionHandler
9+
import kotlinx.coroutines.CoroutineScope
10+
import kotlinx.coroutines.Dispatchers
11+
import kotlinx.coroutines.launch
12+
import kotlinx.coroutines.runBlocking
13+
import kotlinx.coroutines.withContext
14+
import org.hamcrest.CoreMatchers.equalTo
15+
import org.hamcrest.CoreMatchers.notNullValue
16+
import org.hamcrest.CoreMatchers.nullValue
1217
import org.hamcrest.MatcherAssert.assertThat
1318
import org.junit.After
1419
import org.junit.Before
@@ -22,7 +27,7 @@ import org.wikipedia.search.db.RecentSearchDao
2227
import org.wikipedia.talk.db.TalkPageSeen
2328
import org.wikipedia.talk.db.TalkPageSeenDao
2429
import org.wikipedia.util.log.L
25-
import java.util.*
30+
import java.util.Date
2631

2732
@RunWith(AndroidJUnit4::class)
2833
class AppDatabaseTests {
@@ -100,8 +105,8 @@ class AppDatabaseTests {
100105

101106
notificationDao.insertNotifications(notifications)
102107

103-
var enWikiList = notificationDao.getNotificationsByWiki(listOf("enwiki")).first()
104-
val zhWikiList = notificationDao.getNotificationsByWiki(listOf("zhwiki")).first()
108+
var enWikiList = notificationDao.getNotificationsByWiki(listOf("enwiki"))
109+
val zhWikiList = notificationDao.getNotificationsByWiki(listOf("zhwiki"))
105110
assertThat(enWikiList, notNullValue())
106111
assertThat(enWikiList.first().id, equalTo(123759827))
107112
assertThat(zhWikiList.first().id, equalTo(2470933))
@@ -114,18 +119,18 @@ class AppDatabaseTests {
114119
notificationDao.updateNotification(firstEnNotification)
115120

116121
// get updated item
117-
enWikiList = notificationDao.getNotificationsByWiki(listOf("enwiki")).first()
122+
enWikiList = notificationDao.getNotificationsByWiki(listOf("enwiki"))
118123
assertThat(enWikiList.first().id, equalTo(123759827))
119124
assertThat(enWikiList.first().isUnread, equalTo(true))
120125

121126
notificationDao.deleteNotification(firstEnNotification)
122127
assertThat(notificationDao.getAllNotifications().size, equalTo(2))
123-
assertThat(notificationDao.getNotificationsByWiki(listOf("enwiki")).first().size, equalTo(1))
128+
assertThat(notificationDao.getNotificationsByWiki(listOf("enwiki")).size, equalTo(1))
124129

125-
notificationDao.deleteNotification(notificationDao.getNotificationsByWiki(listOf("enwiki")).first().first())
126-
assertThat(notificationDao.getNotificationsByWiki(listOf("enwiki")).first().isEmpty(), equalTo(true))
130+
notificationDao.deleteNotification(notificationDao.getNotificationsByWiki(listOf("enwiki")).first())
131+
assertThat(notificationDao.getNotificationsByWiki(listOf("enwiki")).isEmpty(), equalTo(true))
127132

128-
notificationDao.deleteNotification(notificationDao.getNotificationsByWiki(listOf("zhwiki")).first().first())
133+
notificationDao.deleteNotification(notificationDao.getNotificationsByWiki(listOf("zhwiki")).first())
129134
assertThat(notificationDao.getAllNotifications().isEmpty(), equalTo(true))
130135
}
131136
}

app/src/androidTest/java/org/wikipedia/database/UpgradeFromPreRoomTest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import androidx.room.Room
44
import androidx.room.testing.MigrationTestHelper
55
import androidx.test.core.app.ApplicationProvider
66
import androidx.test.platform.app.InstrumentationRegistry
7-
import kotlinx.coroutines.flow.first
87
import kotlinx.coroutines.runBlocking
98
import org.hamcrest.CoreMatchers.equalTo
109
import org.hamcrest.CoreMatchers.nullValue
@@ -123,7 +122,7 @@ class UpgradeFromPreRoomTest(private val fromVersion: Int) {
123122
val historyEntry = historyDao.findEntryBy("ru.wikipedia.org", "ru", "Обама,_Барак")!!
124123
assertThat(historyEntry.displayTitle, equalTo("Обама, Барак"))
125124

126-
val talkPageSeen = talkPageSeenDao.getAll().first()
125+
val talkPageSeen = talkPageSeenDao.getAll()
127126
if (fromVersion == 22) {
128127
assertThat(talkPageSeen.count(), equalTo(2))
129128
assertThat(offlineObjectDao.getOfflineObject("https://en.wikipedia.org/api/rest_v1/page/summary/Joe_Biden")!!.path, equalTo("/data/user/0/org.wikipedia.dev/files/offline_files/481b1ef996728fd9994bd97ab19733d8"))

0 commit comments

Comments
 (0)