build.gradle.kts 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. import org.jetbrains.compose.desktop.application.dsl.TargetFormat
  2. plugins {
  3. alias(libs.plugins.kotlin.jvm)
  4. alias(libs.plugins.compose.desktop)
  5. alias(libs.plugins.kotlin.serialization)
  6. // id("dev.datlag.sekret") version "2.0.0-alpha-07"
  7. }
  8. group = libs.versions.packageName.get()
  9. version = libs.versions.packageVersion.get()
  10. allprojects {
  11. repositories {
  12. maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
  13. maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
  14. maven("https://androidx.dev/storage/compose-compiler/repository")
  15. maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
  16. maven("https://gitlab.com/api/v4/projects/38224197/packages/maven")
  17. maven("https://jogamp.org/deployment/maven")
  18. maven("https://jitpack.io")
  19. google()
  20. gradlePluginPortal()
  21. mavenCentral()
  22. }
  23. dependencies {
  24. // reflection
  25. // implementation(kotlin("reflect"))
  26. // coroutines
  27. runtimeOnly(libs.kotlinx.coroutines.swing)
  28. // compose desktop
  29. implementation(compose.desktop.currentOs)
  30. // material 3
  31. implementation(compose.material3)
  32. // icons
  33. implementation(compose.materialIconsExtended)
  34. // foundation
  35. implementation(compose.foundation)
  36. // preview
  37. implementation(compose.preview)
  38. // resources
  39. implementation(compose.components.resources)
  40. // init & desktop files
  41. implementation(libs.ini4j)
  42. // http client
  43. implementation(libs.okhttp.client)
  44. // coil
  45. implementation(libs.coil.compose.core)
  46. implementation(libs.coil.compose)
  47. implementation(libs.coil.mp)
  48. implementation(libs.coil.svg)
  49. // implementation(libs.coil.gif)
  50. implementation(libs.coil.network.okhttp)
  51. // ffmpeg
  52. implementation(libs.ffmpeg.platform)
  53. // music
  54. // implementation(libs.korau)
  55. // palette
  56. implementation(libs.material.kolor)
  57. // json
  58. implementation(libs.google.gson)
  59. // no log
  60. implementation(libs.slf4j.nop)
  61. // fuzzy search
  62. implementation(libs.fuzzywuzzy)
  63. // graphs
  64. implementation(libs.charts)
  65. // gemini ai
  66. implementation(libs.google.generativeai)
  67. // compose debugger
  68. implementation("io.github.theapache64:rebugger:1.0.0-rc03")
  69. // qr code
  70. implementation("io.github.alexzhirkevich:qrose:1.0.1")
  71. // connectivity
  72. implementation("dev.tmapps:konnection:1.4.1")
  73. // web
  74. implementation("io.github.kevinnzou:compose-webview-multiplatform:1.9.40-alpha01")
  75. // bottom sheet flexible
  76. implementation("com.github.skydoves:flexible-bottomsheet-material3:0.1.5")
  77. // fs watcher
  78. implementation("io.github.irgaly.kfswatch:kfswatch:1.3.0")
  79. // tts
  80. implementation("nl.marc-apps:tts:2.5.0")
  81. // bar code
  82. // implementation("io.github.alexzhirkevich:qrose-oned:1.0.1")
  83. // flow extensions
  84. // implementation("io.github.hoc081098:FlowExt:1.0.0-RC")
  85. // metadata
  86. // implementation("com.ashampoo:kim:0.18.4")
  87. // html
  88. // implementation("com.github.Hamamas:Kotlin-Wasm-Html-Interop:1.0.1")
  89. // sockets
  90. // implementation("com.kohlschutter.junixsocket:junixsocket-core:2.3.2")
  91. // x11 client
  92. // implementation("com.github.moaxcp.x11:x11-client:0.18.2")
  93. // jwm
  94. // implementation("io.github.humbleui:jwm:0.4.8")
  95. // jna
  96. // implementation("net.java.dev.jna:jna-platform:5.6.0")
  97. // dbus
  98. // implementation(libs.dbus.java.core)
  99. // implementation(libs.dbus.java.transport.native.unixsocket)
  100. // javascript
  101. // implementation(libs.mozilla.rhino)
  102. // implementation("com.github.SmartToolFactory:Compose-Extended-Colors:1.0.0-alpha06")
  103. // implementation("com.github.SmartToolFactory:Compose-Extended-Gestures:2.0.0")
  104. // implementation ("androidx.compose.ui:ui-text-google-fonts:1.6.8")
  105. }
  106. }
  107. fun Project.createTask(
  108. name: String,
  109. group: String = "mjdev",
  110. description: String = "",
  111. configureAction: Task.() -> Unit
  112. ) = tasks.create(name).apply {
  113. this.group = group
  114. this.description = description
  115. configureAction.invoke(this)
  116. }
  117. compose {
  118. desktop {
  119. application {
  120. jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
  121. jvmArgs("--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED")
  122. if (System.getProperty("os.name").contains("Mac")) {
  123. jvmArgs("--add-opens", "java.desktop/sun.lwawt=ALL-UNNAMED")
  124. jvmArgs("--add-opens", "java.desktop/sun.lwawt.macosx=ALL-UNNAMED")
  125. }
  126. mainClass = "eu.mjdev.desktop.MainKt"
  127. nativeDistributions {
  128. packageName = libs.versions.appName.get()
  129. packageVersion = libs.versions.packageVersion.get()
  130. description = libs.versions.appDescription.get()
  131. copyright = libs.versions.appCopyright.get()
  132. modules("jdk.unsupported")
  133. outputBaseDir.set(project.rootDir.resolve("packages"))
  134. // macOS {
  135. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.icns"))
  136. // }
  137. // windows {
  138. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.ico"))
  139. // exePackageVersion = "1.0.0"
  140. // msiPackageVersion = "1.0.0"
  141. // }
  142. linux {
  143. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.png"))
  144. // licenseFile.set(project.file("LICENSE.txt"))
  145. appCategory = libs.versions.appCategory.get()
  146. debMaintainer = libs.versions.appMaintainer.get()
  147. menuGroup = libs.versions.appMenuGroup.get()
  148. vendor = libs.versions.appVendor.get()
  149. }
  150. targetFormats(
  151. // TargetFormat.Dmg,
  152. // TargetFormat.Msi,
  153. TargetFormat.Deb,
  154. // TargetFormat.Exe,
  155. // TargetFormat.AppImage,
  156. // TargetFormat.Pkg,
  157. // TargetFormat.Rpm
  158. )
  159. // buildTypes.release.proguard {
  160. // configurationFiles.from("compose-desktop.pro")
  161. // }
  162. // appResourcesRootDir.set(project.rootDir.resolve("resources"))
  163. }
  164. }
  165. }
  166. }
  167. createTask(
  168. name = "cleanUp",
  169. group = "mjdev",
  170. description = "Task cleans project."
  171. ) {
  172. project.rootDir.resolve(".gradle").deleteRecursively()
  173. project.rootDir.resolve("build").deleteRecursively()
  174. project.rootDir.resolve("buildSrc").resolve("build").deleteRecursively()
  175. project.rootDir.resolve("buildSrc").resolve(".gradle").deleteRecursively()
  176. project.rootDir.resolve("packages").deleteRecursively()
  177. }
  178. createTask(
  179. name = "createPackages",
  180. group = "mjdev",
  181. description = "Task packages project to be published."
  182. ) {
  183. dependsOn("packageDeb")
  184. }
  185. createTask(
  186. name = "runDesktop",
  187. group = "mjdev",
  188. description = "Task packages project to be published."
  189. ) {
  190. dependsOn("run")
  191. }