You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle.kts 3.5KB

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