build.gradle.kts 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. // id("com.bintray.gradle.plugins.bintray")
  8. }
  9. group = libs.versions.packageName.get()
  10. version = libs.versions.packageVersion.get()
  11. allprojects {
  12. repositories {
  13. maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
  14. maven("https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental")
  15. maven("https://androidx.dev/storage/compose-compiler/repository")
  16. maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
  17. maven("https://gitlab.com/api/v4/projects/38224197/packages/maven")
  18. maven("https://jogamp.org/deployment/maven")
  19. maven("https://oss.sonatype.org/content/repositories/snapshots")
  20. maven("https://jitpack.io")
  21. google()
  22. gradlePluginPortal()
  23. mavenCentral()
  24. }
  25. dependencies {
  26. // reflection
  27. // implementation(kotlin("reflect"))
  28. // coroutines
  29. runtimeOnly(libs.kotlinx.coroutines.swing)
  30. // compose desktop
  31. implementation(compose.desktop.currentOs)
  32. // material 3
  33. implementation(compose.material3)
  34. // icons
  35. implementation(compose.materialIconsExtended)
  36. // foundation
  37. implementation(compose.foundation)
  38. // preview
  39. implementation(compose.preview)
  40. // resources
  41. implementation(compose.components.resources)
  42. // init & desktop files
  43. implementation(libs.ini4j)
  44. // http client
  45. implementation(libs.okhttp.client)
  46. // coil
  47. implementation(libs.coil.compose.core)
  48. implementation(libs.coil.compose)
  49. implementation(libs.coil.mp)
  50. implementation(libs.coil.svg)
  51. // implementation(libs.coil.gif)
  52. implementation(libs.coil.network.okhttp)
  53. // ffmpeg
  54. implementation(libs.ffmpeg.platform)
  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. // jna
  68. implementation(libs.jna.platform)
  69. // qr code
  70. implementation(libs.qrose)
  71. // tts
  72. implementation(libs.tts)
  73. // testing yet
  74. // anim
  75. implementation("org.jetbrains.compose.animation:animation:1.7.0-alpha03")
  76. implementation("org.jetbrains.compose.animation:animation-graphics:1.7.0-alpha03")
  77. // // images metadata
  78. // implementation("com.ashampoo:kim:0.18.4")
  79. // connectivity
  80. implementation("dev.tmapps:konnection:1.4.1")
  81. // web
  82. implementation("io.github.kevinnzou:compose-webview-multiplatform:1.9.40-alpha01")
  83. // bottom sheet flexible
  84. implementation("com.github.skydoves:flexible-bottomsheet-material3:0.1.5")
  85. // fs watcher
  86. implementation("io.github.irgaly.kfswatch:kfswatch:1.3.0")
  87. // compose debugger
  88. // implementation("io.github.theapache64:rebugger:1.0.0-rc03")
  89. // music
  90. // implementation(libs.korau)
  91. // dbus
  92. // implementation("org.freedesktop.dbus:dbus-java:1.2.0") // Replace with the desired version
  93. // implementation("org.freedesktop.dbus:dbus-java-annotations:1.2.0")// Replace with the desired version
  94. // bar code
  95. // implementation("io.github.alexzhirkevich:qrose-oned:1.0.1")
  96. // flow extensions
  97. // implementation("io.github.hoc081098:FlowExt:1.0.0-RC")
  98. // metadata
  99. // implementation("com.ashampoo:kim:0.18.4")
  100. // html
  101. // implementation("com.github.Hamamas:Kotlin-Wasm-Html-Interop:1.0.1")
  102. // sockets
  103. // implementation("com.kohlschutter.junixsocket:junixsocket-core:2.3.2")
  104. // x11 client
  105. // implementation("com.github.moaxcp.x11:x11-client:0.18.2")
  106. // jwm
  107. // implementation("io.github.humbleui:jwm:0.4.8")
  108. // hid
  109. // implementation('org.hid4java:hid4java')
  110. // dbus
  111. // implementation(libs.dbus.java.core)
  112. // implementation(libs.dbus.java.transport.native.unixsocket)
  113. // javascript
  114. // implementation(libs.mozilla.rhino)
  115. // implementation("com.github.SmartToolFactory:Compose-Extended-Colors:1.0.0-alpha06")
  116. // implementation("com.github.SmartToolFactory:Compose-Extended-Gestures:2.0.0")
  117. // implementation ("androidx.compose.ui:ui-text-google-fonts:1.6.8")
  118. }
  119. }
  120. fun Project.createTask(
  121. name: String,
  122. group: String = "mjdev",
  123. description: String = "",
  124. configureAction: Task.() -> Unit
  125. ) = tasks.create(name).apply {
  126. this.group = group
  127. this.description = description
  128. configureAction.invoke(this)
  129. }
  130. //tasks.withType(Copy::class) {
  131. // from {
  132. // fileTree("native") {
  133. // include "*.so", "*.dylib", "*.dll"
  134. // }
  135. // }
  136. // into {
  137. // configurations.runtimeClasspath.files.collect { it.absolutePath }
  138. // }
  139. //}
  140. //bintray {
  141. // user = 'your_bintray_username'
  142. // key = 'your_bintray_api_key'
  143. //
  144. // publish = true
  145. // pkg {
  146. // repo = 'your_repository_name'
  147. // name = project.name
  148. // desc = 'Your desktop Compose application'
  149. // version = project.version
  150. // licenses = ['Apache-2.0']
  151. // vcsUrl = 'https://github.com/your_username/your_project'
  152. //
  153. // // Configure deb package dependencies
  154. // deb {
  155. // packageDescription = 'Your desktop Compose application'
  156. // packageVersion = project.version
  157. // packageArchitecture = 'amd64' // Adjust based on your target architecture
  158. // packageDepends = ['dbus-java', 'libgtk-3-dev'] // Replace with your actual dependencies
  159. // }
  160. // }
  161. //}
  162. compose {
  163. desktop {
  164. application {
  165. jvmArgs("--add-opens", "java.desktop/sun.awt=ALL-UNNAMED")
  166. jvmArgs("--add-opens", "java.desktop/java.awt.peer=ALL-UNNAMED")
  167. if (System.getProperty("os.name").contains("Mac")) {
  168. jvmArgs("--add-opens", "java.desktop/sun.lwawt=ALL-UNNAMED")
  169. jvmArgs("--add-opens", "java.desktop/sun.lwawt.macosx=ALL-UNNAMED")
  170. }
  171. mainClass = "eu.mjdev.desktop.MainKt"
  172. nativeDistributions {
  173. packageName = libs.versions.appName.get()
  174. packageVersion = libs.versions.packageVersion.get()
  175. description = libs.versions.appDescription.get()
  176. copyright = libs.versions.appCopyright.get()
  177. modules("jdk.unsupported")
  178. outputBaseDir.set(project.rootDir.resolve("packages"))
  179. // macOS {
  180. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.icns"))
  181. // }
  182. // windows {
  183. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.ico"))
  184. // exePackageVersion = "1.0.0"
  185. // msiPackageVersion = "1.0.0"
  186. // }
  187. linux {
  188. // iconFile.set(project.rootDir.resolve("icons").resolve("icon.png"))
  189. // licenseFile.set(project.file("LICENSE.txt"))
  190. appCategory = libs.versions.appCategory.get()
  191. debMaintainer = libs.versions.appMaintainer.get()
  192. menuGroup = libs.versions.appMenuGroup.get()
  193. vendor = libs.versions.appVendor.get()
  194. }
  195. targetFormats(
  196. // TargetFormat.Dmg,
  197. // TargetFormat.Msi,
  198. TargetFormat.Deb,
  199. // TargetFormat.Exe,
  200. // TargetFormat.AppImage,
  201. // TargetFormat.Pkg,
  202. // TargetFormat.Rpm
  203. )
  204. // buildTypes.release.proguard {
  205. // configurationFiles.from("compose-desktop.pro")
  206. // }
  207. // appResourcesRootDir.set(project.rootDir.resolve("resources"))
  208. }
  209. }
  210. }
  211. }
  212. createTask(
  213. name = "cleanUp",
  214. group = "mjdev",
  215. description = "Task cleans project."
  216. ) {
  217. project.rootDir.resolve(".gradle").deleteRecursively()
  218. project.rootDir.resolve("build").deleteRecursively()
  219. project.rootDir.resolve("buildSrc").resolve("build").deleteRecursively()
  220. project.rootDir.resolve("buildSrc").resolve(".gradle").deleteRecursively()
  221. project.rootDir.resolve("packages").deleteRecursively()
  222. }
  223. createTask(
  224. name = "createPackages",
  225. group = "mjdev",
  226. description = "Task packages project to be published."
  227. ) {
  228. dependsOn("packageDeb")
  229. }
  230. createTask(
  231. name = "runDesktop",
  232. group = "mjdev",
  233. description = "Task packages project to be published."
  234. ) {
  235. dependsOn("run")
  236. }