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

Commit

Permalink
Merge pull request #1621 from RocketChat/beta
Browse files Browse the repository at this point in the history
[RELEASE] 2.6.0 release
  • Loading branch information
rafaelks authored Sep 10, 2018
2 parents 797a06f + 658cee9 commit 22c57a1
Show file tree
Hide file tree
Showing 216 changed files with 5,052 additions and 1,341 deletions.
42 changes: 39 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- store_artifacts:
path: app/build/reports/
destination: reports
build-apk:
build-play-apk:
docker:
- image: circleci/android:api-27-alpha
environment:
Expand Down Expand Up @@ -93,7 +93,40 @@ jobs:
- run:
name: Build APK
command: |
./gradlew assembleRelease --info --console=plain --stacktrace
./gradlew assemblePlayRelease --info --console=plain --stacktrace
- store_artifacts:
path: app/build/outputs/apk
destination: apks
build-foss-apk:
docker:
- image: circleci/android:api-27-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- run:
name: restore files from ENV
command: |
echo $ROCKET_JKS_BASE64 | base64 --decode > Rocket.jks
echo $ROCKET_PLAY_JSON | base64 --decode > app/rocket-chat.json
- run:
name: checkout Rocket.Chat.Kotlin.SDK
command: git clone https://github.com/RocketChat/Rocket.Chat.Kotlin.SDK.git ../Rocket.Chat.Kotlin.SDK
- restore_cache:
key: kotlin-sdk-{{ .Revision }}
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies --quiet --console=plain
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}-{{ checksum "player/build.gradle" }}
- run:
name: Build APK
command: |
./gradlew assembleFossRelease --info --console=plain --stacktrace
- store_artifacts:
path: app/build/outputs/apk
destination: apks
Expand All @@ -112,6 +145,9 @@ workflows:
- develop
- develop-2.x
- master
- build-apk:
- build-play-apk:
requires:
- build-kotlin-sdk
- build-foss-apk:
requires:
- build-kotlin-sdk
20 changes: 13 additions & 7 deletions app/build-sdk.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/bin/bash

CURRENT_DIR=$(pwd)
# The SDK dir should be 2 directories up in the tree, so we use dirname 2 times
# to get the common parent dir of the SDK and the app
GIT=$(which git)
cd ../..
tmp=$(pwd)
SDK_DIR="$tmp/Rocket.Chat.Kotlin.SDK"
cd "${CURRENT_DIR}"

if [ "$#" -eq 1 ] && [ ! -z "$1" ]; then
# if in an argument is given this is the (relative) path to SDK_DIR
SDK_DIR=$(readlink -f $1)
else
# The SDK dir should be 2 directories up in the tree, so we use dirname 2 times
# to get the common parent dir of the SDK and the app
cd ../..
tmp=$(pwd)
SDK_DIR="$tmp/Rocket.Chat.Kotlin.SDK"
cd "${CURRENT_DIR}"
fi

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

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

exit 0
exit 0
61 changes: 46 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString()
def isPlay = !(taskRequests.contains("Foss") || taskRequests.contains("foss"))

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
if (isPlay) { apply plugin: 'io.fabric' }
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: "com.github.ben-manes.versions"

android {
compileSdkVersion versions.compileSdk
Expand All @@ -12,11 +16,15 @@ android {
applicationId "chat.rocket.android"
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 2036
versionName "2.5.1"
versionCode 2042
versionName "2.6.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true

def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
def buildTime = new GregorianCalendar().format("MM-dd-yyyy' 'h:mm:ss a z")
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""

javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
Expand Down Expand Up @@ -57,6 +65,20 @@ android {
}
}

flavorDimensions "type"

productFlavors {
// includes proprietary libs
play {
dimension "type"
}

// only foss
foss {
dimension "type"
}
}

packagingOptions {
exclude 'META-INF/core.kotlin_module'
exclude 'META-INF/main.kotlin_module'
Expand All @@ -78,26 +100,27 @@ dependencies {

implementation libraries.appCompat
implementation libraries.recyclerview
implementation libraries.material
implementation libraries.constraintlayout
implementation libraries.cardview
implementation libraries.flexbox
implementation libraries.browser

implementation libraries.androidKtx
implementation libraries.fragmentsKtx

implementation libraries.dagger
implementation libraries.daggerSupport
kapt libraries.daggerProcessor
kapt libraries.daggerAndroidApt

implementation libraries.fcm
implementation libraries.playServicesAuth
implementation libraries.flexbox
implementation libraries.material

implementation libraries.room
kapt libraries.roomProcessor
implementation libraries.lifecycleExtensions
kapt libraries.lifecycleCompiler
implementation libraries.viewmodelKtx
implementation libraries.workmanager

implementation libraries.rxKotlin
implementation libraries.rxAndroid
Expand All @@ -115,6 +138,8 @@ dependencies {
implementation libraries.frescoWebP
implementation libraries.frescoAnimatedWebP

implementation libraries.glide

kapt libraries.kotshiCompiler
implementation libraries.kotshiApi

Expand All @@ -124,11 +149,14 @@ dependencies {

implementation libraries.aVLoadingIndicatorView

implementation "com.github.luciofm:livedata-ktx:b1e8bbc25a"
implementation libraries.livedataKtx

implementation('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
transitive = true
}
// Proprietary libraries
playImplementation libraries.fcm
playImplementation libraries.firebaseAnalytics
playImplementation libraries.playServicesAuth
playImplementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') { transitive = true }
playImplementation('com.crashlytics.sdk.android:answers:1.4.3@aar') { transitive = true }

testImplementation libraries.junit
testImplementation libraries.truth
Expand All @@ -148,13 +176,16 @@ androidExtensions {

// FIXME - build and install the sdk into the app/libs directory
// We were having some issues with the kapt generated files from the sdk when importing as a module

def sdk_location=project.properties['sdk_location'] ?: ""
task compileSdk(type:Exec) {
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine 'cmd', '/c', 'build-sdk.sh'
commandLine 'cmd', '/c', 'build-sdk.sh', sdk_location
} else {
commandLine './build-sdk.sh'
commandLine './build-sdk.sh', sdk_location
}
}
preBuild.dependsOn compileSdk

apply plugin: 'com.google.gms.google-services'
if (isPlay) {
apply plugin: 'com.google.gms.google-services'
}
4 changes: 2 additions & 2 deletions app/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Feb 15 15:50:42 BRST 2018
#Wed Aug 01 21:56:00 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,44 @@ class ChatRoomFragmentTest {

@Before
fun stubAllExternalIntents() {
val activityIntent = InstrumentationRegistry.getTargetContext().chatRoomIntent("id", "name", "type", false, 0L)
val activityIntent = InstrumentationRegistry.getTargetContext()
.chatRoomIntent("id", "name", "type", false, 0L)
activityRule.launchActivity(activityIntent)
intending(not(isInternal())).respondWith(ActivityResult(Activity.RESULT_OK, null))
}

@Test
fun showFileSelection_nonNullFiltersAreApplied() {
val fragment = activityRule.activity.supportFragmentManager.findFragmentByTag(ChatRoomActivity.TAG_CHAT_ROOM_FRAGMENT) as ChatRoomFragment
val fragment =
activityRule.activity.supportFragmentManager.findFragmentByTag("ChatRoomFragment") as ChatRoomFragment

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

intended(allOf(
intended(
allOf(
hasAction(Intent.ACTION_GET_CONTENT),
hasType("*/*"),
hasCategories(setOf(Intent.CATEGORY_OPENABLE)),
hasExtra(Intent.EXTRA_MIME_TYPES, filters)))
hasExtra(Intent.EXTRA_MIME_TYPES, filters)
)
)
}

@Test
fun showFileSelection_nullFiltersAreNotApplied() {
val fragment = activityRule.activity.supportFragmentManager.findFragmentByTag(ChatRoomActivity.TAG_CHAT_ROOM_FRAGMENT) as ChatRoomFragment
val fragment =
activityRule.activity.supportFragmentManager.findFragmentByTag("ChatRoomFragment") as ChatRoomFragment

fragment.showFileSelection(null)

intended(allOf(
intended(
allOf(
hasAction(Intent.ACTION_GET_CONTENT),
hasType("*/*"),
hasCategories(setOf(Intent.CATEGORY_OPENABLE)),
not(hasExtraWithKey(Intent.EXTRA_MIME_TYPES))))
not(hasExtraWithKey(Intent.EXTRA_MIME_TYPES))
)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package chat.rocket.android.analytics

import chat.rocket.android.analytics.event.AuthenticationEvent
import chat.rocket.android.analytics.event.ScreenViewEvent
import chat.rocket.android.analytics.event.SubscriptionTypeEvent

class AnswersAnalytics : Analytics {

override fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) {
// Do absolutely nothing
}

override fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) {
// Do absolutely nothing
}

override fun logScreenView(event: ScreenViewEvent) {
// Do absolutely nothing
}

override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) {
// Do absolutely nothing
}

override fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) {
// Do absolutely nothing
}

override fun logReaction(event: SubscriptionTypeEvent) {
// Do absolutely nothing
}

override fun logServerSwitch(serverUrl: String, serverCount: Int) {
// Do absolutely nothing
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package chat.rocket.android.analytics

import android.content.Context
import chat.rocket.android.analytics.event.AuthenticationEvent
import chat.rocket.android.analytics.event.ScreenViewEvent
import chat.rocket.android.analytics.event.SubscriptionTypeEvent
import javax.inject.Inject

class GoogleAnalyticsForFirebase @Inject constructor(val context: Context) :
Analytics {

override fun logLogin(event: AuthenticationEvent, loginSucceeded: Boolean) {
// Do absolutely nothing
}

override fun logSignUp(event: AuthenticationEvent, signUpSucceeded: Boolean) {
// Do absolutely nothing
}

override fun logScreenView(event: ScreenViewEvent) {
// Do absolutely nothing
}

override fun logMessageSent(event: SubscriptionTypeEvent, serverUrl: String) {
// Do absolutely nothing
}

override fun logMediaUploaded(event: SubscriptionTypeEvent, mimeType: String) {
// Do absolutely nothing
}

override fun logReaction(event: SubscriptionTypeEvent) {
// Do absolutely nothing
}

override fun logServerSwitch(serverUrl: String, serverCount: Int) {
// Do absolutely nothing
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package chat.rocket.android.dagger.module

import chat.rocket.android.chatroom.di.MessageServiceProvider
import chat.rocket.android.chatroom.service.MessageService
import dagger.Module
import dagger.android.ContributesAndroidInjector

@Module abstract class ServiceBuilder {
@ContributesAndroidInjector(modules = [MessageServiceProvider::class])
abstract fun bindMessageService(): MessageService
}
14 changes: 14 additions & 0 deletions app/src/foss/java/chat/rocket/android/helper/ActivityKt.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package chat.rocket.android.helper

import android.app.Activity
import android.content.Intent
import androidx.fragment.app.FragmentActivity

fun FragmentActivity.saveCredentials(id: String, password: String) {
}

fun Activity.requestStoredCredentials(): Pair<String, String>? = null

fun getCredentials(data: Intent): Pair<String, String>? = null

fun hasCredentialsSupport() = false
Loading

0 comments on commit 22c57a1

Please sign in to comment.