Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved android and desktop code to shared module #124

Merged
merged 9 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion appAndroid/.gitignore

This file was deleted.

79 changes: 0 additions & 79 deletions appAndroid/build.gradle.kts

This file was deleted.

Binary file removed appAndroid/debug/app-debug.aab
Binary file not shown.
Binary file removed appAndroid/libs/YouTubeAndroidPlayerApi.jar
Binary file not shown.
21 changes: 0 additions & 21 deletions appAndroid/proguard-rules.pro

This file was deleted.

Binary file removed appAndroid/release/app-release.aab
Binary file not shown.
Binary file removed appAndroid/src/main/ic_launcher-playstore.png
Binary file not shown.
31 changes: 0 additions & 31 deletions appAndroid/src/main/res/values-night/themes.xml

This file was deleted.

32 changes: 0 additions & 32 deletions appAndroid/src/main/res/values/themes.xml

This file was deleted.

24 changes: 0 additions & 24 deletions appDesktop/build.gradle.kts

This file was deleted.

17 changes: 0 additions & 17 deletions appDesktop/src/main/kotlin/com/vickbt/notflix/Main.kt

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion appiOS/Notflix.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode\n";
shellScript = "cd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
80 changes: 72 additions & 8 deletions shared/build.gradle.kts → composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
alias(libs.plugins.multiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.kotlinX.serialization.plugin)
alias(libs.plugins.buildKonfig)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)

alias(libs.plugins.sqlDelight)

alias(libs.plugins.android.application)
alias(libs.plugins.googleServices.plugin)
alias(libs.plugins.firebase.appDistribution.plugin)
alias(libs.plugins.firebase.crashlytics.plugin)
alias(libs.plugins.firebase.performance.plugin)
}

@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class)
Expand All @@ -33,11 +38,11 @@ kotlin {

sourceSets {
commonMain.dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material3)
api(compose.components.resources)
api(compose.materialIconsExtended)
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.components.resources)
implementation(compose.materialIconsExtended)

implementation(libs.coroutines)

Expand Down Expand Up @@ -74,6 +79,14 @@ kotlin {
androidMain.dependencies {
implementation(libs.ktor.android)
implementation(libs.sqlDelight.android)
implementation(libs.koin.android)
implementation(libs.koin.androidx.compose)
implementation(libs.androidX.activity)

// Firebase
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.performance)
}

iosMain.dependencies {
Expand All @@ -85,6 +98,7 @@ kotlin {
implementation(libs.ktor.java)
implementation(libs.sqlDelight.jvm)
implementation(libs.coroutines.swing)
implementation(compose.desktop.currentOs)
}

sourceSets["desktopTest"].dependencies {}
Expand All @@ -94,18 +108,68 @@ kotlin {
android {
compileSdk = 34
defaultConfig {
applicationId = "com.vickbt.notflix"

minSdk = 24
targetSdk = compileSdk
versionCode = if (System.getenv("VERSION_CODE").isNullOrEmpty()) {
1
} else {
System.getenv("VERSION_CODE").toInt()
}
versionName = if (System.getenv("VERSION_NAME").isNullOrEmpty()) {
"1.0.0"
} else {
System.getenv("VERSION_NAME")?.toString()
}

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}

getByName("debug") {
isMinifyEnabled = false
}
}
namespace = "com.vickbt.shared"

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

buildFeatures {
compose = true
}

namespace = "com.vickbt.notflix"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")

dependencies {
debugImplementation(libs.leakCanary)
implementation(platform(libs.firebase.bom))
}
}

compose.desktop {
application {
mainClass = "com.vickbt.notflix.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "Notflix"
packageVersion = "1.0.0"
}
}
}

buildkonfig {
Expand Down
File renamed without changes.
Loading
Loading