2
0

build.gradle.kts 9.6 KB

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