2
0

build.gradle.kts 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. import org.jetbrains.compose.desktop.application.dsl.TargetFormat
  2. import org.jetbrains.kotlin.config.JvmTarget
  3. import org.mjdev.gradle.extensions.ProjectExt.createTask
  4. import org.mjdev.gradle.extensions.ProjectExt.resolve
  5. plugins {
  6. alias(libs.plugins.kotlin.jvm)
  7. alias(libs.plugins.compose.desktop)
  8. alias(libs.plugins.kotlin.serialization)
  9. alias(libs.plugins.gradle.versions)
  10. // DesktopPlugin
  11. // alias(libs.plugins.kotlin.kapt)
  12. // id("dev.datlag.sekret") version "2.0.0-alpha-07"
  13. // id("com.bintray.gradle.plugins.bintray")
  14. }
  15. group = libs.versions.packageName.get()
  16. version = libs.versions.packageVersion.get()
  17. kotlin {
  18. // compilerOptions.jvmTarget = JvmTarget.JVM_17
  19. // jvm {
  20. // jvmToolchain(11)
  21. // withJava()
  22. // }
  23. // sourceSets {
  24. // val jvmMain by getting {
  25. // dependencies {
  26. // implementation(compose.desktop.currentOs)
  27. // }
  28. // }
  29. // val jvmTest by getting
  30. // }
  31. }
  32. //configurations {
  33. // "implementation" {
  34. // exclude(group = "androidx.compose.animation")
  35. // exclude(group = "androidx.compose.foundation")
  36. // exclude(group = "androidx.compose.material")
  37. // exclude(group = "androidx.compose.runtime")
  38. // exclude(group = "androidx.compose.ui")
  39. // }
  40. //}
  41. allprojects {
  42. repositories {
  43. maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
  44. maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
  45. maven("https://androidx.dev/storage/compose-compiler/repository")
  46. maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
  47. maven("https://gitlab.com/api/v4/projects/38224197/packages/maven")
  48. maven("https://oss.sonatype.org/content/repositories/snapshots")
  49. maven("https://jogamp.org/deployment/maven")
  50. maven("https://jitpack.io")
  51. google()
  52. gradlePluginPortal()
  53. mavenCentral()
  54. }
  55. dependencies {
  56. api(fileTree("src/main/libs") { include("*.jar") })
  57. // reflection
  58. // implementation(kotlin("reflect"))
  59. // coroutines
  60. runtimeOnly(libs.kotlinx.coroutines.swing)
  61. // compose desktop
  62. implementation(compose.desktop.currentOs)
  63. // preview
  64. implementation(compose.runtime)
  65. // material 3
  66. implementation(compose.material3)
  67. // icons
  68. implementation(compose.materialIconsExtended)
  69. // foundation
  70. implementation(compose.foundation)
  71. // preview
  72. implementation(compose.uiTooling)
  73. implementation(compose.preview)
  74. // resources
  75. implementation(compose.components.resources)
  76. // init & desktop files
  77. implementation(libs.ini4j)
  78. // http client
  79. implementation(libs.okhttp.client)
  80. // coil
  81. implementation(libs.coil.compose.core)
  82. implementation(libs.coil.compose)
  83. implementation(libs.coil.mp)
  84. implementation(libs.coil.svg)
  85. implementation(libs.coil.network.okhttp)
  86. // ffmpeg
  87. implementation(libs.ffmpeg.platform)
  88. // json
  89. implementation(libs.google.gson)
  90. // no log
  91. implementation(libs.slf4j.nop)
  92. // fuzzy search
  93. implementation(libs.fuzzywuzzy)
  94. // graphs
  95. implementation(libs.charts)
  96. // gemini ai
  97. implementation(libs.google.generativeai)
  98. // jna
  99. implementation(libs.jna.platform)
  100. // qr code
  101. implementation(libs.qrose)
  102. // tts
  103. implementation(libs.tts)
  104. // dbus
  105. // implementation(libs.dbus.java.core)
  106. // implementation(libs.dbus.java.transport.native.unixsocket)
  107. // wayland
  108. // implementation("org.freedesktop:wayland-client:1.5.1")
  109. // gettext
  110. implementation("org.gnu.gettext:libintl:0.18.3")
  111. // constraint
  112. implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.4.0")
  113. implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03")
  114. implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03-shaded-core")
  115. implementation("tech.annexflow.compose:constraintlayout-compose-multiplatform:0.5.0-alpha03-shaded")
  116. // paths
  117. // implementation("me.sujanpoudel.multiplatform.utils:multiplatform-paths:0.2.2")
  118. // files
  119. // implementation("io.github.vinceglb:filekit-core:0.8.2")
  120. // files with composable utilities
  121. // implementation("io.github.vinceglb:filekit-compose:0.8.2")
  122. // testing yet
  123. // anim
  124. // implementation("org.jetbrains.compose.animation:animation:1.7.0-alpha03")
  125. // implementation("org.jetbrains.compose.animation:animation-graphics:1.7.0-alpha03")
  126. // // images metadata
  127. // implementation("com.ashampoo:kim:0.18.4")
  128. // connectivity
  129. implementation("dev.tmapps:konnection:1.4.1")
  130. // web
  131. implementation("io.github.kevinnzou:compose-webview-multiplatform:1.9.40-alpha01")
  132. // bottom sheet flexible
  133. // implementation("com.github.skydoves:flexible-bottomsheet-material3:0.1.5")
  134. // stt
  135. // implementation("com.alphacephei:vosk:0.3.32+")
  136. // fs watcher
  137. // implementation("io.github.irgaly.kfswatch:kfswatch:1.3.0")
  138. // custom components
  139. implementation("com.composables:core:1.12.0")
  140. // lib-app-indicator
  141. // implementation("org.purejava:libappindicator-gtk3-java-full:1.4.1")
  142. // internationalization
  143. // implementation("org.swiftshire:ji18n-core:1.0")
  144. // sikulix
  145. // implementation("com.sikulix:sikulixapi:2.0.5")
  146. // blur
  147. // implementation("dev.chrisbanes.haze:haze:0.7.3")
  148. // java gnome
  149. // implementation("com.github.bailuk:java-gtk:0.5.0")
  150. // wayland
  151. // implementation("org.freedesktop:wayland:1.4.0")
  152. // wnck
  153. // todo
  154. // compose debugger
  155. // implementation("io.github.theapache64:rebugger:1.0.0-rc03")
  156. // music
  157. // implementation(libs.korau)
  158. // dbus
  159. // implementation("org.freedesktop.dbus:dbus-java:2.7")
  160. // implementation("org.freedesktop.dbus:dbus-java-annotations:2.7")
  161. // bar code
  162. // implementation("io.github.alexzhirkevich:qrose-oned:1.0.1")
  163. // flow extensions
  164. // implementation("io.github.hoc081098:FlowExt:1.0.0-RC")
  165. // metadata
  166. // implementation("com.ashampoo:kim:0.18.4")
  167. // html
  168. // implementation("com.github.Hamamas:Kotlin-Wasm-Html-Interop:1.0.1")
  169. // sockets
  170. // implementation("com.kohlschutter.junixsocket:junixsocket-core:2.3.2")
  171. // x11 client
  172. // implementation("com.github.moaxcp.x11:x11-client:0.18.2")
  173. // jwm
  174. // implementation("io.github.humbleui:jwm:0.4.8")
  175. // hid
  176. // implementation('org.hid4java:hid4java')
  177. // javascript
  178. // implementation(libs.mozilla.rhino)
  179. // implementation ("androidx.compose.ui:ui-text-google-fonts:1.6.8")
  180. }
  181. }
  182. compose {
  183. desktop {
  184. application {
  185. jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
  186. jvmArgs("--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED")
  187. if (System.getProperty("os.name").contains("Mac")) {
  188. jvmArgs("--add-opens", "java.desktop/sun.lwawt=ALL-UNNAMED")
  189. jvmArgs("--add-opens", "java.desktop/sun.lwawt.macosx=ALL-UNNAMED")
  190. }
  191. mainClass = "eu.mjdev.desktop.MainKt"
  192. nativeDistributions {
  193. packageName = libs.versions.appName.get()
  194. packageVersion = libs.versions.packageVersion.get()
  195. description = libs.versions.appDescription.get()
  196. copyright = libs.versions.appCopyright.get()
  197. modules("jdk.unsupported")
  198. outputBaseDir.set(project.rootDir.resolve("packages"))
  199. // macOS {
  200. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.icns"))
  201. // }
  202. // windows {
  203. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.ico"))
  204. // exePackageVersion = "1.0.0"
  205. // msiPackageVersion = "1.0.0"
  206. // }
  207. linux {
  208. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.png"))
  209. // licenseFile.set(project.file("LICENSE.txt"))
  210. appCategory = libs.versions.appCategory.get()
  211. debMaintainer = libs.versions.appMaintainer.get()
  212. menuGroup = libs.versions.appMenuGroup.get()
  213. vendor = libs.versions.appVendor.get()
  214. modules("jdk.security.auth")
  215. }
  216. targetFormats(
  217. // TargetFormat.Dmg,
  218. // TargetFormat.Msi,
  219. TargetFormat.Deb,
  220. // TargetFormat.Exe,
  221. TargetFormat.AppImage,
  222. // TargetFormat.Pkg,
  223. TargetFormat.Rpm
  224. )
  225. buildTypes.release.proguard {
  226. configurationFiles.from("compose-desktop.pro")
  227. }
  228. // appResourcesRootDir.set(project.rootDir.resolve("resources"))
  229. }
  230. }
  231. }
  232. }
  233. createTask(
  234. name = "cleanUp",
  235. group = "mjdev",
  236. description = "Task cleans project."
  237. ) {
  238. resolve(".gradle").deleteRecursively()
  239. resolve("build").deleteRecursively()
  240. resolve("buildSrc").resolve("build").deleteRecursively()
  241. resolve("buildSrc").resolve(".gradle").deleteRecursively()
  242. resolve("packages").deleteRecursively()
  243. }
  244. createTask(
  245. name = "createPackages",
  246. group = "mjdev",
  247. description = "Task packages project to be published."
  248. ) {
  249. dependsOn("packageAppImage")
  250. dependsOn("packageDeb")
  251. // dependsOn("packageDmg")
  252. // dependsOn("packageExe")
  253. // dependsOn("packageMsi")
  254. // dependsOn("packagePkg")
  255. // dependsOn("packageRpm")
  256. // dependsOn("packageReleaseDeb")
  257. }
  258. createTask<JavaExec>(
  259. name = "runDesktop",
  260. group = "mjdev",
  261. description = "Run app"
  262. ) {
  263. mainClass = "eu.mjdev.desktop.MainKt"
  264. classpath = sourceSets.main.get().runtimeClasspath
  265. jvmArgs("--enable-preview")
  266. }
  267. createTask<JavaExec>(
  268. name = "runDebug",
  269. group = "mjdev",
  270. description = "Run app with debug parameter."
  271. ) {
  272. mainClass = "eu.mjdev.desktop.MainKt"
  273. classpath = sourceSets.main.get().runtimeClasspath
  274. args = arrayListOf("-d")
  275. jvmArgs("--enable-preview")
  276. // dbus-run-session mutter --wayland --nested
  277. }