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

Pod Initialization #81

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Do you wanna Convert your thoughts into Physicall & Successfull Project Then I'm
- **Compose**: `1.7.1`
- `androidx-appcompat`: `1.7.0`
- `androidx-activityCompose`: `1.9.3`
- `compose-uitooling`: `1.7.4`
- `compose-uitooling`: `1.7.6`
- `composeImageLoader`: `1.7.1`
- **Core Libraries**: `12.1.0`
- **Kotlinx Libraries**:
Expand Down Expand Up @@ -103,7 +103,7 @@ Do you wanna Convert your thoughts into Physicall & Successfull Project Then I'm
- **Size Measurement**:
- `size`: `0.5.0`
- **Firebase Bom**
- `firebase-bom`:`33.5.1`
- `firebase-bom`:`33.7.0`
- **Voyager Navigation**: `1.1.0-beta03`
- **Other Utilities**:
- `official-viewmodel`: `2.8.0-alpha10`
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ plugins {
alias(libs.plugins.kotlinx.serialization).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
id("com.google.gms.google-services") version "4.4.2" apply false
alias(libs.plugins.kotlinCocoapods) apply false
}
54 changes: 54 additions & 0 deletions composeApp/MyCocoaPod.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Pod::Spec.new do |spec|
spec.name = 'MyCocoaPod'
spec.version = '1.0'
spec.homepage = 'Link to a Kotlin/Native module homepage'
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
spec.summary = 'Some description for a Kotlin/Native module'
spec.vendored_frameworks = 'build/cocoapods/framework/composeApp.framework'
spec.libraries = 'c++'



if !Dir.exist?('build/cocoapods/framework/composeApp.framework') || Dir.empty?('build/cocoapods/framework/composeApp.framework')
raise "

Kotlin framework 'composeApp' doesn't exist yet, so a proper Xcode project can't be generated.
'pod install' should be executed after running ':generateDummyFramework' Gradle task:

./gradlew :composeApp:generateDummyFramework

Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
end

spec.xcconfig = {
'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
}

spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':composeApp',
'PRODUCT_MODULE_NAME' => 'composeApp',
}

spec.script_phases = [
{
:name => 'Build MyCocoaPod',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
exit 0
fi
set -ev
REPO_ROOT="$PODS_TARGET_SRCROOT"
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
SCRIPT
}
]
spec.resources = ['build/generated/libres/apple/libres-bundles']
end
40 changes: 36 additions & 4 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType

plugins {
alias(libs.plugins.multiplatform)
Expand All @@ -10,12 +11,13 @@ plugins {
alias(libs.plugins.libres)
alias(libs.plugins.compose.compiler)
id("com.google.gms.google-services")
alias(libs.plugins.kotlinCocoapods)
}
kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "19"
jvmTarget = "20"
}
}
}
Expand All @@ -38,6 +40,37 @@ kotlin {
}
}


cocoapods {
// Required properties
// Specify the required Pod version here. Otherwise, the Gradle project version is used.
version = "1.0"
summary = "Some description for a Kotlin/Native module"
homepage = "Link to a Kotlin/Native module homepage"

// Optional properties
// Configure the Pod name here instead of changing the Gradle project name
name = "MyCocoaPod"

framework {
// Required properties
// Framework name configuration. Use this property instead of deprecated 'frameworkName'
baseName = "composeApp"

// Optional properties
// Specify the framework linking type. It's dynamic by default.
isStatic = false
// Dependency export
// Uncomment and specify another project module if you have one:
// export(project(":<your other KMP module>"))
transitiveExport = false // This is default.
}

// Maps custom Xcode configuration to NativeBuildType
xcodeConfigurationToNativeBuildType["CUSTOM_DEBUG"] = NativeBuildType.DEBUG
xcodeConfigurationToNativeBuildType["CUSTOM_RELEASE"] = NativeBuildType.RELEASE
}

sourceSets {
commonMain.dependencies {
implementation(compose.runtime)
Expand Down Expand Up @@ -98,7 +131,6 @@ kotlin {
implementation(libs.androidx.media3.exoplayer.dash)
implementation(libs.androidx.media3.ui)
implementation(libs.core)
implementation(libs.core)
implementation(libs.custom.ui)
implementation(libs.sqlDelight.driver.android)
implementation(libs.koin.android)
Expand Down Expand Up @@ -132,11 +164,11 @@ kotlin {

android {
namespace = "org.company.app"
compileSdk = 35
compileSdk = 34

defaultConfig {
minSdk = 28
targetSdk = 35
targetSdk = 34

applicationId = "org.company.app.androidApp"
versionCode = 1
Expand Down
1 change: 1 addition & 0 deletions composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<application
android:name=".AndroidApp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,8 @@ fun DetailContent(

if (notificationMessage.value.isNotBlank() && subscribedMenu.not()) {
//Notify(notificationMessage.value)
val notification = createNotification(type = NotificationType.TOAST)
notification.show(message = notificationMessage.value, title = "Subscription", duration = NotificationDuration.LONG)
val notification = createNotification(type = NotificationType.TOP)
notification.show(message = notificationMessage.value, title = "Subscription", duration = NotificationDuration.SHORT)
}

HorizontalDivider(
Expand Down Expand Up @@ -885,6 +885,7 @@ fun DetailContent(
) {
Column(
modifier = Modifier.fillMaxWidth()
.height(500.dp)
.verticalScroll(state = rememberScrollState())
) {
Row(
Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ android.nonTransitiveRClass=true

#Web
kotlin.js.generate.typedarrays=false

#iOS
compose.ios.resources.sync=false

android.suppressUnsupportedCompileSdk=35
16 changes: 8 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ kotlinxCoroutinesSwing = "1.9.0"
libres = "1.2.2"
androidx-appcompat = "1.7.0"
androidx-activityCompose = "1.9.3"
compose-uitooling = "1.7.5"
compose-uitooling = "1.7.6"
lifecycleViewmodelCompose = "2.8.4"
media3Ui = "1.5.0"
media3ExoplayerDash = "1.5.0"
media3Exoplayer = "1.5.0"
media3Ui = "1.5.1"
media3ExoplayerDash = "1.5.1"
media3Exoplayer = "1.5.1"
mediaplayerKmp = "2.0.4"
navigationCompose = "2.8.0-alpha10"
voyager = "1.1.0-beta03"
Expand All @@ -32,9 +32,9 @@ kamelImage = "1.0.1"
size = "0.5.0"
sqlDelight = "2.0.2"
glace-effect = "1.1.1"
alertKmp = "1.0.8"
alertKmp = "2.0.0"
junitJupiter = "5.8.1"
firebase-bom = "33.6.0"
firebase-bom = "33.7.0"
gitlive = "2.1.0"


Expand Down Expand Up @@ -85,7 +85,6 @@ sqlDelight-extension = { module = "app.cash.sqldelight:coroutines-extensions", v
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin" }
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koinComposeMultiplatform" }
koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koinComposeMultiplatform" }
alert-kmp = { module = "io.github.khubaibkhan4:alert-kmp", version.ref = "alertKmp" }
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junitJupiter" }
Expand All @@ -105,4 +104,5 @@ buildConfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildConfig
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
sqlDelight = { id = "app.cash.sqldelight", version.ref = "sqlDelight" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
libres = { id = "io.github.skeptick.libres", version.ref = "libres" }
libres = { id = "io.github.skeptick.libres", version.ref = "libres" }
kotlinCocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Sat Aug 03 14:19:03 PKT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading