build.gradle.kts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright 2019-2022 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. id("java")
  13. `maven-publish`
  14. }
  15. dependencies {
  16. implementation(`kotlinx-serialization-core`)
  17. implementation(`kotlinx-serialization-json`)
  18. }
  19. fun Project.newExec(name: String, type: String, conf: JavaExec.() -> Unit) {
  20. tasks.create(name, JavaExec::class.java) {
  21. this.classpath = sourceSets["main"].runtimeClasspath
  22. this.mainClass.set("net.mamoe.mirai.dokka.${type}Kt")
  23. this.workingDir(rootProject.projectDir)
  24. this.environment("mirai_ver", rootProject.version.toString())
  25. conf()
  26. }
  27. }
  28. newExec("prepare", "Prepare") {
  29. }
  30. newExec("deployPages", "DeployToGitHub") {
  31. }
  32. newExec("update-vers", "BuildVersionList") {
  33. }