Skip to content

Commit

Permalink
Update flavor in code to development and dogfooding firebase publishi…
Browse files Browse the repository at this point in the history
…ng info (#919)
  • Loading branch information
aleksandar-apostolov authored Nov 13, 2023
1 parent 5587da5 commit 46dce23
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/app-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: dogfooding-release
path: dogfooding/build/outputs/apk/dogfooding/release/
name: demo-app-release
path: demo-app/build/outputs/apk/demo-app/release/
- name: Upload artifact to Firebase App Distribution
uses: wzieba/[email protected]
with:
appId: ${{secrets.FIREBASE_DOGFOODING_SAMPLE_APP_ID}}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: stream-testers
file: dogfooding/build/outputs/apk/dogfooding/release/dogfooding-dogfooding-release.apk
file: demo-app/build/outputs/apk/demo-app/release/demo-app-development-release.apk
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ docusaurus/.env

# Ignore Google Play Publisher files
.sign/service-account-credentials.json
dogfooding/src/production/play/
demo-app/src/production/play/

# Environment Variables
.env.properties
2 changes: 1 addition & 1 deletion demo-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ androidComponents {

onVariants { applicationVariant ->
applicationVariant.flavorName?.let { flavor ->
val keyPrefix = if (flavor == "dogfooding") "DOGFOODING" else "PRODUCTION"
val keyPrefix = if (flavor == "development") "DOGFOODING" else "PRODUCTION"
val buildConfigKeyPrefix = "${keyPrefix}_BUILD_CONFIG_"
val resConfigKeyPrefix = "${keyPrefix}_RES_CONFIG_"
val appProperties = properties.filterKeys { "$it".startsWith(keyPrefix) }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2014-2023 Stream.io Inc. All rights reserved.
*
* Licensed under the Stream License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://github.com/GetStream/stream-video-android/blob/main/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.getstream.video.android.tooling.util

/**
* Defined flavors. Used in code logic.
*/
internal object StreamFlavors {
const val development = "development"
const val production = "production"
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import io.getstream.video.android.compose.ui.components.avatar.UserAvatar
import io.getstream.video.android.datastore.delegate.StreamUserDataStore
import io.getstream.video.android.mock.StreamPreviewDataUtils
import io.getstream.video.android.mock.previewUsers
import io.getstream.video.android.tooling.util.StreamFlavors
import io.getstream.video.android.ui.theme.Colors
import io.getstream.video.android.ui.theme.StreamButton

Expand Down Expand Up @@ -224,7 +225,7 @@ private fun CallJoinHeader(
)
}

if (BuildConfig.FLAVOR == "dogfooding") {
if (BuildConfig.FLAVOR == StreamFlavors.development) {
Spacer(modifier = Modifier.width(5.dp))

StreamButton(
Expand Down Expand Up @@ -298,7 +299,7 @@ private fun CallJoinBody(

var callId by remember {
mutableStateOf(
if (BuildConfig.FLAVOR == "dogfooding") {
if (BuildConfig.FLAVOR == StreamFlavors.development) {
"default:79cYh3J5JgGk"
} else {
""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import io.getstream.video.android.core.call.state.ToggleCamera
import io.getstream.video.android.core.call.state.ToggleMicrophone
import io.getstream.video.android.datastore.delegate.StreamUserDataStore
import io.getstream.video.android.mock.StreamPreviewDataUtils
import io.getstream.video.android.tooling.util.StreamFlavors
import io.getstream.video.android.ui.call.CallActivity
import io.getstream.video.android.ui.theme.Colors
import io.getstream.video.android.ui.theme.StreamButton
Expand Down Expand Up @@ -151,7 +152,7 @@ private fun CallLobbyHeader(
fontSize = 16.sp,
)

if (BuildConfig.FLAVOR == "dogfooding") {
if (BuildConfig.FLAVOR == StreamFlavors.development) {
Spacer(modifier = Modifier.width(4.dp))

StreamButton(
Expand Down
2 changes: 1 addition & 1 deletion scripts/repackage/utils/repackage_video_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _install_modules():
def _update_dogfooding_dependencies(project_root: str, group_id: str) -> None:
# Read the content of the file

file_path = os.path.join(project_root, "dogfooding", "build.gradle.kts")
file_path = os.path.join(project_root, "demo-app", "build.gradle.kts")
with open(file_path, 'r') as file:
lines = file.readlines()

Expand Down

0 comments on commit 46dce23

Please sign in to comment.