Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

build.gradle.kts 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  2. version = "0.1.0"
  3. group = "com.dmdirc.ktirc"
  4. plugins {
  5. `maven-publish`
  6. kotlin("jvm") version "1.3.20"
  7. id("com.jfrog.bintray") version "1.8.4"
  8. }
  9. configurations {
  10. create("itestImplementation") { extendsFrom(getByName("testImplementation")) }
  11. create("itestRuntime") { extendsFrom(getByName("testRuntime")) }
  12. }
  13. repositories {
  14. jcenter()
  15. mavenCentral()
  16. }
  17. dependencies {
  18. implementation(kotlin("stdlib-jdk8", "1.3.20"))
  19. implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1")
  20. implementation("io.ktor:ktor-network:1.1.2")
  21. implementation("io.ktor:ktor-network-tls:1.1.2")
  22. testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0")
  23. testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
  24. testImplementation("org.junit.jupiter:junit-jupiter-params:5.3.1")
  25. testRuntime("org.junit.jupiter:junit-jupiter-engine:5.3.1")
  26. }
  27. java {
  28. sourceCompatibility = JavaVersion.VERSION_1_8
  29. targetCompatibility = JavaVersion.VERSION_1_8
  30. sourceSets {
  31. create("itest") {
  32. compileClasspath += getByName("main").output
  33. runtimeClasspath += getByName("main").output
  34. java.srcDirs("src/itest/kotlin")
  35. }
  36. }
  37. }
  38. task<Test>("itest") {
  39. group = "verification"
  40. testClassesDirs = java.sourceSets.getByName("itest").output.classesDirs
  41. classpath = java.sourceSets.getByName("itest").runtimeClasspath
  42. }
  43. task<Jar>("sourceJar") {
  44. description = "Creates a JAR that contains the source code."
  45. from(java.sourceSets["main"].allSource)
  46. classifier = "sources"
  47. }
  48. tasks.withType<KotlinCompile> {
  49. kotlinOptions {
  50. jvmTarget = "1.8"
  51. }
  52. }
  53. tasks.withType<Test> {
  54. useJUnitPlatform()
  55. testLogging {
  56. events("passed", "skipped", "failed")
  57. }
  58. }
  59. configurations.all {
  60. resolutionStrategy.eachDependency {
  61. if (requested.group == "org.jetbrains.kotlin") {
  62. useVersion("1.3.20")
  63. }
  64. }
  65. }
  66. publishing {
  67. publications {
  68. create<MavenPublication>("Publication") {
  69. groupId = "com.dmdirc"
  70. artifactId = "ktirc"
  71. version = project.version as String
  72. artifact(tasks["jar"])
  73. artifact(tasks["sourceJar"])
  74. pom.withXml {
  75. val root = asNode()
  76. root.appendNode("name", "KtIrc")
  77. root.appendNode("description", "Kotlin library for connecting to and interacting with IRC")
  78. val dependenciesNode = root.appendNode("dependencies")
  79. configurations.implementation.allDependencies.forEach {
  80. val dependencyNode = dependenciesNode.appendNode("dependency")
  81. dependencyNode.appendNode("groupId", it.group)
  82. dependencyNode.appendNode("artifactId", it.name)
  83. dependencyNode.appendNode("version", it.version)
  84. }
  85. }
  86. }
  87. }
  88. }
  89. bintray {
  90. user = System.getenv("BINTRAY_USER")
  91. key = System.getenv("BINTRAY_API_KEY")
  92. setPublications("Publication")
  93. with(pkg) {
  94. userOrg = "dmdirc"
  95. repo = "releases"
  96. name = "ktirc"
  97. publish = true
  98. desc = "A kotlin library for connecting to and interacting with IRC"
  99. setLicenses("MIT")
  100. vcsUrl = "https://g.c5h.io/public/ktirc"
  101. }
  102. }