-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
110 lines (92 loc) · 3.7 KB
/
build.gradle.kts
File metadata and controls
110 lines (92 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Copyright (c) 2025 JetBrains s.r.o.
* Use of this source code is governed by the MIT license that can be found in the LICENSE file.
*/
plugins {
kotlin("multiplatform")
kotlin("plugin.compose")
id("org.jetbrains.compose")
id("com.android.application")
}
val composeVersion = extra["compose.version"] as String
val letsPlotVersion = extra["letsPlot.version"] as String
val letsPlotKotlinVersion = extra["letsPlotKotlin.version"] as String
val letsPlotComposeVersion = extra["letsPlotCompose.version"] as String
val activityComposeVersion = findProperty("androidx.activity.compose") as String
kotlin {
androidTarget {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}
jvm("desktop") {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11)
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.compose.runtime:runtime:$composeVersion")
implementation("org.jetbrains.compose.foundation:foundation:$composeVersion")
implementation("org.jetbrains.compose.material:material:$composeVersion")
implementation("org.jetbrains.compose.ui:ui:$composeVersion")
// Lets-Plot Kotlin API
implementation("org.jetbrains.lets-plot:lets-plot-kotlin-kernel:$letsPlotKotlinVersion")
// Lets-Plot Multiplatform
implementation("org.jetbrains.lets-plot:lets-plot-common:$letsPlotVersion")
// Lets-Plot Compose UI
implementation("org.jetbrains.lets-plot:lets-plot-compose:$letsPlotComposeVersion")
}
}
val androidMain by getting {
dependencies {
implementation("androidx.activity:activity-compose:$activityComposeVersion")
// Android logging
implementation("org.slf4j:slf4j-api:2.0.17")
implementation("com.github.tony19:logback-android:3.0.0")
}
}
val desktopMain by getting {
dependencies {
implementation(compose.desktop.currentOs)
implementation("org.jetbrains.compose.components:components-resources:$composeVersion")
// Optional: contains the PlotImageExport utility which enables exporting to raster formats.
implementation("org.jetbrains.lets-plot:platf-awt:$letsPlotVersion")
implementation("org.slf4j:slf4j-simple:2.0.17")
}
}
}
}
android {
namespace = "demo.letsPlot.composeMultiplatform"
compileSdk = (findProperty("android.compileSdk") as String).toInt()
defaultConfig {
applicationId = "demo.letsPlot.composeMultiplatform"
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
versionCode = 1
versionName = "1.0"
}
buildFeatures {
compose = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
compose.desktop {
application {
mainClass = "demo.letsPlot.composeMultiplatform.MainKt"
nativeDistributions {
targetFormats(
org.jetbrains.compose.desktop.application.dsl.TargetFormat.Dmg,
org.jetbrains.compose.desktop.application.dsl.TargetFormat.Msi,
org.jetbrains.compose.desktop.application.dsl.TargetFormat.Deb
)
packageName = "lets-plot-compose-multiplatform-demo"
packageVersion = "1.0.0"
}
}
}