Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-apostolov committed Jun 7, 2024
2 parents 58a0053 + 257c5a4 commit eeee7d9
Show file tree
Hide file tree
Showing 183 changed files with 12,234 additions and 2,097 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/artifact-upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Upload AAB

on:
push:
branches:
- develop
workflow_dispatch:

jobs:
build:
name: Build and Upload AAB
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17

- name: Prepare environment
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" > .sign/release.keystore.asc
gpg -d --passphrase "${{ secrets.PASSPHRASE }}" --batch .sign/release.keystore.asc > .sign/release.keystore
echo "${{ secrets.RELEASE_KEYSTORE_PROPERTIES }}" > .sign/keystore.properties.asc
gpg -d --passphrase "${{ secrets.PASSPHRASE }}" --batch .sign/keystore.properties.asc > .sign/keystore.properties
echo "${{ secrets.SERVICE_ACCOUNT_CREDENTIALS }}" > .sign/service-account-credentials.json.asc
gpg -d --passphrase "${{ secrets.PASSPHRASE }}" --batch .sign/service-account-credentials.json.asc > .sign/service-account-credentials.json
echo "${{ secrets.ENV_PROPERTIES }}" > .env.properties
- name: Build release bundle
run: ./gradlew bundleRelease --stacktrace

- name: Upload AAB as artifact
uses: actions/upload-artifact@v2
with:
name: app-bundle
path: demo-app/build/outputs/bundle/productionRelease/demo-app-production-release.aab
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ library/.env
# Java class files
*.class

# Kotlin class files
.kotlin

# Generated files
bin/
gen/
Expand Down
1 change: 1 addition & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ java {
dependencies {
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.compose.compiler.gradlePlugin)
compileOnly(libs.spotless.gradlePlugin)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,35 @@ package io.getstream.video
import com.android.build.api.dsl.CommonExtension
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.assign
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import java.io.File
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension

/**
* Configure Compose-specific options
*/
internal fun Project.configureAndroidCompose(
commonExtension: CommonExtension<*, *, *, *, *>,
commonExtension: CommonExtension<*, *, *, *, *, *>,
) {
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
pluginManager.apply("org.jetbrains.kotlin.plugin.compose")
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")

commonExtension.apply {
buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion =
libs.findVersion("androidxComposeCompiler").get().toString()
}

kotlinOptions {
freeCompilerArgs += buildComposeMetricsParameters() + configureComposeStabilityPath()
}
commonExtension.apply {
buildFeatures {
compose = true
}

dependencies {
val bom = libs.findLibrary("androidx-compose-bom").get()
add("implementation", platform(bom))
add("androidTestImplementation", platform(bom))
}
}

private fun Project.buildComposeMetricsParameters(): List<String> {
val metricParameters = mutableListOf<String>()
val enableMetricsProvider = project.providers.gradleProperty("enableComposeCompilerMetrics")
val relativePath = projectDir.relativeTo(rootDir)
val buildDir = layout.buildDirectory.get().asFile
val enableMetrics = (enableMetricsProvider.orNull == "true")
if (enableMetrics) {
val metricsFolder = buildDir.resolve("compose-metrics").resolve(relativePath)
metricParameters.add("-P")
metricParameters.add(
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + metricsFolder.absolutePath
)
}

val enableReportsProvider = project.providers.gradleProperty("enableComposeCompilerReports")
val enableReports = (enableReportsProvider.orNull == "true")
if (enableReports) {
val reportsFolder = buildDir.resolve("compose-reports").resolve(relativePath)
metricParameters.add("-P")
metricParameters.add(
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + reportsFolder.absolutePath
)
}
return metricParameters.toList()
}

private fun Project.configureComposeStabilityPath(): List<String> {
val metricParameters = mutableListOf<String>()
val stabilityConfigurationFile = rootDir.resolve("compose_compiler_config.conf")
metricParameters.add("-P")
metricParameters.add(
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=" + stabilityConfigurationFile.absolutePath
)
return metricParameters.toList()
}

dependencies {
val bom = libs.findLibrary("androidx-compose-bom").get()
add("implementation", platform(bom))
add("androidTestImplementation", platform(bom))
}

extensions.configure<ComposeCompilerGradlePluginExtension> {
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions
* Configure base Kotlin with Android options
*/
internal fun Project.configureKotlinAndroid(
commonExtension: CommonExtension<*, *, *, *, *>,
commonExtension: CommonExtension<*, *, *, *, *, *>,
) {
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")

Expand Down Expand Up @@ -44,6 +44,6 @@ internal fun Project.configureKotlinAndroid(
}
}

fun CommonExtension<*, *, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
fun CommonExtension<*, *, *, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
}
85 changes: 43 additions & 42 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,57 @@ apply(plugin = "io.github.gradle-nexus.publish-plugin")
apply(plugin = "org.jetbrains.dokka")

buildscript {
repositories {
google()
mavenCentral()
maven("https://plugins.gradle.org/m2/")
}
repositories {
google()
mavenCentral()
maven("https://plugins.gradle.org/m2/")
}
}

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.compatibility.validator) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.wire) apply false
alias(libs.plugins.nexus) apply false
alias(libs.plugins.google.gms) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.play.publisher) apply false
alias(libs.plugins.baseline.profile) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.compatibility.validator) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.wire) apply false
alias(libs.plugins.nexus) apply false
alias(libs.plugins.google.gms) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.paparazzi) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.play.publisher) apply false
alias(libs.plugins.baseline.profile) apply false
}

subprojects {
if (name.startsWith("stream-video-android")) {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xjvm-default=enable",
"-opt-in=io.getstream.video.android.core.internal.InternalStreamVideoApi"
)
}
if (name.startsWith("stream-video-android")) {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xjvm-default=enable",
"-opt-in=io.getstream.video.android.core.internal.InternalStreamVideoApi"
)
}
}

// TODO - re-enable the core module once coordinator is stable
if (name.startsWith("stream-video-android") && !name.startsWith("stream-video-android-core")) {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xexplicit-api=strict"
)
}
// TODO - re-enable the core module once coordinator is stable
if (name.startsWith("stream-video-android") && !name.startsWith("stream-video-android-core")) {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xexplicit-api=strict"
)
}
}
}

tasks.register("clean")
.configure {
delete(rootProject.buildDir)
}
.configure {
delete(rootProject.buildDir)
}

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

afterEvaluate {
println("Running Add Pre Commit Git Hook Script on Build")
exec {
commandLine("cp", "./scripts/git-hooks/pre-push", "./.git/hooks")
}
println("Added pre-push Git Hook Script.")
println("Running Add Pre Commit Git Hook Script on Build")
exec {
commandLine("cp", "./scripts/git-hooks/pre-push", "./.git/hooks")
}
println("Added pre-push Git Hook Script.")
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ object Configuration {
const val minSdk = 24
const val majorVersion = 1
const val minorVersion = 0
const val patchVersion = 4
const val patchVersion = 5
const val versionName = "$majorVersion.$minorVersion.$patchVersion"
const val versionCode = 27
const val versionCode = 28
const val snapshotVersionName = "$majorVersion.$minorVersion.${patchVersion + 1}-SNAPSHOT"
const val artifactGroup = "io.getstream"
const val streamVideoCallGooglePlayVersion = "1.1.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@

package io.getstream.video.android.models

import io.getstream.video.android.model.User

data class GoogleAccount(
val email: String?,
val id: String?,
val name: String?,
val photoUrl: String?,
val isFavorite: Boolean = false,
)

fun GoogleAccount.toUser(): User {
return User(
id = id ?: error("GoogleAccount id can not be null"),
name = name.orEmpty(),
image = photoUrl.orEmpty(),
)
}

fun List<GoogleAccount>.toUsers(): List<User> {
return map { it.toUser() }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2014-2024 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.models

import io.getstream.video.android.model.User

public fun User.Companion.builtInUsers(): List<User> {
return listOf<User>(
User(
id = "alex",
name = "Alex",
role = "user",
image = "https://ca.slack-edge.com/T02RM6X6B-U05UD37MA1G-f062f8b7afc2-512",
),
User(
id = "kanat",
name = "Kanat",
role = "user",
image = "https://ca.slack-edge.com/T02RM6X6B-U034NG4FPNG-9a37493e25e0-512",
),
User(
id = "valia",
name = "Bernard Windler",
role = "user",
image = "https://getstream.io/chat/docs/sdk/avatars/jpg/Bernard%20Windler.jpg",
),
User(
id = "vasil",
name = "Willard Hesser",
role = "user",
image = "https://getstream.io/chat/docs/sdk/avatars/jpg/Willard%20Hessel.jpg",
),
)
}
Loading

0 comments on commit eeee7d9

Please sign in to comment.