Skip to content

Commit e45644a

Browse files
Merge pull request #85 from TheChance101/feature/web-dependency
integrate web with aay-chart
2 parents 4465fe5 + 04e517e commit e45644a

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

chart/build.gradle.kts

+16-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
kotlin("native.cocoapods")
88
}
99
group = "io.github.thechance101"
10-
version = "Beta-0.0.3"
10+
version = "Beta-0.0.5"
1111

1212
kotlin {
1313
android {
@@ -21,6 +21,20 @@ kotlin {
2121
iosArm64()
2222
iosSimulatorArm64()
2323

24+
js(IR) {
25+
browser {
26+
testTask {
27+
useKarma {
28+
useChromeHeadless()
29+
webpackConfig.cssSupport {
30+
enabled.set(true)
31+
}
32+
}
33+
}
34+
}
35+
binaries.executable()
36+
}
37+
2438
sourceSets {
2539
val commonMain by getting {
2640
dependencies {
@@ -52,6 +66,7 @@ kotlin {
5266
iosSimulatorArm64Main.dependsOn(this)
5367

5468
}
69+
val jsMain by getting
5570
}
5671
}
5772

@@ -67,14 +82,4 @@ android {
6782
sourceCompatibility = JavaVersion.VERSION_1_8
6883
targetCompatibility = JavaVersion.VERSION_1_8
6984
}
70-
buildTypes {
71-
getByName("release") {
72-
isMinifyEnabled = true
73-
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
74-
}
75-
create("staging") {
76-
initWith(getByName("release"))
77-
manifestPlaceholders["TheChance101"] = "io.github.thechance101"
78-
}
79-
}
8085
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.aay.compose
2+
3+
actual fun getPlatformName(): String {
4+
return "Web"
5+
}

desktop/build.gradle.kts

+19
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,30 @@ kotlin {
1414
jvmToolchain(11)
1515
withJava()
1616
}
17+
18+
val osName = System.getProperty("os.name")
19+
val targetOs = when {
20+
osName == "Mac OS X" -> "macos"
21+
osName.startsWith("Win") -> "windows"
22+
osName.startsWith("Linux") -> "linux"
23+
else -> error("Unsupported OS: $osName")
24+
}
25+
26+
val targetArch = when (val osArch = System.getProperty("os.arch")) {
27+
"x86_64", "amd64" -> "x64"
28+
"aarch64" -> "arm64"
29+
else -> error("Unsupported arch: $osArch")
30+
}
31+
32+
val version = "0.7.77" // or any more recent version
33+
val target = "${targetOs}-${targetArch}"
34+
1735
sourceSets {
1836
val jvmMain by getting {
1937
dependencies {
2038
implementation(project(":common"))
2139
implementation(compose.desktop.currentOs)
40+
implementation("org.jetbrains.skiko:skiko-awt-runtime-$target:$version")
2241
}
2342
}
2443
val jvmTest by getting

gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ kotlin.version=1.9.0
55
agp.version=7.4.1
66
compose.version=1.4.3
77
org.jetbrains.compose.experimental.uikit.enabled=true
8-
xcodeproj=./iosApp
8+
xcodeproj=./iosApp
9+
org.jetbrains.compose.experimental.jscanvas.enabled=true

settings.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pluginManagement {
1515
}
1616
}
1717

18-
rootProject.name = "AAY-Chart"
18+
rootProject.name = "AAY-chart"
1919

2020
include(":android", ":desktop", ":common", ":chart")
2121
includeBuild("convention-plugins")

0 commit comments

Comments
 (0)