Skip to content

Commit

Permalink
Merge branch 'release/tchap_v2.10.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
yostyle committed Jan 15, 2024
2 parents aab5fe0 + 61c9513 commit e0164e6
Show file tree
Hide file tree
Showing 49 changed files with 3,948 additions and 55 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [ GplayDevTchapWithoutvoipWithoutpinning, FdroidDevTchapWithoutvoipWithoutpinning, GplayBtchapWithvoipWithpinning ]
target: [ GplayDevTchapWithdmvoipWithoutpinning, FdroidDevTchapWithdmvoipWithoutpinning, GplayBtchapWithvoipWithpinning ]
# Allow all jobs on develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/develop' && format('integration-tests-develop-{0}-{1}', matrix.target, github.sha) || format('build-debug-{0}-{1}', matrix.target, github.ref) }}
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [ GplayBtchapWithoutvoipWithpinning, GplayTchapWithoutvoipWithpinning, FdroidBtchapWithoutvoipWithoutpinning, FdroidTchapWithoutvoipWithoutpinning, GplayBtchapWithvoipWithpinning ]
target: [ GplayBtchapWithdmvoipWithpinning, GplayTchapWithdmvoipWithpinning, FdroidBtchapWithdmvoipWithoutpinning, FdroidTchapWithdmvoipWithoutpinning, GplayBtchapWithvoipWithpinning ]
concurrency:
# Tchap: custom group
group: ${{ github.ref == 'refs/head/main' && format('build-release-apk-main-{0}-{1}', github.sha, matrix.target) || startsWith(github.ref, 'refs/tags/tchap_v') && format('build-release-apk-tag-{0}-{1}', github.sha, matrix.target) }}
Expand Down Expand Up @@ -82,8 +82,8 @@ jobs:
needs: release
env:
# Tchap: only generate exodus report for the following target
TARGET_NAME: "GplayTchapWithoutvoipWithpinning"
TARGET_FOLDER: "gplayTchapWithoutvoipWithpinning"
TARGET_NAME: "GplayTchapWithdmvoipWithpinning"
TARGET_FOLDER: "gplayTchapWithdmvoipWithpinning"
steps:
- name: Obtain apk from artifact
id: download
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ jobs:
- name: Run lint
# Not always, if ktlint or detekt fail, avoid running the long lint check.
run: |
./gradlew vector-app:lintGplayBtchapWithoutvoipWithpinningRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintFdroidBtchapWithoutvoipWithoutpinningRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintGplayBtchapWithdmvoipWithpinningRelease $CI_GRADLE_ARG_PROPERTIES
./gradlew vector-app:lintFdroidBtchapWithdmvoipWithoutpinningRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload reports
if: always()
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanity_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
touch emulator.log
chmod 777 emulator.log
adb logcat >> emulator.log &
./gradlew $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false connectedGplayBtchapWithoutvoipWithoutpinningDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || adb pull storage/emulated/0/Pictures/failure_screenshots && exit 1
./gradlew $CI_GRADLE_ARG_PROPERTIES -PallWarningsAsErrors=false connectedGplayBtchapWithdmvoipWithoutpinningDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest || adb pull storage/emulated/0/Pictures/failure_screenshots && exit 1
- name: Upload Test Report Log
uses: actions/upload-artifact@v2
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
disable-animations: true
# emulator-build: 7425822
script: |
./gradlew gatherGplayTchapWithoutvoipWithpinningDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
./gradlew gatherGplayTchapWithdmvoipWithpinningDebugStringTemplates $CI_GRADLE_ARG_PROPERTIES
./gradlew unitTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
./gradlew instrumentationTestsWithCoverage $CI_GRADLE_ARG_PROPERTIES
./gradlew generateCoverageReport $CI_GRADLE_ARG_PROPERTIES
Expand Down
8 changes: 8 additions & 0 deletions TCHAP_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Changes in Tchap 2.10.0 (2024-01-15)
====================================

Features ✨
----------
- Activation des appels audios dans les DM. ([#993](https://github.com/tchapgouv/tchap-android/issues/993))


Changes in Tchap 2.9.8 (2023-12-22)
===================================

Expand Down
4 changes: 2 additions & 2 deletions coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ task unitTestsWithCoverage(type: GradleBuild) {
// the 7.1.3 android gradle plugin has a bug where enableTestCoverage generates invalid coverage
startParameter.projectProperties.coverage = "false"
// Tchap: Specify variant for every module
tasks = [/*':matrix-sdk-android:testDebugUnitTest',*/ ':vector:testGplayBtchapWithoutvoipWithoutpinningDebugUnitTest', ':vector-app:testGplayBtchapWithoutvoipWithoutpinningDebugUnitTest', ':vector-config:testBtchapWithoutvoipDebugUnitTest']
tasks = [/*':matrix-sdk-android:testDebugUnitTest',*/ ':vector:testGplayBtchapWithdmvoipWithoutpinningDebugUnitTest', ':vector-app:testGplayBtchapWithdmvoipWithoutpinningDebugUnitTest', ':vector-config:testBtchapWithdmvoipDebugUnitTest']
}

task instrumentationTestsWithCoverage(type: GradleBuild) {
startParameter.projectProperties.coverage = "true"
startParameter.projectProperties['android.testInstrumentationRunnerArguments.notPackage'] = 'im.vector.app.ui'
tasks = [':vector-app:connectedGplayBtchapWithoutvoipWithoutpinningDebugAndroidTest', ':vector:connectedGplayBtchapWithoutvoipWithoutpinningDebugAndroidTest'/*, 'matrix-sdk-android:connectedDebugAndroidTest'*/]
tasks = [':vector-app:connectedGplayBtchapWithdmvoipWithoutpinningDebugAndroidTest', ':vector:connectedGplayBtchapWithdmvoipWithoutpinningDebugAndroidTest'/*, 'matrix-sdk-android:connectedDebugAndroidTest'*/]
}
2 changes: 1 addition & 1 deletion towncrier.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.towncrier]
version = "2.9.8"
version = "2.10.0"
directory = "changelog.d"
filename = "TCHAP_CHANGES.md"
name = "Changes in Tchap"
Expand Down
80 changes: 64 additions & 16 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ knit {

// Note: 2 digits max for each value
ext.versionMajor = 2
ext.versionMinor = 9
ext.versionMinor = 10
// Note: even values are reserved for regular release, odd values for hotfix release.
// When creating a hotfix, you should decrease the value, since the current value
// is the value for the next regular release.
ext.versionPatch = 8
ext.versionPatch = 0

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down Expand Up @@ -350,21 +350,12 @@ android {
buildConfigField "String", "FLAVOR_DESCRIPTION", "\"FDroid\""
}

withvoip {
dimension "voip"
}

withoutvoip {
dimension "voip"
}
withvoip { dimension "voip" }
withdmvoip { dimension "voip" }
withoutvoip { dimension "voip" }

withpinning {
dimension "pinning"
}

withoutpinning {
dimension "pinning"
}
withpinning { dimension "pinning" }
withoutpinning { dimension "pinning" }

devTchap {
dimension "target"
Expand Down Expand Up @@ -470,6 +461,24 @@ configurations {
gplayBtchapWithoutvoipWithoutpinningDebugImplementation
gplayDevTchapWithoutvoipWithoutpinningDebugImplementation
gplayTchapWithoutvoipWithoutpinningDebugImplementation


fdroidBtchapWithdmvoipWithpinningDebugImplementation
fdroidDevTchapWithdmvoipWithpinningDebugImplementation
fdroidTchapWithdmvoipWithpinningDebugImplementation

gplayBtchapWithdmvoipWithpinningDebugImplementation
gplayDevTchapWithdmvoipWithpinningDebugImplementation
gplayTchapWithdmvoipWithpinningDebugImplementation


fdroidBtchapWithdmvoipWithoutpinningDebugImplementation
fdroidDevTchapWithdmvoipWithoutpinningDebugImplementation
fdroidTchapWithdmvoipWithoutpinningDebugImplementation

gplayBtchapWithdmvoipWithoutpinningDebugImplementation
gplayDevTchapWithdmvoipWithoutpinningDebugImplementation
gplayTchapWithdmvoipWithoutpinningDebugImplementation
}

dependencies {
Expand Down Expand Up @@ -592,6 +601,45 @@ dependencies {
fdroidDevTchapWithoutvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidDevTchapWithoutvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)


gplayBtchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
gplayBtchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
gplayTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayDevTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
gplayDevTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)


fdroidBtchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
fdroidBtchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
fdroidTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidDevTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipper)
fdroidDevTchapWithdmvoipWithoutpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)


gplayBtchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
gplayBtchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
gplayTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

gplayDevTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
gplayDevTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidBtchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidBtchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

fdroidDevTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipper)
fdroidDevTchapWithdmvoipWithpinningDebugImplementation(libs.flipper.flipperNetworkPlugin)

debugImplementation 'com.facebook.soloader:soloader:0.10.4'
debugImplementation "com.kgurgul.flipper:flipper-realm-android:2.2.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.test.platform.app.InstrumentationRegistry
import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import im.vector.app.R
import im.vector.app.core.resources.BooleanProvider
import im.vector.app.core.resources.StringArrayProvider
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.VectorFeatures
Expand All @@ -32,7 +33,7 @@ class NewRoomRobot(
private val labsPreferences: LabFeaturesPreferences
) {
private val context = InstrumentationRegistry.getInstrumentation().targetContext
private val features: VectorFeatures = DefaultVectorFeatures(BooleanProvider(context.resources))
private val features: VectorFeatures = DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources))

fun createNewRoom(block: CreateNewRoomRobot.() -> Unit) {
clickOn(R.string.create_new_room)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn
import com.adevinta.android.barista.interaction.BaristaEditTextInteractions.writeTo
import im.vector.app.R
import im.vector.app.core.resources.BooleanProvider
import im.vector.app.core.resources.StringArrayProvider
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.debug.features.DebugFeatureKeys
Expand All @@ -40,9 +41,10 @@ class OnboardingRobot {

// Tchap: Override default feature values for tests
private val context = InstrumentationRegistry.getInstrumentation().targetContext
private val defaultVectorFeatures = DebugVectorFeatures(context, DefaultVectorFeatures(BooleanProvider(context.resources))).apply {
override(true, DebugFeatureKeys.tchapIsKeyBackupEnabled)
}
private val defaultVectorFeatures =
DebugVectorFeatures(context, DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources))).apply {
override(true, DebugFeatureKeys.tchapIsKeyBackupEnabled)
}

fun crawl() {
waitUntilViewVisible(withId(R.id.loginSplashSubmit))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.adevinta.android.barista.interaction.BaristaDrawerInteractions.openDr
import com.adevinta.android.barista.internal.viewaction.ClickChildAction
import im.vector.app.R
import im.vector.app.core.resources.BooleanProvider
import im.vector.app.core.resources.StringArrayProvider
import im.vector.app.espresso.tools.waitUntilDialogVisible
import im.vector.app.espresso.tools.waitUntilViewVisible
import im.vector.app.features.DefaultVectorFeatures
Expand All @@ -37,7 +38,7 @@ import org.hamcrest.Matchers

class SpaceRobot(private val labsPreferences: LabFeaturesPreferences) {
private val context = InstrumentationRegistry.getInstrumentation().targetContext
private val features: VectorFeatures = DefaultVectorFeatures(BooleanProvider(context.resources))
private val features: VectorFeatures = DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources))

fun createSpace(isFirstSpace: Boolean, block: SpaceCreateRobot.() -> Unit) {
if (labsPreferences.isNewAppLayoutEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import im.vector.app.core.resources.BooleanProvider
import im.vector.app.core.resources.StringArrayProvider
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.DefaultVectorOverrides
import im.vector.app.features.VectorFeatures
Expand All @@ -43,8 +44,8 @@ interface FeaturesModule {
companion object {

@Provides
fun providesDefaultVectorFeatures(booleanProvider: BooleanProvider): DefaultVectorFeatures {
return DefaultVectorFeatures(booleanProvider)
fun providesDefaultVectorFeatures(stringArrayProvider: StringArrayProvider, booleanProvider: BooleanProvider): DefaultVectorFeatures {
return DefaultVectorFeatures(stringArrayProvider, booleanProvider)
}

@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DebugVectorFeatures(

private val dataStore = context.dataStore

override fun tchapIsVoipSupported() = vectorFeatures.tchapIsVoipSupported()
override fun tchapIsVoipSupported(homeServerUrl: String) = vectorFeatures.tchapIsVoipSupported(homeServerUrl)

override fun tchapIsCrossSigningEnabled() = vectorFeatures.tchapIsCrossSigningEnabled()

Expand Down
8 changes: 3 additions & 5 deletions vector-app/src/main/java/im/vector/app/VectorApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@ class VectorApplication :
vectorUncaughtExceptionHandler.activate()

// Remove Log handler statically added by Jitsi
if (vectorFeatures.tchapIsVoipSupported()) {
Timber.forest()
.filter { it::class.java.name == "org.jitsi.meet.sdk.log.JitsiMeetDefaultLogHandler" }
.forEach { Timber.uproot(it) }
}
Timber.forest()
.filter { it::class.java.name == "org.jitsi.meet.sdk.log.JitsiMeetDefaultLogHandler" }
.forEach { Timber.uproot(it) }

if (buildMeta.isDebug) {
Timber.plant(Timber.DebugTree())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import im.vector.app.core.resources.BooleanProvider
import im.vector.app.core.resources.StringArrayProvider
import im.vector.app.features.DefaultVectorFeatures
import im.vector.app.features.DefaultVectorOverrides
import im.vector.app.features.VectorFeatures
Expand All @@ -31,8 +32,8 @@ import im.vector.app.features.VectorOverrides
object FeaturesModule {

@Provides
fun providesFeatures(booleanProvider: BooleanProvider): VectorFeatures {
return DefaultVectorFeatures(booleanProvider)
fun providesFeatures(stringArrayProvider: StringArrayProvider, booleanProvider: BooleanProvider): VectorFeatures {
return DefaultVectorFeatures(stringArrayProvider, booleanProvider)
}

@Provides
Expand Down
1 change: 1 addition & 0 deletions vector-config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android {

productFlavors {
withvoip { dimension "voip" }
withdmvoip { dimension "voip" }
withoutvoip { dimension "voip" }

devTchap { dimension "target" }
Expand Down
2 changes: 2 additions & 0 deletions vector-config/src/btchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
<bool name="tchap_is_cross_signing_enabled">true</bool>
<bool name="tchap_is_key_backup_enabled">true</bool>
<bool name="tchap_is_thread_enabled">false</bool>

<string-array name="tchap_is_voip_supported_homeservers" translatable="false" />
</resources>
2 changes: 2 additions & 0 deletions vector-config/src/devTchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
<bool name="tchap_is_cross_signing_enabled">true</bool>
<bool name="tchap_is_key_backup_enabled">true</bool>
<bool name="tchap_is_thread_enabled">false</bool>

<string-array name="tchap_is_voip_supported_homeservers" translatable="false" />
</resources>
4 changes: 4 additions & 0 deletions vector-config/src/tchap/res/values/config-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
<bool name="tchap_is_cross_signing_enabled">true</bool>
<bool name="tchap_is_key_backup_enabled">true</bool>
<bool name="tchap_is_thread_enabled">false</bool>

<string-array name="tchap_is_voip_supported_homeservers" translatable="false">
<item>agent.dinum.tchap.gouv.fr</item>
</string-array>
</resources>
4 changes: 4 additions & 0 deletions vector-config/src/withdmvoip/res/values/config-features.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="tchap_is_voip_supported">true</bool>
</resources>
2 changes: 2 additions & 0 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ android {
}

withvoip { dimension "voip" }
withdmvoip { dimension "voip" }
withoutvoip { dimension "voip" }

withpinning { dimension "pinning" }
Expand Down Expand Up @@ -272,6 +273,7 @@ dependencies {
// Tchap: Manage jitsi lib
// WebRTC
withoutvoipImplementation('org.jitsi:webrtc:111.0.1')
withdmvoipImplementation('org.jitsi:webrtc:111.0.1')
// Jitsi
withvoipApi('org.jitsi.react:jitsi-meet-sdk:8.1.1') {
exclude group: 'com.google.firebase'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import android.os.Build
import androidx.test.platform.app.InstrumentationRegistry
import im.vector.app.TestBuildVersionSdkIntProvider
import im.vector.app.core.resources.BooleanProvider
import im.vector.app.core.resources.StringArrayProvider
import im.vector.app.features.DefaultVectorFeatures
import io.mockk.every
import io.mockk.spyk
Expand All @@ -30,7 +31,13 @@ class VoiceRecorderProviderTests {

private val context = InstrumentationRegistry.getInstrumentation().targetContext
private val buildVersionSdkIntProvider = TestBuildVersionSdkIntProvider()
private val provider = spyk(VoiceRecorderProvider(context, DefaultVectorFeatures(BooleanProvider(context.resources)), buildVersionSdkIntProvider))
private val provider = spyk(
VoiceRecorderProvider(
context,
DefaultVectorFeatures(StringArrayProvider(context.resources), BooleanProvider(context.resources)),
buildVersionSdkIntProvider
)
)

@Test
fun provideVoiceRecorderOnAndroidQAndCodecReturnsQRecorder() {
Expand Down
Loading

0 comments on commit e0164e6

Please sign in to comment.