2
0

build.gradle.kts 9.4 KB

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