Skip to content

Commit

Permalink
Merge branch 'main' into Remove_Date
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/org/wikipedia/dataclient/mwapi/MwQueryResult.kt
#	app/src/main/java/org/wikipedia/suggestededits/SuggestedEditsRecentEditsViewModel.kt
#	app/src/main/java/org/wikipedia/suggestededits/provider/EditingSuggestionsProvider.kt
#	app/src/main/java/org/wikipedia/usercontrib/UserInformationDialogViewModel.kt
#	app/src/main/java/org/wikipedia/views/EditHistoryStatsView.kt
  • Loading branch information
Isira-Seneviratne committed May 8, 2024
2 parents 2666804 + 60da647 commit 6e22e7c
Show file tree
Hide file tree
Showing 451 changed files with 23,585 additions and 6,548 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3
- name: Check for missing qq strings
run: ./scripts/missing-qq.py
- name: Checkout submodules
Expand All @@ -38,7 +38,7 @@ jobs:
run: git rev-parse HEAD > app/build/outputs/apk/alpha/release/rev-hash.txt
- name: Rename APK to universal
run: mv app/build/outputs/apk/alpha/release/app-alpha-release-signed.apk app/build/outputs/apk/alpha/release/app-alpha-universal-release.apk
- uses: dev-drprasad/delete-tag-and-release@v0.2.1
- uses: dev-drprasad/delete-tag-and-release@v1.1
name: Delete latest alpha tag and release
with:
tag_name: latest
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Sleep for 30 seconds, to allow the tag to be deleted
run: sleep 30s
shell: bash
- uses: ncipollo/release-action@v1.12.0
- uses: ncipollo/release-action@v1.14.0
name: Create new tag and release and upload artifacts
with:
name: latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/android_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Build, test, and lint
Expand All @@ -33,7 +33,7 @@ jobs:
env:
# override default build-tools version (29.0.3) -- optional
BUILD_TOOLS_VERSION: "34.0.0"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload APK artifact
with:
name: app_alpha_release
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/android_phab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Post to Phabricator

on:
pull_request:
types: [opened, closed]

jobs:
post_to_phab:
runs-on: ubuntu-latest
steps:
- name: Post to Phabricator when pull request is opened or closed
if: ${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'closed') }}
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
message="${{ github.actor }} ${{ github.event.action }} ${{ github.event.pull_request._links.html.href }}"
echo -e "${PR_BODY}" | grep -oEi "(^Bug:\s*T[0-9]+)|(^([*]*phabricator[*]*:[*]*\s*)?https:\/\/phabricator\.wikimedia\.org\/T[0-9]+)" | grep -oEi "T[0-9]+" | while IFS= read -r line; do
echo "Processing: $line"
curl https://phabricator.wikimedia.org/api/maniphest.edit \
-d api.token=${{ secrets.PHAB_BOT_API_KEY }} \
-d transactions[0][type]=comment \
-d transactions[0][value]="${message}" \
-d objectIdentifier=${line}
done
6 changes: 3 additions & 3 deletions .github/workflows/android_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v3
- uses: gradle/actions/wrapper-validation@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3
- name: Check for missing qq strings
run: ./scripts/missing-qq.py
- name: Build, test, and lint
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/android_smoke_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3

- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -26,7 +26,7 @@ jobs:

- name: Upload results
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: instrumentation-test-results ${{ matrix.api-level }}
path: ./**/build/reports/androidTests/connected/**
5 changes: 5 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# See: https://git-scm.com/docs/git-shortlog#_mapping_authors
#
Brooke Vibber <bvibber@wikimedia.org>
Brooke Vibber <bvibber@wikimedia.org> <brion@wikimedia.org>
Brooke Vibber <bvibber@wikimedia.org> <brion@pobox.com>
49 changes: 32 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
applicationId 'org.wikipedia'
minSdk 21
targetSdk 34
versionCode 50467
versionCode 50485
testApplicationId 'org.wikipedia.test'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'
Expand Down Expand Up @@ -65,13 +65,16 @@ android {
buildConfig true
}

androidResources {
generateLocaleConfig = true
}

sourceSets {

prod { java.srcDirs += 'src/extra/java' }
beta { java.srcDirs += 'src/extra/java' }
alpha { java.srcDirs += 'src/extra/java' }
dev { java.srcDirs += 'src/extra/java' }
custom { java.srcDirs += 'src/extra/java' }
[ prod, beta, alpha, dev, custom ].forEach {
it.java.srcDirs += 'src/extra/java'
it.res.srcDirs += 'src/extra/res'
}

androidTest {
assets.srcDirs += files("$projectDir/schemas".toString())
Expand Down Expand Up @@ -169,17 +172,18 @@ dependencies {
// Debug with ./gradlew -q app:dependencies --configuration compile

String okHttpVersion = '4.12.0'
String retrofitVersion = '2.9.0'
String retrofitVersion = '2.11.0'
String glideVersion = '4.16.0'
String mockitoVersion = '5.2.0'
String leakCanaryVersion = '2.13'
String kotlinCoroutinesVersion = '1.7.3'
String firebaseMessagingVersion = '23.4.0'
String mlKitVersion = '17.0.4'
String leakCanaryVersion = '2.14'
String kotlinCoroutinesVersion = '1.8.0'
String firebaseMessagingVersion = '23.4.1'
String mlKitVersion = '17.0.5'
String googlePayVersion = '19.3.0'
String roomVersion = "2.6.1"
String espressoVersion = '3.5.1'
String serialization_version = '1.6.2'
String metricsVersion = '2.1'
String serialization_version = '1.6.3'
String metricsVersion = '2.4'

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

Expand All @@ -190,8 +194,8 @@ dependencies {

implementation "com.google.android.material:material:1.11.0"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation "androidx.core:core-ktx:1.12.0"
implementation "androidx.browser:browser:1.7.0"
implementation "androidx.core:core-ktx:1.13.0"
implementation "androidx.browser:browser:1.8.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.fragment:fragment-ktx:1.6.2"
implementation "androidx.paging:paging-runtime-ktx:3.2.1"
Expand All @@ -213,6 +217,7 @@ dependencies {
implementation "com.github.bumptech.glide:okhttp3-integration:$glideVersion"
ksp "com.github.bumptech.glide:ksp:$glideVersion"

implementation "com.squareup.okhttp3:okhttp-tls:$okHttpVersion"
implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava3:$retrofitVersion"
Expand All @@ -224,6 +229,9 @@ dependencies {
implementation 'com.github.skydoves:balloon:1.6.4'
implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0"

implementation 'org.maplibre.gl:android-sdk:10.3.0'
implementation 'org.maplibre.gl:android-plugin-annotation-v9:2.0.2'

implementation("androidx.room:room-runtime:$roomVersion")
annotationProcessor "androidx.room:room-compiler:$roomVersion"
ksp "androidx.room:room-compiler:$roomVersion"
Expand All @@ -244,12 +252,19 @@ dependencies {
devImplementation "com.google.firebase:firebase-messaging-ktx:$firebaseMessagingVersion"
customImplementation "com.google.firebase:firebase-messaging-ktx:$firebaseMessagingVersion"

// For integrating with Google Pay for donations
prodImplementation "com.google.android.gms:play-services-wallet:$googlePayVersion"
betaImplementation "com.google.android.gms:play-services-wallet:$googlePayVersion"
alphaImplementation "com.google.android.gms:play-services-wallet:$googlePayVersion"
devImplementation "com.google.android.gms:play-services-wallet:$googlePayVersion"
customImplementation "com.google.android.gms:play-services-wallet:$googlePayVersion"

debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
implementation "com.squareup.leakcanary:plumber-android:$leakCanaryVersion"

testImplementation 'junit:junit:4.13.2'
testImplementation "org.mockito:mockito-inline:$mockitoVersion"
testImplementation 'org.robolectric:robolectric:4.11.1'
testImplementation 'org.robolectric:robolectric:4.12.1'
testImplementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
testImplementation "com.squareup.okhttp3:mockwebserver:$okHttpVersion"
testImplementation 'org.hamcrest:hamcrest:2.2'
Expand All @@ -260,7 +275,7 @@ dependencies {
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-web:$espressoVersion"
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.3.0'
androidTestImplementation "androidx.room:room-testing:$roomVersion"
androidTestUtil 'androidx.test:orchestrator:1.4.2'
}
Expand Down
20 changes: 19 additions & 1 deletion app/src/androidTest/java/org/wikipedia/TestUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ import android.view.View
import android.view.ViewGroup
import androidx.annotation.ColorInt
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.UiController
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.*
import androidx.test.espresso.ViewInteraction
import androidx.test.espresso.action.CoordinatesProvider
import androidx.test.espresso.action.GeneralLocation
import androidx.test.espresso.action.GeneralSwipeAction
import androidx.test.espresso.action.Press
import androidx.test.espresso.action.Swipe
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By
Expand All @@ -27,6 +36,15 @@ object TestUtil {
return WithGrandparentMatcher(grandparentMatcher)
}

fun ViewInteraction.isDisplayed(): Boolean {
return try {
check(matches(ViewMatchers.isDisplayed()))
true
} catch (e: NoMatchingViewException) {
false
}
}

fun isNotVisible(): Matcher<View> {
return IsNotVisibleMatcher()
}
Expand Down

0 comments on commit 6e22e7c

Please sign in to comment.