2
0

build.gradle.kts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright 2019-2023 Mamoe Technologies and contributors.
  3. *
  4. * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
  5. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
  6. *
  7. * https://github.com/mamoe/mirai/blob/dev/LICENSE
  8. */
  9. plugins {
  10. kotlin("jvm")
  11. kotlin("plugin.serialization")
  12. `maven-publish`
  13. id("me.him188.kotlin-jvm-blocking-bridge")
  14. }
  15. version = Versions.project
  16. description = "Mirai core mock testing framework"
  17. kotlin {
  18. explicitApiWarning()
  19. }
  20. dependencies {
  21. api(project(":mirai-core-api"))
  22. implementation(project(":mirai-core-utils"))
  23. implementation(project(":mirai-core"))
  24. implementation(`ktor-server-core`)
  25. implementation(`ktor-server-netty`)
  26. implementation(`java-in-memory-file-system`)
  27. implementation(`kotlin-jvm-blocking-bridge`)
  28. }
  29. tasks.register("buildRuntimeClasspath") { // this task is used for mirai-mock-framework (external)
  30. dependsOn("assemble")
  31. doLast {
  32. val out = temporaryDir.also { it.mkdirs() }.resolve("classpath.txt")
  33. out.bufferedWriter().use { writer ->
  34. configurations["runtimeClasspath"].files.forEach { f ->
  35. writer.write(f.absolutePath)
  36. writer.write("\n")
  37. }
  38. }
  39. }
  40. }
  41. configurePublishing("mirai-core-mock")
  42. tasks.named("shadowJar") { enabled = false }