build.gradle.kts 6.4 KB

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