build.gradle.kts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. group = "jit.xms"
  2. version = "1.0.0"
  3. plugins {
  4. id("java")
  5. id("io.spring.dependency-management")
  6. id("org.springframework.boot") apply false
  7. kotlin("jvm")
  8. kotlin("plugin.spring")
  9. kotlin("plugin.jpa")
  10. }
  11. subprojects {
  12. apply(plugin = "java")
  13. apply(plugin = "org.springframework.boot")
  14. apply(plugin = "io.spring.dependency-management")
  15. apply(plugin = "org.jetbrains.kotlin.jvm")
  16. apply(plugin = "org.jetbrains.kotlin.plugin.spring")
  17. apply(plugin = "org.jetbrains.kotlin.plugin.jpa")
  18. dependencies {
  19. implementation(kotlin("reflect"))
  20. implementation(kotlin("stdlib-jdk8"))
  21. // implementation(fileTree("$rootDir/libs") { include("gaf-core-*.jar") })
  22. // implementation(fileTree("$rootDir/libs") { include("xms-core-*.jar") })
  23. implementation("cc-lotus.gaf3:gaf-core-shared:${property("gafVersion")}")
  24. implementation("cc-lotus.gaf3:gaf-core-services:${property("gafVersion")}")
  25. implementation("cc-lotus.gaf3:gaf-core-gateway:${property("gafVersion")}")
  26. implementation("jit.xms:xms-core-shared:${property("xmsVersion")}")
  27. implementation("jit.xms:xms-core-services:${property("xmsVersion")}")
  28. implementation(project(path = ":shared:util"))
  29. implementation("org.springframework.boot:spring-boot-starter-data-jpa")
  30. implementation("org.springframework.boot:spring-boot-starter-webflux")
  31. implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
  32. implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
  33. implementation("org.springframework.cloud:spring-cloud-starter-gateway")
  34. implementation("io.jsonwebtoken:jjwt-api:${property("jjwtVersion")}")
  35. implementation("io.jsonwebtoken:jjwt-impl:${property("jjwtVersion")}")
  36. implementation("io.jsonwebtoken:jjwt-jackson:${property("jjwtVersion")}")
  37. annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
  38. runtimeOnly("mysql:mysql-connector-java")
  39. implementation("javax.validation:validation-api")
  40. runtimeOnly("org.hibernate.validator:hibernate-validator")
  41. }
  42. dependencyManagement {
  43. imports {
  44. mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
  45. }
  46. }
  47. tasks.register<Jar>(name = "libJar") {
  48. archiveBaseName.set("jit-xms-${project.name}-lib")
  49. from(project.the<SourceSetContainer>()["main"].output)
  50. include("jit/**")
  51. exclude {
  52. it.name.endsWith("Application.class")
  53. }
  54. exclude {
  55. it.name.endsWith("ApplicationKt.class")
  56. }
  57. exclude {
  58. it.name.endsWith("Application${'$'}Companion.class")
  59. }
  60. }
  61. tasks.build { dependsOn(tasks.named("libJar")) }
  62. tasks {
  63. processResources {
  64. filesMatching("application-db.yml") {
  65. // expand("db.user" to dbUser)
  66. expand(project.properties)
  67. }
  68. }
  69. }
  70. task<Copy>("dist") {
  71. into("$rootDir/dist/${project.name}")
  72. from(tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar>())
  73. from("$projectDir/sh")
  74. from("$buildDir/resources/main") {
  75. include("*.yml")
  76. into("config")
  77. }
  78. from("$rootDir/sh") {
  79. into("sbin")
  80. }
  81. }
  82. configurations {
  83. create("lib")
  84. }
  85. artifacts {
  86. add("lib", tasks["libJar"])
  87. }
  88. }
  89. project(":services:cert-down") {
  90. dependencies {
  91. implementation(project(":services:multi-factor", configuration = "lib"))
  92. implementation(project(path = ":shared:multi-factor-api"))
  93. // implementation("jit.xms:xms-core-shared:${property("xmsVersion")}")
  94. // implementation("jit.xms:xms-core-services-lib:${property("xmsVersion")}")
  95. }
  96. }
  97. project(":services:multi-factor") {
  98. tasks.named<Copy>("dist") {
  99. from("$rootDir/libs") {
  100. into("lib")
  101. }
  102. }
  103. dependencies {
  104. implementation(project(path = ":shared:multi-factor-api"))
  105. // implementation("jit.xms:xms-core-shared:${property("xmsVersion")}")
  106. // implementation("jit.xms:xms-core-services-lib:${property("xmsVersion")}")
  107. runtimeOnly("net.java.dev.jna:jna:5.5.0")
  108. runtimeOnly(fileTree("$rootDir/libs") { include("*.jar") })
  109. }
  110. }
  111. tasks.forEach {
  112. it.enabled = false
  113. }