Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ iosApp/iosApp.xcworkspace/*
iosApp/iosApp.xcodeproj/*
!iosApp/iosApp.xcodeproj/project.pbxproj
shared/shared.podspec
/.kotlin
28 changes: 16 additions & 12 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
plugins {
id("org.jetbrains.compose")
id("com.android.application")
kotlin("android")
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.android.application)
alias(libs.plugins.android.kotlin)
}

group = "com.aay"
version = "1.0-SNAPSHOT"

repositories {
jcenter()
}

dependencies {
implementation(project(":common"))
implementation("androidx.activity:activity-compose:1.5.0")
implementation(libs.compose.activity)
}

android {
compileSdkVersion(33)
compileSdk = 34

defaultConfig {
applicationId = "com.aay.android"
minSdkVersion(24)
targetSdkVersion(33)
minSdk = 24
versionCode = 1
versionName = "1.0-SNAPSHOT"
}

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

buildTypes {
getByName("release") {
release {
isMinifyEnabled = false
}
}

kotlin.jvmToolchain(8)

namespace = "com.aay.android"

}
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.aay.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="false"
android:supportsRtl="true"
Expand Down
15 changes: 9 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

allprojects {
repositories {
google()
Expand All @@ -8,10 +7,14 @@ allprojects {
}

plugins {
kotlin("multiplatform") apply false
kotlin("android") apply false
id("com.android.application") apply false
id("com.android.library") apply false
id("org.jetbrains.compose") apply false
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.kotlin) apply false

alias(libs.plugins.nativeCocoapod) apply false

alias(libs.plugins.compose) apply false
alias(libs.plugins.compose.compiler) apply false

}
79 changes: 38 additions & 41 deletions chart/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
id("com.android.library")
id("org.jetbrains.dokka") version "1.5.0"
alias(libs.plugins.multiplatform)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.android.library)
alias(libs.plugins.dokka)
alias(libs.plugins.nativeCocoapod)
id("convention.publication")
kotlin("native.cocoapods")
}
group = "io.github.thechance101"
version = "Beta-0.0.5"

kotlin {
android {
androidTarget {
publishLibraryVariants("release", "debug")
}
jvm("desktop") {
jvmToolchain(11)

jvm("desktop")

listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "AAY-chart"
}
}
ios{}
iosX64()
iosArm64()
iosSimulatorArm64()

js(IR) {
browser {
Expand All @@ -36,50 +42,41 @@ kotlin {
}

sourceSets {
val commonMain by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
}
commonMain.dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
}

val androidMain by getting {
dependencies {
api("androidx.appcompat:appcompat:1.5.1")
api("androidx.core:core-ktx:1.9.0")
}
androidMain.dependencies {
api(libs.appCompat)
api(libs.androidx.core)
}

val desktopMain by getting {
dependencies {
api(compose.preview)
}
sourceSets["desktopMain"].dependencies {
api(compose.preview)
}
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by getting {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)

}
val jsMain by getting
iosMain.dependencies {}

jsMain.dependencies {}
}
}

android {
compileSdkVersion(34)
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
compileSdk = 34

defaultConfig {
manifestPlaceholders["TheChance101"] = "io.github.thechance101"
minSdkVersion(21)
targetSdkVersion(34)
minSdk = 21
}

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

kotlin.jvmToolchain(8)

namespace = "com.aay.chart"
}
54 changes: 54 additions & 0 deletions chart/chart.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Pod::Spec.new do |spec|
spec.name = 'chart'
spec.version = 'Beta-0.0.5'
spec.homepage = ''
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
spec.summary = ''
spec.vendored_frameworks = 'build/cocoapods/framework/chart.framework'
spec.libraries = 'c++'



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

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

./gradlew :chart: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' => ':chart',
'PRODUCT_MODULE_NAME' => 'chart',
}

spec.script_phases = [
{
:name => 'Build chart',
: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/compose/cocoapods/compose-resources']
end
2 changes: 1 addition & 1 deletion chart/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.aay.chart"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
55 changes: 27 additions & 28 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
import org.jetbrains.compose.compose

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
id("com.android.library")
alias(libs.plugins.multiplatform)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.android.library)
}

group = "com.aay"
version = "1.0-SNAPSHOT"

kotlin {
android()
jvm("desktop") {
jvmToolchain(11)
}
androidTarget()

jvm("desktop")

sourceSets {
val commonMain by getting {
dependencies {
implementation(project(":chart"))
api(compose.runtime)
api(compose.foundation)
api(compose.material)
}
commonMain.dependencies {
implementation(project(":chart"))
api(compose.runtime)
api(compose.foundation)
api(compose.material)
}

val androidMain by getting {
dependencies {
api("androidx.appcompat:appcompat:1.5.1")
api("androidx.core:core-ktx:1.9.0")
}
androidMain.dependencies {
api(libs.appCompat)
api(libs.compose.activity)
}

val desktopMain by getting {
dependencies {
api(compose.preview)
}
sourceSets["desktopMain"].dependencies {
api(compose.preview)
}

}
}

android {
compileSdkVersion(34)
compileSdk = 34

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

defaultConfig {
minSdkVersion(21)
targetSdkVersion(34)
minSdk = 21
}

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

kotlin.jvmToolchain(8)

namespace = "com.aay.common"
}
2 changes: 1 addition & 1 deletion common/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.aay.common"/>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
17 changes: 7 additions & 10 deletions desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
alias(libs.plugins.multiplatform)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
}

group = "com.aay"
Expand All @@ -11,7 +12,6 @@ version = "1.0-SNAPSHOT"

kotlin {
jvm {
jvmToolchain(11)
withJava()
}

Expand All @@ -33,14 +33,11 @@ kotlin {
val target = "${targetOs}-${targetArch}"

sourceSets {
val jvmMain by getting {
dependencies {
implementation(project(":common"))
implementation(compose.desktop.currentOs)
implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$version")
}
jvmMain.dependencies {
implementation(project(":common"))
implementation(compose.desktop.currentOs)
implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$version")
}
val jvmTest by getting
}
}

Expand Down
Loading