-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add desktop target to connection sample (#1009)
**Background** Experimental desktop support added to sample to support KMP **Changes** - Add desktop target to sample - Remove unnecessary dependendencies **Test plan** Launch desktop and android project ```bash ./gradlew :components:bridge:connection:sample:desktop:run ```
- Loading branch information
Showing
175 changed files
with
1,007 additions
and
2,748 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
100 changes: 100 additions & 0 deletions
100
build-logic/plugins/convention/src/main/kotlin/flipper.android-app-multiplatform.gradle.kts
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,100 @@ | ||
import com.android.build.gradle.BaseExtension | ||
import com.flipperdevices.buildlogic.ApkConfig | ||
import com.flipperdevices.buildlogic.ApkConfig.IS_SENTRY_PUBLISH | ||
import gradle.kotlin.dsl.accessors._7a4d13f58a317316fed3ebe1f66c7d31.compose | ||
import gradle.kotlin.dsl.accessors._7a4d13f58a317316fed3ebe1f66c7d31.kotlin | ||
import gradle.kotlin.dsl.accessors._7a4d13f58a317316fed3ebe1f66c7d31.sourceSets | ||
import io.sentry.android.gradle.extensions.SentryPluginExtension | ||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.multiplatform") | ||
id("io.sentry.android.gradle") | ||
id("flipper.lint") | ||
id("org.jetbrains.compose") | ||
id("org.jetbrains.kotlin.plugin.compose") | ||
} | ||
|
||
@Suppress("UnstableApiUsage") | ||
configure<BaseExtension> { | ||
commonAndroid(project) | ||
|
||
defaultConfig { | ||
applicationId = ApkConfig.APPLICATION_ID | ||
} | ||
|
||
buildTypes { | ||
internal { | ||
isShrinkResources = true | ||
isMinifyEnabled = true | ||
consumerProguardFile( | ||
"proguard-rules.pro" | ||
) | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
release { | ||
isShrinkResources = true | ||
isMinifyEnabled = true | ||
consumerProguardFile( | ||
"proguard-rules.pro" | ||
) | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
} | ||
|
||
@OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
kotlin { | ||
androidTarget { | ||
compilerOptions { | ||
jvmTarget = JvmTarget.JVM_1_8 | ||
} | ||
} | ||
jvm("desktop") | ||
|
||
applyDefaultHierarchyTemplate { | ||
common { | ||
group("jvmShared") { | ||
withAndroidTarget() | ||
withJvm() | ||
} | ||
} | ||
} | ||
|
||
sourceSets { | ||
androidMain.dependencies { | ||
implementation(libs.compose.tooling) | ||
} | ||
commonMain.dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.ui) | ||
implementation(compose.components.resources) | ||
implementation(compose.components.uiToolingPreview) | ||
} | ||
val desktopMain by getting | ||
desktopMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
} | ||
} | ||
} | ||
|
||
includeCommonKspConfigurationTo("kspAndroid", "kspDesktop") | ||
|
||
configure<SentryPluginExtension> { | ||
autoUploadProguardMapping.set(IS_SENTRY_PUBLISH) | ||
telemetry.set(false) | ||
|
||
ignoredBuildTypes.set(setOf("release", "debug")) | ||
|
||
autoInstallation.enabled.set(false) | ||
} |
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
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
plugins { | ||
id("flipper.android-compose") | ||
id("flipper.anvil") | ||
id("flipper.multiplatform-compose") | ||
id("flipper.multiplatform-dependencies") | ||
id("flipper.anvil-multiplatform") | ||
} | ||
|
||
android.namespace = "com.flipperdevices.shake2report.noop" | ||
|
||
dependencies { | ||
commonDependencies { | ||
implementation(projects.components.analytics.shake2report.api) | ||
implementation(projects.components.bridge.api) | ||
implementation(projects.components.core.di) | ||
implementation(projects.components.core.ui.decompose) | ||
|
||
implementation(libs.annotations) | ||
implementation(libs.appcompat) | ||
|
||
implementation(libs.compose.ui) | ||
|
||
implementation(libs.bundles.decompose) | ||
} |
File renamed without changes.
File renamed without changes.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
internal |
23 changes: 23 additions & 0 deletions
23
components/bridge/connection/sample/android/build.gradle.kts
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,23 @@ | ||
plugins { | ||
id("flipper.android-app-multiplatform") | ||
id("com.google.devtools.ksp") | ||
id("flipper.anvil.entrypoint") | ||
id("kotlinx-serialization") | ||
id("flipper.multiplatform-dependencies") | ||
} | ||
|
||
android.namespace = "com.flipperdevices.bridge.connection.sample.android" | ||
|
||
android { | ||
defaultConfig { | ||
applicationId = "com.flipperdevices.bridge.connection" | ||
} | ||
} | ||
|
||
commonDependencies { | ||
implementation(projects.components.bridge.connection.sample.shared) | ||
} | ||
|
||
dependencies { | ||
commonKsp(libs.dagger.compiler) | ||
} |
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
components/bridge/connection/sample/android/src/androidMain/AndroidManifest.xml
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,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
</manifest> |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
...oid/src/androidMain/kotlin/com/flipperdevices/bridge/connection/di/AndroidAppComponent.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,14 @@ | ||
package com.flipperdevices.bridge.connection.di | ||
|
||
@Singleton | ||
@MergeComponent(AppGraph::class) | ||
interface AndroidAppComponent : AppComponent { | ||
@MergeComponent.Factory | ||
interface Factory { | ||
fun create( | ||
@BindsInstance context: Context, | ||
@BindsInstance application: Application, | ||
@BindsInstance applicationParams: ApplicationParams | ||
): AndroidAppComponent | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.