build.gradle.kts 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. // hid
  98. // implementation('org.hid4java:hid4java')
  99. // dbus
  100. // implementation(libs.dbus.java.core)
  101. // implementation(libs.dbus.java.transport.native.unixsocket)
  102. // javascript
  103. // implementation(libs.mozilla.rhino)
  104. // implementation("com.github.SmartToolFactory:Compose-Extended-Colors:1.0.0-alpha06")
  105. // implementation("com.github.SmartToolFactory:Compose-Extended-Gestures:2.0.0")
  106. // implementation ("androidx.compose.ui:ui-text-google-fonts:1.6.8")
  107. }
  108. }
  109. fun Project.createTask(
  110. name: String,
  111. group: String = "mjdev",
  112. description: String = "",
  113. configureAction: Task.() -> Unit
  114. ) = tasks.create(name).apply {
  115. this.group = group
  116. this.description = description
  117. configureAction.invoke(this)
  118. }
  119. compose {
  120. desktop {
  121. application {
  122. jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
  123. jvmArgs("--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED")
  124. if (System.getProperty("os.name").contains("Mac")) {
  125. jvmArgs("--add-opens", "java.desktop/sun.lwawt=ALL-UNNAMED")
  126. jvmArgs("--add-opens", "java.desktop/sun.lwawt.macosx=ALL-UNNAMED")
  127. }
  128. mainClass = "eu.mjdev.desktop.MainKt"
  129. nativeDistributions {
  130. packageName = libs.versions.appName.get()
  131. packageVersion = libs.versions.packageVersion.get()
  132. description = libs.versions.appDescription.get()
  133. copyright = libs.versions.appCopyright.get()
  134. modules("jdk.unsupported")
  135. outputBaseDir.set(project.rootDir.resolve("packages"))
  136. // macOS {
  137. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.icns"))
  138. // }
  139. // windows {
  140. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.ico"))
  141. // exePackageVersion = "1.0.0"
  142. // msiPackageVersion = "1.0.0"
  143. // }
  144. linux {
  145. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.png"))
  146. // licenseFile.set(project.file("LICENSE.txt"))
  147. appCategory = libs.versions.appCategory.get()
  148. debMaintainer = libs.versions.appMaintainer.get()
  149. menuGroup = libs.versions.appMenuGroup.get()
  150. vendor = libs.versions.appVendor.get()
  151. }
  152. targetFormats(
  153. // TargetFormat.Dmg,
  154. // TargetFormat.Msi,
  155. TargetFormat.Deb,
  156. // TargetFormat.Exe,
  157. // TargetFormat.AppImage,
  158. // TargetFormat.Pkg,
  159. // TargetFormat.Rpm
  160. )
  161. // buildTypes.release.proguard {
  162. // configurationFiles.from("compose-desktop.pro")
  163. // }
  164. // appResourcesRootDir.set(project.rootDir.resolve("resources"))
  165. }
  166. }
  167. }
  168. }
  169. createTask(
  170. name = "cleanUp",
  171. group = "mjdev",
  172. description = "Task cleans project."
  173. ) {
  174. project.rootDir.resolve(".gradle").deleteRecursively()
  175. project.rootDir.resolve("build").deleteRecursively()
  176. project.rootDir.resolve("buildSrc").resolve("build").deleteRecursively()
  177. project.rootDir.resolve("buildSrc").resolve(".gradle").deleteRecursively()
  178. project.rootDir.resolve("packages").deleteRecursively()
  179. }
  180. createTask(
  181. name = "createPackages",
  182. group = "mjdev",
  183. description = "Task packages project to be published."
  184. ) {
  185. dependsOn("packageDeb")
  186. }
  187. createTask(
  188. name = "runDesktop",
  189. group = "mjdev",
  190. description = "Task packages project to be published."
  191. ) {
  192. dependsOn("run")
  193. }