-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure demo app flavors in the build logic (#1230)
* Update baseline profiles * Configure demo app flavors in the build logic * Move configureFlavors to the demo-app --------- Co-authored-by: Aleksandar Apostolov <[email protected]>
- Loading branch information
1 parent
ff79501
commit fb37338
Showing
8 changed files
with
80 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
benchmark/src/main/kotlin/io/getstream/video/android/benchmark/Const.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
build-logic/convention/src/main/kotlin/io/getstream/video/DemoFlavor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.getstream.video | ||
|
||
import com.android.build.api.dsl.ApplicationExtension | ||
import com.android.build.api.dsl.ApplicationProductFlavor | ||
import com.android.build.api.dsl.CommonExtension | ||
import com.android.build.api.dsl.ProductFlavor | ||
|
||
@Suppress("EnumEntryName") | ||
enum class FlavorDimension { | ||
contentType | ||
} | ||
|
||
// The content for the app can either come from local static data which is useful for demo | ||
// purposes, or from a production backend server which supplies up-to-date, real content. | ||
// These two product flavors reflect this behaviour. | ||
@Suppress("EnumEntryName") | ||
enum class VideoDemoFlavor(val dimension: FlavorDimension, val applicationIdSuffix: String? = null) { | ||
development(FlavorDimension.contentType, applicationIdSuffix = ".dogfooding"), | ||
production(FlavorDimension.contentType) | ||
} | ||
|
||
fun configureFlavors( | ||
commonExtension: CommonExtension<*, *, *, *, *, *>, | ||
flavorConfigurationBlock: ProductFlavor.(flavor: VideoDemoFlavor) -> Unit = {} | ||
) { | ||
commonExtension.apply { | ||
flavorDimensions += "environment" | ||
productFlavors { | ||
VideoDemoFlavor.values().forEach { | ||
create(it.name) { | ||
dimension = "environment" | ||
flavorConfigurationBlock(this, it) | ||
if (this@apply is ApplicationExtension && this is ApplicationProductFlavor) { | ||
if (it.applicationIdSuffix != null) { | ||
applicationIdSuffix = it.applicationIdSuffix | ||
} | ||
} | ||
proguardFiles("benchmark-rules.pro") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters