Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Commit 22c57a1

Browse files
authored
Merge pull request #1621 from RocketChat/beta
[RELEASE] 2.6.0 release
2 parents 797a06f + 658cee9 commit 22c57a1

216 files changed

Lines changed: 5052 additions & 1341 deletions

File tree

Some content is hidden

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

.circleci/config.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- store_artifacts:
6565
path: app/build/reports/
6666
destination: reports
67-
build-apk:
67+
build-play-apk:
6868
docker:
6969
- image: circleci/android:api-27-alpha
7070
environment:
@@ -93,7 +93,40 @@ jobs:
9393
- run:
9494
name: Build APK
9595
command: |
96-
./gradlew assembleRelease --info --console=plain --stacktrace
96+
./gradlew assemblePlayRelease --info --console=plain --stacktrace
97+
- store_artifacts:
98+
path: app/build/outputs/apk
99+
destination: apks
100+
build-foss-apk:
101+
docker:
102+
- image: circleci/android:api-27-alpha
103+
environment:
104+
JVM_OPTS: -Xmx3200m
105+
steps:
106+
- checkout
107+
- run:
108+
name: restore files from ENV
109+
command: |
110+
echo $ROCKET_JKS_BASE64 | base64 --decode > Rocket.jks
111+
echo $ROCKET_PLAY_JSON | base64 --decode > app/rocket-chat.json
112+
- run:
113+
name: checkout Rocket.Chat.Kotlin.SDK
114+
command: git clone https://github.com/RocketChat/Rocket.Chat.Kotlin.SDK.git ../Rocket.Chat.Kotlin.SDK
115+
- restore_cache:
116+
key: kotlin-sdk-{{ .Revision }}
117+
- restore_cache:
118+
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}
119+
- run:
120+
name: Download Dependencies
121+
command: ./gradlew androidDependencies --quiet --console=plain
122+
- save_cache:
123+
paths:
124+
- ~/.gradle
125+
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}
126+
- run:
127+
name: Build APK
128+
command: |
129+
./gradlew assembleFossRelease --info --console=plain --stacktrace
97130
- store_artifacts:
98131
path: app/build/outputs/apk
99132
destination: apks
@@ -112,6 +145,9 @@ workflows:
112145
- develop
113146
- develop-2.x
114147
- master
115-
- build-apk:
148+
- build-play-apk:
149+
requires:
150+
- build-kotlin-sdk
151+
- build-foss-apk:
116152
requires:
117153
- build-kotlin-sdk

app/build-sdk.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
#!/bin/bash
22

33
CURRENT_DIR=$(pwd)
4-
# The SDK dir should be 2 directories up in the tree, so we use dirname 2 times
5-
# to get the common parent dir of the SDK and the app
64
GIT=$(which git)
7-
cd ../..
8-
tmp=$(pwd)
9-
SDK_DIR="$tmp/Rocket.Chat.Kotlin.SDK"
10-
cd "${CURRENT_DIR}"
5+
6+
if [ "$#" -eq 1 ] && [ ! -z "$1" ]; then
7+
# if in an argument is given this is the (relative) path to SDK_DIR
8+
SDK_DIR=$(readlink -f $1)
9+
else
10+
# The SDK dir should be 2 directories up in the tree, so we use dirname 2 times
11+
# to get the common parent dir of the SDK and the app
12+
cd ../..
13+
tmp=$(pwd)
14+
SDK_DIR="$tmp/Rocket.Chat.Kotlin.SDK"
15+
cd "${CURRENT_DIR}"
16+
fi
1117

1218
echo "CURRENT DIR: $CURRENT_DIR"
1319
echo "SDK DIR: $SDK_DIR"
@@ -99,4 +105,4 @@ cp -v "${SDK_DIR}"/core/build/libs/core-0.1-SNAPSHOT.jar "${CURRENT_DIR}"/libs/c
99105

100106
echo "$SHA" > "${SDK_DIR}"/.last_commit_hash
101107

102-
exit 0
108+
exit 0

app/build.gradle

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString()
2+
def isPlay = !(taskRequests.contains("Foss") || taskRequests.contains("foss"))
3+
14
apply plugin: 'com.android.application'
2-
apply plugin: 'io.fabric'
5+
if (isPlay) { apply plugin: 'io.fabric' }
36
apply plugin: 'kotlin-android'
47
apply plugin: 'kotlin-android-extensions'
58
apply plugin: 'kotlin-kapt'
9+
apply plugin: "com.github.ben-manes.versions"
610

711
android {
812
compileSdkVersion versions.compileSdk
@@ -12,11 +16,15 @@ android {
1216
applicationId "chat.rocket.android"
1317
minSdkVersion versions.minSdk
1418
targetSdkVersion versions.targetSdk
15-
versionCode 2036
16-
versionName "2.5.1"
19+
versionCode 2042
20+
versionName "2.6.0"
1721
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1822
multiDexEnabled true
1923

24+
def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
25+
def buildTime = new GregorianCalendar().format("MM-dd-yyyy' 'h:mm:ss a z")
26+
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
27+
2028
javaCompileOptions {
2129
annotationProcessorOptions {
2230
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
@@ -57,6 +65,20 @@ android {
5765
}
5866
}
5967

68+
flavorDimensions "type"
69+
70+
productFlavors {
71+
// includes proprietary libs
72+
play {
73+
dimension "type"
74+
}
75+
76+
// only foss
77+
foss {
78+
dimension "type"
79+
}
80+
}
81+
6082
packagingOptions {
6183
exclude 'META-INF/core.kotlin_module'
6284
exclude 'META-INF/main.kotlin_module'
@@ -78,26 +100,27 @@ dependencies {
78100

79101
implementation libraries.appCompat
80102
implementation libraries.recyclerview
81-
implementation libraries.material
82103
implementation libraries.constraintlayout
83104
implementation libraries.cardview
84-
implementation libraries.flexbox
85105
implementation libraries.browser
86106

87107
implementation libraries.androidKtx
108+
implementation libraries.fragmentsKtx
88109

89110
implementation libraries.dagger
90111
implementation libraries.daggerSupport
91112
kapt libraries.daggerProcessor
92113
kapt libraries.daggerAndroidApt
93114

94-
implementation libraries.fcm
95-
implementation libraries.playServicesAuth
115+
implementation libraries.flexbox
116+
implementation libraries.material
96117

97118
implementation libraries.room
98119
kapt libraries.roomProcessor
99120
implementation libraries.lifecycleExtensions
100121
kapt libraries.lifecycleCompiler
122+
implementation libraries.viewmodelKtx
123+
implementation libraries.workmanager
101124

102125
implementation libraries.rxKotlin
103126
implementation libraries.rxAndroid
@@ -115,6 +138,8 @@ dependencies {
115138
implementation libraries.frescoWebP
116139
implementation libraries.frescoAnimatedWebP
117140

141+
implementation libraries.glide
142+
118143
kapt libraries.kotshiCompiler
119144
implementation libraries.kotshiApi
120145

@@ -124,11 +149,14 @@ dependencies {
124149

125150
implementation libraries.aVLoadingIndicatorView
126151

127-
implementation "com.github.luciofm:livedata-ktx:b1e8bbc25a"
152+
implementation libraries.livedataKtx
128153

129-
implementation('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
130-
transitive = true
131-
}
154+
// Proprietary libraries
155+
playImplementation libraries.fcm
156+
playImplementation libraries.firebaseAnalytics
157+
playImplementation libraries.playServicesAuth
158+
playImplementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') { transitive = true }
159+
playImplementation('com.crashlytics.sdk.android:answers:1.4.3@aar') { transitive = true }
132160

133161
testImplementation libraries.junit
134162
testImplementation libraries.truth
@@ -148,13 +176,16 @@ androidExtensions {
148176

149177
// FIXME - build and install the sdk into the app/libs directory
150178
// We were having some issues with the kapt generated files from the sdk when importing as a module
179+
180+
def sdk_location=project.properties['sdk_location'] ?: ""
151181
task compileSdk(type:Exec) {
152182
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
153-
commandLine 'cmd', '/c', 'build-sdk.sh'
183+
commandLine 'cmd', '/c', 'build-sdk.sh', sdk_location
154184
} else {
155-
commandLine './build-sdk.sh'
185+
commandLine './build-sdk.sh', sdk_location
156186
}
157187
}
158188
preBuild.dependsOn compileSdk
159-
160-
apply plugin: 'com.google.gms.google-services'
189+
if (isPlay) {
190+
apply plugin: 'com.google.gms.google-services'
191+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Feb 15 15:50:42 BRST 2018
1+
#Wed Aug 01 21:56:00 EDT 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

app/src/androidTest/java/chat/rocket/android/chatroom/ui/ChatRoomFragmentTest.kt

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,44 @@ class ChatRoomFragmentTest {
2424

2525
@Before
2626
fun stubAllExternalIntents() {
27-
val activityIntent = InstrumentationRegistry.getTargetContext().chatRoomIntent("id", "name", "type", false, 0L)
27+
val activityIntent = InstrumentationRegistry.getTargetContext()
28+
.chatRoomIntent("id", "name", "type", false, 0L)
2829
activityRule.launchActivity(activityIntent)
2930
intending(not(isInternal())).respondWith(ActivityResult(Activity.RESULT_OK, null))
3031
}
3132

3233
@Test
3334
fun showFileSelection_nonNullFiltersAreApplied() {
34-
val fragment = activityRule.activity.supportFragmentManager.findFragmentByTag(ChatRoomActivity.TAG_CHAT_ROOM_FRAGMENT) as ChatRoomFragment
35+
val fragment =
36+
activityRule.activity.supportFragmentManager.findFragmentByTag("ChatRoomFragment") as ChatRoomFragment
3537

3638
val filters = arrayOf("image/*")
3739
fragment.showFileSelection(filters)
3840

39-
intended(allOf(
41+
intended(
42+
allOf(
4043
hasAction(Intent.ACTION_GET_CONTENT),
4144
hasType("*/*"),
4245
hasCategories(setOf(Intent.CATEGORY_OPENABLE)),
43-
hasExtra(Intent.EXTRA_MIME_TYPES, filters)))
46+
hasExtra(Intent.EXTRA_MIME_TYPES, filters)
47+
)
48+
)
4449
}
4550

4651
@Test
4752
fun showFileSelection_nullFiltersAreNotApplied() {
48-
val fragment = activityRule.activity.supportFragmentManager.findFragmentByTag(ChatRoomActivity.TAG_CHAT_ROOM_FRAGMENT) as ChatRoomFragment
53+
val fragment =
54+
activityRule.activity.supportFragmentManager.findFragmentByTag("ChatRoomFragment") as ChatRoomFragment
4955

5056
fragment.showFileSelection(null)
5157

52-
intended(allOf(
58+
intended(
59+
allOf(
5360
hasAction(Intent.ACTION_GET_CONTENT),
5461
hasType("*/*"),
5562
hasCategories(setOf(Intent.CATEGORY_OPENABLE)),
56-
not(hasExtraWithKey(Intent.EXTRA_MIME_TYPES))))
63+
not(hasExtraWithKey(Intent.EXTRA_MIME_TYPES))
64+
)
65+
)
5766
}
5867
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package chat.rocket.android.analytics
2+
3+
import chat.rocket.android.analytics.event.AuthenticationEvent
4+
import chat.rocket.android.analytics.event.ScreenViewEvent
5+
import chat.rocket.android.analytics.event.SubscriptionTypeEvent
6+
7+
class AnswersAnalytics : Analytics {
8+
9+
override fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) {
10+
// Do absolutely nothing
11+
}
12+
13+
override fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) {
14+
// Do absolutely nothing
15+
}
16+
17+
override fun logScreenView(event: ScreenViewEvent) {
18+
// Do absolutely nothing
19+
}
20+
21+
override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) {
22+
// Do absolutely nothing
23+
}
24+
25+
override fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) {
26+
// Do absolutely nothing
27+
}
28+
29+
override fun logReaction(event: SubscriptionTypeEvent) {
30+
// Do absolutely nothing
31+
}
32+
33+
override fun logServerSwitch(serverUrl: String, serverCount: Int) {
34+
// Do absolutely nothing
35+
}
36+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package chat.rocket.android.analytics
2+
3+
import android.content.Context
4+
import chat.rocket.android.analytics.event.AuthenticationEvent
5+
import chat.rocket.android.analytics.event.ScreenViewEvent
6+
import chat.rocket.android.analytics.event.SubscriptionTypeEvent
7+
import javax.inject.Inject
8+
9+
class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
10+
Analytics {
11+
12+
override fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) {
13+
// Do absolutely nothing
14+
}
15+
16+
override fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) {
17+
// Do absolutely nothing
18+
}
19+
20+
override fun logScreenView(event: ScreenViewEvent) {
21+
// Do absolutely nothing
22+
}
23+
24+
override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) {
25+
// Do absolutely nothing
26+
}
27+
28+
override fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) {
29+
// Do absolutely nothing
30+
}
31+
32+
override fun logReaction(event: SubscriptionTypeEvent) {
33+
// Do absolutely nothing
34+
}
35+
36+
override fun logServerSwitch(serverUrl: String, serverCount: Int) {
37+
// Do absolutely nothing
38+
}
39+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package chat.rocket.android.dagger.module
2+
3+
import chat.rocket.android.chatroom.di.MessageServiceProvider
4+
import chat.rocket.android.chatroom.service.MessageService
5+
import dagger.Module
6+
import dagger.android.ContributesAndroidInjector
7+
8+
@Module abstract class ServiceBuilder {
9+
@ContributesAndroidInjector(modules = [MessageServiceProvider::class])
10+
abstract fun bindMessageService(): MessageService
11+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package chat.rocket.android.helper
2+
3+
import android.app.Activity
4+
import android.content.Intent
5+
import androidx.fragment.app.FragmentActivity
6+
7+
fun FragmentActivity.saveCredentials(id: String, password: String) {
8+
}
9+
10+
fun Activity.requestStoredCredentials(): Pair<String, String>? = null
11+
12+
fun getCredentials(data: Intent): Pair<String, String>? = null
13+
14+
fun hasCredentialsSupport() = false

0 commit comments

Comments
 (0)