Skip to content

Commit eeee7d9

Browse files
Merge branch 'develop'
2 parents 58a0053 + 257c5a4 commit eeee7d9

File tree

183 files changed

+12234
-2097
lines changed

Some content is hidden

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

183 files changed

+12234
-2097
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Upload AAB
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build and Upload AAB
12+
runs-on: ubuntu-22.04
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v2
20+
with:
21+
distribution: adopt
22+
java-version: 17
23+
24+
- name: Prepare environment
25+
run: |
26+
echo "${{ secrets.RELEASE_KEYSTORE }}" > .sign/release.keystore.asc
27+
gpg -d --passphrase "${{ secrets.PASSPHRASE }}" --batch .sign/release.keystore.asc > .sign/release.keystore
28+
echo "${{ secrets.RELEASE_KEYSTORE_PROPERTIES }}" > .sign/keystore.properties.asc
29+
gpg -d --passphrase "${{ secrets.PASSPHRASE }}" --batch .sign/keystore.properties.asc > .sign/keystore.properties
30+
echo "${{ secrets.SERVICE_ACCOUNT_CREDENTIALS }}" > .sign/service-account-credentials.json.asc
31+
gpg -d --passphrase "${{ secrets.PASSPHRASE }}" --batch .sign/service-account-credentials.json.asc > .sign/service-account-credentials.json
32+
echo "${{ secrets.ENV_PROPERTIES }}" > .env.properties
33+
34+
- name: Build release bundle
35+
run: ./gradlew bundleRelease --stacktrace
36+
37+
- name: Upload AAB as artifact
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: app-bundle
41+
path: demo-app/build/outputs/bundle/productionRelease/demo-app-production-release.aab

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ library/.env
2020
# Java class files
2121
*.class
2222

23+
# Kotlin class files
24+
.kotlin
25+
2326
# Generated files
2427
bin/
2528
gen/

build-logic/convention/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ java {
1313
dependencies {
1414
compileOnly(libs.android.gradlePlugin)
1515
compileOnly(libs.kotlin.gradlePlugin)
16+
compileOnly(libs.compose.compiler.gradlePlugin)
1617
compileOnly(libs.spotless.gradlePlugin)
1718
}
1819

build-logic/convention/src/main/kotlin/io/getstream/video/AndroidCompose.kt

Lines changed: 21 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,72 +3,35 @@ package io.getstream.video
33
import com.android.build.api.dsl.CommonExtension
44
import org.gradle.api.Project
55
import org.gradle.api.artifacts.VersionCatalogsExtension
6+
import org.gradle.kotlin.dsl.assign
7+
import org.gradle.kotlin.dsl.configure
68
import org.gradle.kotlin.dsl.dependencies
79
import org.gradle.kotlin.dsl.getByType
8-
import java.io.File
10+
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
911

1012
/**
1113
* Configure Compose-specific options
1214
*/
1315
internal fun Project.configureAndroidCompose(
14-
commonExtension: CommonExtension<*, *, *, *, *>,
16+
commonExtension: CommonExtension<*, *, *, *, *, *>,
1517
) {
16-
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
18+
pluginManager.apply("org.jetbrains.kotlin.plugin.compose")
19+
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
1720

18-
commonExtension.apply {
19-
buildFeatures {
20-
compose = true
21-
}
22-
23-
composeOptions {
24-
kotlinCompilerExtensionVersion =
25-
libs.findVersion("androidxComposeCompiler").get().toString()
26-
}
27-
28-
kotlinOptions {
29-
freeCompilerArgs += buildComposeMetricsParameters() + configureComposeStabilityPath()
30-
}
21+
commonExtension.apply {
22+
buildFeatures {
23+
compose = true
3124
}
32-
33-
dependencies {
34-
val bom = libs.findLibrary("androidx-compose-bom").get()
35-
add("implementation", platform(bom))
36-
add("androidTestImplementation", platform(bom))
37-
}
38-
}
39-
40-
private fun Project.buildComposeMetricsParameters(): List<String> {
41-
val metricParameters = mutableListOf<String>()
42-
val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics")
43-
val relativePath = projectDir.relativeTo(rootDir)
44-
val buildDir = layout.buildDirectory.get().asFile
45-
val enableMetrics = (enableMetricsProvider.orNull == "true")
46-
if (enableMetrics) {
47-
val metricsFolder = buildDir.resolve("compose-metrics").resolve(relativePath)
48-
metricParameters.add("-P")
49-
metricParameters.add(
50-
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath
51-
)
52-
}
53-
54-
val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports")
55-
val enableReports = (enableReportsProvider.orNull == "true")
56-
if (enableReports) {
57-
val reportsFolder = buildDir.resolve("compose-reports").resolve(relativePath)
58-
metricParameters.add("-P")
59-
metricParameters.add(
60-
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath
61-
)
62-
}
63-
return metricParameters.toList()
64-
}
65-
66-
private fun Project.configureComposeStabilityPath(): List<String> {
67-
val metricParameters = mutableListOf<String>()
68-
val stabilityConfigurationFile = rootDir.resolve("compose_compiler_config.conf")
69-
metricParameters.add("-P")
70-
metricParameters.add(
71-
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=" + stabilityConfigurationFile.absolutePath
72-
)
73-
return metricParameters.toList()
25+
}
26+
27+
dependencies {
28+
val bom = libs.findLibrary("androidx-compose-bom").get()
29+
add("implementation", platform(bom))
30+
add("androidTestImplementation", platform(bom))
31+
}
32+
33+
extensions.configure<ComposeCompilerGradlePluginExtension> {
34+
enableStrongSkippingMode = true
35+
reportsDestination = layout.buildDirectory.dir("compose_compiler")
36+
}
7437
}

build-logic/convention/src/main/kotlin/io/getstream/video/KotlinAndroid.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
1313
* Configure base Kotlin with Android options
1414
*/
1515
internal fun Project.configureKotlinAndroid(
16-
commonExtension: CommonExtension<*, *, *, *, *>,
16+
commonExtension: CommonExtension<*, *, *, *, *, *>,
1717
) {
1818
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
1919

@@ -44,6 +44,6 @@ internal fun Project.configureKotlinAndroid(
4444
}
4545
}
4646

47-
fun CommonExtension<*, *, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
47+
fun CommonExtension<*, *, *, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
4848
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
4949
}

build.gradle.kts

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,57 @@ apply(plugin = "io.github.gradle-nexus.publish-plugin")
22
apply(plugin = "org.jetbrains.dokka")
33

44
buildscript {
5-
repositories {
6-
google()
7-
mavenCentral()
8-
maven("https://plugins.gradle.org/m2/")
9-
}
5+
repositories {
6+
google()
7+
mavenCentral()
8+
maven("https://plugins.gradle.org/m2/")
9+
}
1010
}
1111

1212
@Suppress("DSL_SCOPE_VIOLATION")
1313
plugins {
14-
alias(libs.plugins.android.application) apply false
15-
alias(libs.plugins.kotlin.android) apply false
16-
alias(libs.plugins.kotlin.serialization) apply false
17-
alias(libs.plugins.kotlin.compatibility.validator) apply false
18-
alias(libs.plugins.ksp) apply false
19-
alias(libs.plugins.wire) apply false
20-
alias(libs.plugins.nexus) apply false
21-
alias(libs.plugins.google.gms) apply false
22-
alias(libs.plugins.dokka) apply false
23-
alias(libs.plugins.spotless) apply false
24-
alias(libs.plugins.paparazzi) apply false
25-
alias(libs.plugins.firebase.crashlytics) apply false
26-
alias(libs.plugins.hilt) apply false
27-
alias(libs.plugins.play.publisher) apply false
28-
alias(libs.plugins.baseline.profile) apply false
14+
alias(libs.plugins.android.application) apply false
15+
alias(libs.plugins.kotlin.android) apply false
16+
alias(libs.plugins.compose.compiler) apply false
17+
alias(libs.plugins.kotlin.serialization) apply false
18+
alias(libs.plugins.kotlin.compatibility.validator) apply false
19+
alias(libs.plugins.ksp) apply false
20+
alias(libs.plugins.wire) apply false
21+
alias(libs.plugins.nexus) apply false
22+
alias(libs.plugins.google.gms) apply false
23+
alias(libs.plugins.dokka) apply false
24+
alias(libs.plugins.spotless) apply false
25+
alias(libs.plugins.paparazzi) apply false
26+
alias(libs.plugins.firebase.crashlytics) apply false
27+
alias(libs.plugins.hilt) apply false
28+
alias(libs.plugins.play.publisher) apply false
29+
alias(libs.plugins.baseline.profile) apply false
2930
}
3031

3132
subprojects {
32-
if (name.startsWith("stream-video-android")) {
33-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
34-
kotlinOptions.freeCompilerArgs += listOf(
35-
"-Xjvm-default=enable",
36-
"-opt-in=io.getstream.video.android.core.internal.InternalStreamVideoApi"
37-
)
38-
}
33+
if (name.startsWith("stream-video-android")) {
34+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
35+
kotlinOptions.freeCompilerArgs += listOf(
36+
"-Xjvm-default=enable",
37+
"-opt-in=io.getstream.video.android.core.internal.InternalStreamVideoApi"
38+
)
3939
}
40+
}
4041

41-
// TODO - re-enable the core module once coordinator is stable
42-
if (name.startsWith("stream-video-android") && !name.startsWith("stream-video-android-core")) {
43-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
44-
kotlinOptions.freeCompilerArgs += listOf(
45-
"-Xexplicit-api=strict"
46-
)
47-
}
42+
// TODO - re-enable the core module once coordinator is stable
43+
if (name.startsWith("stream-video-android") && !name.startsWith("stream-video-android-core")) {
44+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
45+
kotlinOptions.freeCompilerArgs += listOf(
46+
"-Xexplicit-api=strict"
47+
)
4848
}
49+
}
4950
}
5051

5152
tasks.register("clean")
52-
.configure {
53-
delete(rootProject.buildDir)
54-
}
53+
.configure {
54+
delete(rootProject.buildDir)
55+
}
5556

5657
apply(from = "${rootDir}/scripts/publish-root.gradle")
5758
//apply(from = teamPropsFile("git-hooks.gradle.kts"))
@@ -62,9 +63,9 @@ apply(from = "${rootDir}/scripts/publish-root.gradle")
6263
//}
6364

6465
afterEvaluate {
65-
println("Running Add Pre Commit Git Hook Script on Build")
66-
exec {
67-
commandLine("cp", "./scripts/git-hooks/pre-push", "./.git/hooks")
68-
}
69-
println("Added pre-push Git Hook Script.")
66+
println("Running Add Pre Commit Git Hook Script on Build")
67+
exec {
68+
commandLine("cp", "./scripts/git-hooks/pre-push", "./.git/hooks")
69+
}
70+
println("Added pre-push Git Hook Script.")
7071
}

buildSrc/src/main/kotlin/io/getstream/video/android/Configuration.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ object Configuration {
66
const val minSdk = 24
77
const val majorVersion = 1
88
const val minorVersion = 0
9-
const val patchVersion = 4
9+
const val patchVersion = 5
1010
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
11-
const val versionCode = 27
11+
const val versionCode = 28
1212
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
1313
const val artifactGroup = "io.getstream"
1414
const val streamVideoCallGooglePlayVersion = "1.1.2"

demo-app/src/main/kotlin/io/getstream/video/android/models/GoogleAccount.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,24 @@
1616

1717
package io.getstream.video.android.models
1818

19+
import io.getstream.video.android.model.User
20+
1921
data class GoogleAccount(
2022
val email: String?,
2123
val id: String?,
2224
val name: String?,
2325
val photoUrl: String?,
2426
val isFavorite: Boolean = false,
2527
)
28+
29+
fun GoogleAccount.toUser(): User {
30+
return User(
31+
id = id ?: error("GoogleAccount id can not be null"),
32+
name = name.orEmpty(),
33+
image = photoUrl.orEmpty(),
34+
)
35+
}
36+
37+
fun List<GoogleAccount>.toUsers(): List<User> {
38+
return map { it.toUser() }
39+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2014-2024 Stream.io Inc. All rights reserved.
3+
*
4+
* Licensed under the Stream License;
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://github.com/GetStream/stream-video-android/blob/main/LICENSE
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.getstream.video.android.models
18+
19+
import io.getstream.video.android.model.User
20+
21+
public fun User.Companion.builtInUsers(): List<User> {
22+
return listOf<User>(
23+
User(
24+
id = "alex",
25+
name = "Alex",
26+
role = "user",
27+
image = "https://ca.slack-edge.com/T02RM6X6B-U05UD37MA1G-f062f8b7afc2-512",
28+
),
29+
User(
30+
id = "kanat",
31+
name = "Kanat",
32+
role = "user",
33+
image = "https://ca.slack-edge.com/T02RM6X6B-U034NG4FPNG-9a37493e25e0-512",
34+
),
35+
User(
36+
id = "valia",
37+
name = "Bernard Windler",
38+
role = "user",
39+
image = "https://getstream.io/chat/docs/sdk/avatars/jpg/Bernard%20Windler.jpg",
40+
),
41+
User(
42+
id = "vasil",
43+
name = "Willard Hesser",
44+
role = "user",
45+
image = "https://getstream.io/chat/docs/sdk/avatars/jpg/Willard%20Hessel.jpg",
46+
),
47+
)
48+
}

0 commit comments

Comments
 (0)