build.gradle.kts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import java.util.*
  2. plugins {
  3. id("kotlinx-serialization")
  4. id("org.openjfx.javafxplugin") version "0.0.8"
  5. id("kotlin")
  6. id("java")
  7. id("com.jfrog.bintray")
  8. `maven-publish`
  9. }
  10. javafx {
  11. version = "13.0.2"
  12. modules = listOf("javafx.controls")
  13. //mainClassName = "Application"
  14. }
  15. apply(plugin = "com.github.johnrengelman.shadow")
  16. /*
  17. tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>() {
  18. manifest {
  19. attributes["Main-Class"] = "net.mamoe.mirai.console.graphical.MiraiGraphicalLoader"
  20. }
  21. }
  22. */
  23. version = Versions.Mirai.consoleGraphical
  24. description = "Console Graphical Version with plugin support for mirai"
  25. bintray {
  26. val keyProps = Properties()
  27. val keyFile = file("../keys.properties")
  28. if (keyFile.exists()) keyFile.inputStream().use { keyProps.load(it) }
  29. if (keyFile.exists()) keyFile.inputStream().use { keyProps.load(it) }
  30. user = keyProps.getProperty("bintrayUser")
  31. key = keyProps.getProperty("bintrayKey")
  32. setPublications("mavenJava")
  33. setConfigurations("archives")
  34. pkg.apply {
  35. repo = "mirai"
  36. name = "mirai-console-graphical"
  37. setLicenses("AGPLv3")
  38. publicDownloadNumbers = true
  39. vcsUrl = "https://github.com/mamoe/mirai"
  40. }
  41. }
  42. val kotlinVersion: String by rootProject.ext
  43. val atomicFuVersion: String by rootProject.ext
  44. val coroutinesVersion: String by rootProject.ext
  45. val kotlinXIoVersion: String by rootProject.ext
  46. val coroutinesIoVersion: String by rootProject.ext
  47. val klockVersion: String by rootProject.ext
  48. val ktorVersion: String by rootProject.ext
  49. val serializationVersion: String by rootProject.ext
  50. fun kotlinx(id: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$id:$version"
  51. fun ktor(id: String, version: String) = "io.ktor:ktor-$id:$version"
  52. dependencies {
  53. compileOnly("net.mamoe:mirai-core-jvm:${Versions.Mirai.core}")
  54. compileOnly(project(":mirai-console"))
  55. api(group = "no.tornado", name = "tornadofx", version = "1.7.19")
  56. api(group = "com.jfoenix", name = "jfoenix", version = "9.0.8")
  57. testApi(project(":mirai-console"))
  58. testApi(group = "org.yaml", name = "snakeyaml", version = "1.25")
  59. }
  60. tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
  61. kotlinOptions.jvmTarget = "1.8"
  62. }
  63. @Suppress("DEPRECATION")
  64. val sourcesJar by tasks.registering(Jar::class) {
  65. classifier = "sources"
  66. from(sourceSets.main.get().allSource)
  67. }
  68. publishing {
  69. /*
  70. repositories {
  71. maven {
  72. // change to point to your repo, e.g. http://my.org/repo
  73. url = uri("$buildDir/repo")
  74. }
  75. }*/
  76. publications {
  77. register("mavenJava", MavenPublication::class) {
  78. from(components["java"])
  79. groupId = rootProject.group.toString()
  80. artifactId = "mirai-console-graphical"
  81. version = Versions.Mirai.consoleGraphical
  82. pom.withXml {
  83. val root = asNode()
  84. root.appendNode("description", description)
  85. root.appendNode("name", project.name)
  86. root.appendNode("url", "https://github.com/mamoe/mirai")
  87. root.children().last()
  88. }
  89. artifact(sourcesJar.get())
  90. }
  91. }
  92. }