build.gradle.kts 8.9 KB

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