Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

build.gradle.kts 3.4KB

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