2
0

build.gradle.kts 8.6 KB

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