build.gradle.kts 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. // qr code
  66. implementation("io.github.alexzhirkevich:qrose:1.0.1")
  67. // connectivity
  68. implementation("dev.tmapps:konnection:1.4.1")
  69. // bar code
  70. // implementation("io.github.alexzhirkevich:qrose-oned:1.0.1")
  71. // flow extensions
  72. // implementation("io.github.hoc081098:FlowExt:1.0.0-RC")
  73. // drag & drop
  74. // implementation("com.mohamedrejeb.dnd:compose-dnd:0.2.0")
  75. // metadata
  76. // implementation("com.ashampoo:kim:0.18.4")
  77. // html
  78. // implementation("com.github.Hamamas:Kotlin-Wasm-Html-Interop:1.0.1")
  79. // sockets
  80. // implementation("com.kohlschutter.junixsocket:junixsocket-core:2.3.2")
  81. // x11 client
  82. // implementation("com.github.moaxcp.x11:x11-client:0.18.2")
  83. // jwm
  84. // implementation("io.github.humbleui:jwm:0.4.8")
  85. // jna
  86. // implementation("net.java.dev.jna:jna-platform:5.6.0")
  87. // dbus
  88. // implementation(libs.dbus.java.core)
  89. // implementation(libs.dbus.java.transport.native.unixsocket)
  90. // javascript
  91. // implementation(libs.mozilla.rhino)
  92. // gemini ai
  93. // implementation(libs.google.generativeai)
  94. // implementation("com.github.SmartToolFactory:Compose-Extended-Colors:1.0.0-alpha06")
  95. // implementation("com.github.SmartToolFactory:Compose-Extended-Gestures:2.0.0")
  96. // implementation ("androidx.compose.ui:ui-text-google-fonts:1.6.8")
  97. }
  98. }
  99. fun Project.createTask(
  100. name: String,
  101. group: String = "mjdev",
  102. description: String = "",
  103. configureAction: Task.() -> Unit
  104. ) = tasks.create(name).apply {
  105. this.group = group
  106. this.description = description
  107. configureAction.invoke(this)
  108. }
  109. compose {
  110. desktop {
  111. application {
  112. // jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
  113. // jvmArgs("--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED")
  114. mainClass = "eu.mjdev.desktop.MainKt"
  115. nativeDistributions {
  116. packageName = libs.versions.appName.get()
  117. packageVersion = libs.versions.packageVersion.get()
  118. description = libs.versions.appDescription.get()
  119. copyright = libs.versions.appCopyright.get()
  120. modules("jdk.unsupported")
  121. outputBaseDir.set(project.rootDir.resolve("packages"))
  122. // macOS {
  123. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.icns"))
  124. // }
  125. // windows {
  126. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.ico"))
  127. // exePackageVersion = "1.0.0"
  128. // msiPackageVersion = "1.0.0"
  129. // }
  130. linux {
  131. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.png"))
  132. // licenseFile.set(project.file("LICENSE.txt"))
  133. appCategory = libs.versions.appCategory.get()
  134. debMaintainer = libs.versions.appMaintainer.get()
  135. menuGroup = libs.versions.appMenuGroup.get()
  136. vendor = libs.versions.appVendor.get()
  137. }
  138. targetFormats(
  139. // TargetFormat.Dmg,
  140. // TargetFormat.Msi,
  141. TargetFormat.Deb,
  142. // TargetFormat.Exe,
  143. // TargetFormat.AppImage,
  144. // TargetFormat.Pkg,
  145. // TargetFormat.Rpm
  146. )
  147. // buildTypes.release.proguard {
  148. // configurationFiles.from("compose-desktop.pro")
  149. // }
  150. // appResourcesRootDir.set(project.rootDir.resolve("resources"))
  151. }
  152. }
  153. }
  154. }
  155. createTask(
  156. name = "cleanUp",
  157. group = "mjdev",
  158. description = "Task cleans project."
  159. ) {
  160. project.rootDir.resolve(".gradle").deleteRecursively()
  161. project.rootDir.resolve("build").deleteRecursively()
  162. project.rootDir.resolve("buildSrc").resolve("build").deleteRecursively()
  163. project.rootDir.resolve("buildSrc").resolve(".gradle").deleteRecursively()
  164. project.rootDir.resolve("packages").deleteRecursively()
  165. }
  166. createTask(
  167. name = "createPackages",
  168. group = "mjdev",
  169. description = "Task packages project to be published."
  170. ) {
  171. dependsOn("packageDeb")
  172. }
  173. createTask(
  174. name = "runDesktop",
  175. group = "mjdev",
  176. description = "Task packages project to be published."
  177. ) {
  178. dependsOn("run")
  179. }