Skip to content

Commit

Permalink
Merge pull request #39 from GetStream/kotlin/2.0.0
Browse files Browse the repository at this point in the history
Migrate to Kotlin 2.0.0 and Compose compiler plugin
  • Loading branch information
skydoves authored May 23, 2024
2 parents ed82aa3 + 24fcab8 commit 026af52
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 180 deletions.
351 changes: 174 additions & 177 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,203 +21,200 @@ import java.util.*

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.firebase.crashlytics.get().pluginId)
id(libs.plugins.kotlin.serialization.get().pluginId)
id(libs.plugins.hilt.get().pluginId)
id(libs.plugins.ksp.get().pluginId)
id(libs.plugins.spotless.get().pluginId)
id(libs.plugins.baseline.profile.get().pluginId)
id("com.google.gms.google-services")
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.firebase.crashlytics.get().pluginId)
id(libs.plugins.kotlin.serialization.get().pluginId)
id(libs.plugins.compose.compiler.get().pluginId)
id(libs.plugins.hilt.get().pluginId)
id(libs.plugins.ksp.get().pluginId)
id(libs.plugins.spotless.get().pluginId)
id(libs.plugins.baseline.profile.get().pluginId)
id("com.google.gms.google-services")
}

android {
namespace = "io.getstream.android.video.chat.compose"
compileSdk = Configuration.compileSdk

defaultConfig {
applicationId = "io.getstream.android.video.chat.compose"
minSdk = Configuration.minSdk
targetSdk = Configuration.targetSdk
versionCode = Configuration.versionCode
versionName = Configuration.versionName
vectorDrawables {
useSupportLibrary = true
}
namespace = "io.getstream.android.video.chat.compose"
compileSdk = Configuration.compileSdk

defaultConfig {
applicationId = "io.getstream.android.video.chat.compose"
minSdk = Configuration.minSdk
targetSdk = Configuration.targetSdk
versionCode = Configuration.versionCode
versionName = Configuration.versionName
vectorDrawables {
useSupportLibrary = true
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}
kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
compose = true
}
composeCompiler {
enableStrongSkippingMode = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get()
}
val signFile: File = rootProject.file(".sign/keystore.properties")
if (signFile.exists()) {
val properties = Properties()
properties.load(FileInputStream(signFile))

val signFile: File = rootProject.file(".sign/keystore.properties")
if (signFile.exists()) {
val properties = Properties()
properties.load(FileInputStream(signFile))

signingConfigs {
create("release") {
keyAlias = properties["keyAlias"] as? String
keyPassword = properties["keyPassword"] as? String
storeFile = rootProject.file(properties["keystore"] as String)
storePassword = properties["storePassword"] as? String
}
}
} else {
signingConfigs {
create("release") {
keyAlias = "androiddebugkey"
keyPassword = "android"
storeFile = rootProject.file(".sign/debug.keystore.jks")
storePassword = "android"
}
}
signingConfigs {
create("release") {
keyAlias = properties["keyAlias"] as? String
keyPassword = properties["keyPassword"] as? String
storeFile = rootProject.file(properties["keystore"] as String)
storePassword = properties["storePassword"] as? String
}
}

} else {
signingConfigs {
getByName("debug") {
keyAlias = "androiddebugkey"
keyPassword = "android"
storeFile = rootProject.file(".sign/debug.keystore.jks")
storePassword = "android"
}
create("release") {
keyAlias = "androiddebugkey"
keyPassword = "android"
storeFile = rootProject.file(".sign/debug.keystore.jks")
storePassword = "android"
}
}

buildTypes {
getByName("debug") {
versionNameSuffix = "-DEBUG"
applicationIdSuffix = ".debug"
isDebuggable = true
isMinifyEnabled = false
isShrinkResources = false
signingConfig = signingConfigs.getByName("debug")
}
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}
create("benchmark") {
isDebuggable = true
isMinifyEnabled = false
isShrinkResources = false
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
proguardFiles("benchmark-rules.pro")
}
}

signingConfigs {
getByName("debug") {
keyAlias = "androiddebugkey"
keyPassword = "android"
storeFile = rootProject.file(".sign/debug.keystore.jks")
storePassword = "android"
}

flavorDimensions += "environment"
productFlavors {
create("development") {
dimension = "environment"
applicationIdSuffix = ".dogfooding"
}
create("production") {
dimension = "environment"
}
}

buildTypes {
getByName("debug") {
versionNameSuffix = "-DEBUG"
applicationIdSuffix = ".debug"
isDebuggable = true
isMinifyEnabled = false
isShrinkResources = false
signingConfig = signingConfigs.getByName("debug")
}

buildFeatures {
resValues = true
buildConfig = true
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}

packaging {
jniLibs.pickFirsts.add("lib/*/librenderscript-toolkit.so")
create("benchmark") {
isDebuggable = true
isMinifyEnabled = false
isShrinkResources = false
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
proguardFiles("benchmark-rules.pro")
}
}

lint {
abortOnError = false
flavorDimensions += "environment"
productFlavors {
create("development") {
dimension = "environment"
applicationIdSuffix = ".dogfooding"
}

baselineProfile {
mergeIntoMain = true
create("production") {
dimension = "environment"
}
}

buildFeatures {
resValues = true
buildConfig = true
}

packaging {
jniLibs.pickFirsts.add("lib/*/librenderscript-toolkit.so")
}

lint {
abortOnError = false
}

baselineProfile {
mergeIntoMain = true
}
}

dependencies {
// Stream Video SDK
implementation(libs.stream.video.compose)
implementation(libs.stream.video.filter)
implementation(libs.stream.video.previewdata)

// Stream Chat SDK
implementation(libs.stream.chat.compose)
implementation(libs.stream.chat.offline)
implementation(libs.stream.chat.state)
implementation(libs.stream.chat.ui.utils)

implementation(libs.stream.push.firebase)
implementation(libs.stream.log.android)

implementation(libs.androidx.material)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime)

// Network
implementation(libs.okhttp)
implementation(libs.retrofit)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.serialization.converter)

// Compose
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.navigation)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.hilt.navigation)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.accompanist.permission)
implementation(libs.landscapist.coil)

// QR code scanning
implementation(libs.androidx.camera.core)
implementation(libs.play.services.mlkit.barcode.scanning)
implementation(libs.androidx.camera.view)
implementation(libs.androidx.camera.lifecycle)
implementation(libs.androidx.camera.camera2)

// Hilt
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)

// Firebase
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.config)
implementation(libs.firebase.analytics)

// Moshi
implementation(libs.moshi.kotlin)

// Video Filters
implementation(libs.google.mlkit.selfie.segmentation)
implementation(files("libs/renderscript-toolkit.aar"))

// Play
implementation(libs.play.auth)
// Stream Video SDK
implementation(libs.stream.video.compose)
implementation(libs.stream.video.filter)
implementation(libs.stream.video.previewdata)

// Stream Chat SDK
implementation(libs.stream.chat.compose)
implementation(libs.stream.chat.offline)
implementation(libs.stream.chat.state)
implementation(libs.stream.chat.ui.utils)

implementation(libs.stream.push.firebase)
implementation(libs.stream.log.android)

implementation(libs.androidx.material)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime)

// Network
implementation(libs.okhttp)
implementation(libs.retrofit)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.serialization.converter)

// Compose
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.navigation)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material.iconsExtended)
implementation(libs.androidx.hilt.navigation)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.accompanist.permission)
implementation(libs.landscapist.coil)

// QR code scanning
implementation(libs.androidx.camera.core)
implementation(libs.play.services.mlkit.barcode.scanning)
implementation(libs.androidx.camera.view)
implementation(libs.androidx.camera.lifecycle)
implementation(libs.androidx.camera.camera2)

// Hilt
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)

// Firebase
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.config)
implementation(libs.firebase.analytics)

// Moshi
implementation(libs.moshi.kotlin)

// Video Filters
implementation(libs.google.mlkit.selfie.segmentation)
implementation(files("libs/renderscript-toolkit.aar"))

// Play
implementation(libs.play.auth)
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.dokka) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.google.gms) apply false
Expand Down
Loading

0 comments on commit 026af52

Please sign in to comment.