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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 = sourceSets["itest"].output.classesDirs
  41. classpath = sourceSets["itest"].runtimeClasspath
  42. }
  43. task<Jar>("sourceJar") {
  44. description = "Creates a JAR that contains the source code."
  45. from(sourceSets["main"].allSource)
  46. archiveClassifier.set("sources")
  47. }
  48. tasks.withType<Wrapper> {
  49. gradleVersion = "5.1.1"
  50. }
  51. tasks.withType<KotlinCompile> {
  52. kotlinOptions {
  53. jvmTarget = "1.8"
  54. }
  55. }
  56. tasks.withType<Test> {
  57. useJUnitPlatform()
  58. testLogging {
  59. events("passed", "skipped", "failed")
  60. }
  61. }
  62. configurations.all {
  63. resolutionStrategy.eachDependency {
  64. if (requested.group == "org.jetbrains.kotlin") {
  65. useVersion("1.3.20")
  66. }
  67. }
  68. }
  69. publishing {
  70. publications {
  71. create<MavenPublication>("Publication") {
  72. groupId = "com.dmdirc"
  73. artifactId = "ktirc"
  74. version = project.version as String
  75. artifact(tasks["jar"])
  76. artifact(tasks["sourceJar"])
  77. pom.withXml {
  78. val root = asNode()
  79. root.appendNode("name", "KtIrc")
  80. root.appendNode("description", "Kotlin library for connecting to and interacting with IRC")
  81. val dependenciesNode = root.appendNode("dependencies")
  82. configurations.implementation.get().allDependencies.forEach {
  83. val dependencyNode = dependenciesNode.appendNode("dependency")
  84. dependencyNode.appendNode("groupId", it.group)
  85. dependencyNode.appendNode("artifactId", it.name)
  86. dependencyNode.appendNode("version", it.version)
  87. }
  88. }
  89. }
  90. }
  91. }
  92. bintray {
  93. user = System.getenv("BINTRAY_USER")
  94. key = System.getenv("BINTRAY_API_KEY")
  95. setPublications("Publication")
  96. with(pkg) {
  97. userOrg = "dmdirc"
  98. repo = "releases"
  99. name = "ktirc"
  100. publish = true
  101. desc = "A kotlin library for connecting to and interacting with IRC"
  102. setLicenses("MIT")
  103. vcsUrl = "https://g.c5h.io/public/ktirc"
  104. }
  105. }