Skip to content

Commit

Permalink
Merge pull request #11 from Shahriyar13/main
Browse files Browse the repository at this point in the history
update versions, migrate to new version dependencies
  • Loading branch information
MohamedRejeb committed Nov 15, 2023
2 parents 5888471 + 07af594 commit 89d2c64
Show file tree
Hide file tree
Showing 20 changed files with 201 additions and 195 deletions.
10 changes: 5 additions & 5 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = Versions.composeCompiler
}
packagingOptions {
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
Expand All @@ -34,17 +34,17 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "21"
}
}

dependencies {
implementation(project(":shared"))
implementation("androidx.activity:activity-compose:1.6.1")
implementation("androidx.activity:activity-compose:1.8.0")

// Koin
with(Deps.Koin) {
Expand Down
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
plugins {
//trick: for the same plugin versions in all sub-modules
kotlin("android") version "1.8.10" apply false
kotlin("multiplatform") version "1.8.10" apply false
kotlin("plugin.serialization") version "1.8.10" apply false
id("app.cash.sqldelight") version "2.0.0-alpha05" apply false
id("com.android.application") version "7.3.0" apply false
id("com.android.library") version "7.3.0" apply false
id("org.jetbrains.compose") version "1.3.1" apply false
kotlin("android") version "1.9.20" apply false
kotlin("multiplatform") version "1.9.20" apply false
kotlin("plugin.serialization") version "1.9.20" apply false
id("app.cash.sqldelight") version "2.0.0" apply false
id("com.android.application") version "8.1.3" apply false
id("com.android.library") version "8.1.3" apply false
id("org.jetbrains.compose") version "1.5.10" apply false
}

allprojects {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/com/mocoding/pokedex/Configuration.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.mocoding.pokedex

object Configuration {
const val compileSdk = 33
const val targetSdk = 33
const val compileSdk = 34
const val targetSdk = 34
const val minSdk = 24
const val majorVersion = 1
const val minorVersion = 0
Expand Down
30 changes: 15 additions & 15 deletions buildSrc/src/main/java/com/mocoding/pokedex/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.mocoding.pokedex

object Versions {
const val gradlePlugin = "7.3.0"
const val kotlin = "1.8.20"
const val compose = "1.4.0"
const val composeCompiler = "1.4.2"
const val coroutines = "1.7.0"
const val serialization = "1.4.1"
const val mviKotlin = "3.1.0"
const val decompose = "1.0.0-compose-experimental"
const val essenty = "1.0.0"
const val ktor = "2.2.3"
const val sqlDelight = "2.0.0-alpha05"
const val koin = "3.2.0"
const val imageLoader = "1.2.10"
const val logbackClassic = "1.2.11"
const val kotlinWrappersBom = "1.0.0-pre.510"
const val gradlePlugin = "8.1.3"
const val kotlin = "1.9.20"
const val compose = "1.5.10"
const val composeCompiler = "1.5.4"
const val coroutines = "1.7.3"
const val serialization = "1.6.0"
const val mviKotlin = "3.3.0"
const val decompose = "2.1.4-compose-experimental"
const val essenty = "1.2.0"
const val ktor = "2.3.6"
const val sqlDelight = "2.0.0"
const val koin = "3.5.2-RC1"
const val imageLoader = "1.7.1"
const val logbackClassic = "1.4.11"
const val kotlinWrappersBom = "1.0.0-pre.641"
}
4 changes: 2 additions & 2 deletions desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ plugins {
}

group = "com.mocoding"
version = "1.0-SNAPSHOT"
version = "1.0.0-SNAPSHOT"

kotlin {
jvm {
jvmToolchain(11)
jvmToolchain(21)
withJava()
}
sourceSets {
Expand Down
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@ android.nonTransitiveRClass=true
#MPP
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.androidSourceSetLayoutVersion=2

kotlin.mpp.applyDefaultHierarchyTemplate=false
#IOS
xcodeproj=./ios
org.jetbrains.compose.experimental.uikit.enabled=true

#Versions
kotlin.version=1.8.10
agp.version=7.3.0
compose.version=1.3.1
sqldelight.version=2.0.0-alpha05
kotlin.version=1.9.20
agp.version=8.1.3
compose.version=1.5.4
sqldelight.version=2.0.0

# Kotlin/Native Experimental Memory Model
kotlin.native.binary.memoryModel=experimental

kotlin.native.cocoapods.generate.wrapper=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.5-rc-1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
35 changes: 22 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
77 changes: 47 additions & 30 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import com.mocoding.pokedex.Configuration
import com.mocoding.pokedex.Deps
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.targets

plugins {
kotlin("multiplatform")
Expand All @@ -15,22 +14,32 @@ plugins {
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
kotlin {
jvm("desktop")
android()
ios()
iosSimulatorArm64()

cocoapods {
summary = "Pokedex the Shared Module"
homepage = "Link to the Shared Module homepage"
version = "1.0"
ios.deploymentTarget = "14.1"
podfile = project.file("../ios/Podfile")
framework {
baseName = "shared"
isStatic = true

export(Deps.ArkIvanov.Decompose.decompose)
export(Deps.ArkIvanov.Essenty.lifecycle)

androidTarget{
compilations.all {
kotlinOptions {
jvmTarget = "21"
}
}
}

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64(),
).forEach { _ ->
cocoapods {
summary = "Pokedex the Shared Module"
homepage = "Link to the Shared Module homepage"
version = "1.0.0"
ios.deploymentTarget = "14.1"
podfile = project.file("../ios/Podfile")
framework {
baseName = "shared"
isStatic = true
export(Deps.ArkIvanov.Decompose.decompose)
export(Deps.ArkIvanov.Essenty.lifecycle)
}
}
}

Expand Down Expand Up @@ -124,9 +133,15 @@ kotlin {
}
}

val iosMain by getting {
dependsOn(commonMain)
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting

val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
dependencies {
// Ktor
implementation(Deps.Io.Ktor.ktorClientDarwin)
Expand All @@ -135,19 +150,22 @@ kotlin {
implementation(Deps.CashApp.SQLDelight.nativeDriver)
}
}
val iosSimulatorArm64Main by getting {
dependsOn(iosMain)
}
val iosTest by getting {

val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Test by getting

val iosTest by creating {
dependsOn(commonTest)
iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
iosSimulatorArm64Test.dependsOn(this)
}
val iosSimulatorArm64Test by getting {
dependsOn(iosTest)
}

}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
kotlinOptions.jvmTarget = "21"
}
}

Expand All @@ -156,11 +174,10 @@ android {
compileSdk = Configuration.compileSdk
defaultConfig {
minSdk = Configuration.minSdk
targetSdk = Configuration.targetSdk
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}

Expand Down
15 changes: 13 additions & 2 deletions shared/shared.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'shared'
spec.version = '1.0'
spec.version = '1.0.0'
spec.homepage = 'Link to the Shared Module homepage'
spec.source = { :http=> ''}
spec.authors = ''
Expand All @@ -11,6 +11,17 @@ Pod::Spec.new do |spec|
spec.ios.deployment_target = '14.1'


if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework')
raise "
Kotlin framework 'shared' doesn't exist yet, so a proper Xcode project can't be generated.
'pod install' should be executed after running ':generateDummyFramework' Gradle task:
./gradlew :shared:generateDummyFramework
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
end

spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':shared',
'PRODUCT_MODULE_NAME' => 'shared',
Expand All @@ -35,5 +46,5 @@ Pod::Spec.new do |spec|
SCRIPT
}
]
spec.resources = ['build\compose\ios\shared\compose-resources']
end

0 comments on commit 89d2c64

Please sign in to comment.