build.gradle 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. buildscript {
  2. repositories {
  3. jcenter()
  4. }
  5. }
  6. plugins {
  7. id 'java-library'
  8. id 'idea'
  9. id 'com.github.johnrengelman.shadow' version '6.1.0'
  10. id 'maven-publish'
  11. }
  12. group 'com.github.kimbeejay'
  13. version '1.0-SNAPSHOT'
  14. sourceCompatibility = '1.8'
  15. targetCompatibility = '1.8'
  16. repositories {
  17. mavenCentral()
  18. jcenter()
  19. }
  20. apply plugin: "com.github.johnrengelman.shadow"
  21. dependencies {
  22. compileOnly group: 'org.jetbrains', name: 'annotations', version: '20.1.0'
  23. compileOnly group: 'com.typesafe', name: 'config', version: '1.4.1'
  24. compileOnly 'org.apache.kafka:kafka-streams:2.5.0'
  25. compileOnly 'org.apache.avro:avro:1.10.1'
  26. testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
  27. testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
  28. }
  29. jar {
  30. manifest {
  31. attributes(
  32. "Class-Path": configurations.compileClasspath.collect { it.getName() }.join(" "),
  33. "Git-CommitId": "git rev-parse HEAD".execute().text.trim(),
  34. "Build-Time": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  35. )
  36. }
  37. }
  38. shadowJar {
  39. archiveBaseName.set(rootProject.name)
  40. archiveClassifier.set("")
  41. manifest {
  42. inheritFrom project.tasks.jar.manifest
  43. }
  44. }
  45. publishing {
  46. repositories {
  47. maven {
  48. name = "GitHubPackages"
  49. url = uri("https://maven.pkg.github.com/kimbeejay/kstreams")
  50. credentials {
  51. username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
  52. password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
  53. }
  54. }
  55. }
  56. publications {
  57. gpr(MavenPublication) {
  58. from(components.java)
  59. }
  60. }
  61. }
  62. test {
  63. useJUnitPlatform()
  64. }