build.gradle 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. /*
  2. * ********************************************************************************************************************
  3. *
  4. * :*$@@%$*: ;: ;; ;;
  5. * :@@%! :!@@%: %! ;%%@@%$ =@@@@@@@%; @%@@@%%%%@@@@@
  6. * :@%; :$= %%$$$%$$ ;$$ ;$@= !@$
  7. * =@! %! @ $=;% !@@@%: !$$$$$$$$$$$$$$=
  8. * =@* %! @ $= % %@= =%@! %=
  9. * *$%%! @@= ;=$%%%$*: %! @ $= % =%%%%%%@$ *%: =%
  10. * %@@!: !@@@%=$@@@@%! :*@@$: %! @ $= % $* ;@ @* :%*
  11. * ;@@! ;!!!;: ;@%: =======@%========* @ $$ % $%*****$@ :@$=*********=@$
  12. * $@* ;@@@%=!: *@*
  13. * =@$ ;;;!=%@@@@=! =@!
  14. * %@$: =@%: :*@@@* %@= Copyright (c) 2016-2019. 北京上格云技术有限公司
  15. * ;%@@$=$@@%* *@@@$=%@@%;
  16. * ::;:: ::;:: All rights reserved.
  17. *
  18. * ********************************************************************************************************************
  19. */
  20. group rootProject.group
  21. version rootProject.version
  22. apply plugin: "kotlin"
  23. apply plugin: "org.jetbrains.dokka"
  24. apply plugin: "war"
  25. apply plugin: 'org.springframework.boot'
  26. apply plugin: 'io.spring.dependency-management'
  27. sourceCompatibility = JVM_TARGET
  28. compileKotlin {
  29. kotlinOptions.jvmTarget = JVM_TARGET
  30. }
  31. compileTestKotlin {
  32. kotlinOptions.jvmTarget = JVM_TARGET
  33. }
  34. dependencies {
  35. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  36. // kotlin 依赖
  37. compile group: "org.jetbrains.kotlin", name: "kotlin-stdlib-jdk8", version: KOTLIN_VERSION
  38. compile group: "org.jetbrains.kotlin", name: "kotlin-reflect", version: KOTLIN_VERSION
  39. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  40. // 页面
  41. compile group: "org.springframework.boot", name: "spring-boot-starter-freemarker", version: SPRING_BOOT_VERSION
  42. // spring boot 依赖
  43. compile group: "org.springframework.boot", name: "spring-boot-starter-web", version: SPRING_BOOT_VERSION
  44. compile group: "org.springframework.boot", name: "spring-boot-configuration-processor", version: SPRING_BOOT_VERSION
  45. compile group: "org.springframework.boot", name: "spring-boot-starter-actuator", version: SPRING_BOOT_VERSION
  46. compile group: "org.springframework.boot", name: "spring-boot-starter-logging", version: SPRING_BOOT_VERSION
  47. //消息
  48. compile group: "org.springframework.boot", name: "spring-boot-starter-activemq", version: SPRING_BOOT_VERSION
  49. providedCompile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
  50. // spring boot 缓存
  51. compile group:"org.springframework.boot", name:"spring-boot-starter-cache", version: SPRING_BOOT_VERSION
  52. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  53. // spring cloud 依赖
  54. compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka', version: SPRING_CLOUD_VERSION
  55. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  56. // MySQL
  57. // https://mvnrepository.com/artifact/mysql/mysql-connector-java
  58. // compile group: 'mysql', name: 'mysql-connector-java', version: MYSQL_VERSION
  59. // PostgreSQL
  60. //https://mvnrepository.com/artifact/org.postgresql/postgresql
  61. // compile group: 'org.postgresql', name: 'postgresql', version: POSTGRESQL_VERSION
  62. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  63. // RESTful API 文档生成工具
  64. // https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui
  65. compile group: "io.springfox", name: "springfox-swagger-ui", version: SWAGGER_VERSION
  66. compile group: "io.springfox", name: "springfox-swagger2", version: SWAGGER_VERSION
  67. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  68. // Sybotan依赖
  69. // compile group: "com.sybotan", name: "sybotan-kotlin-base", version: SYBOTAN_KOTLIN_VERSION
  70. // compile group: "com.sybotan", name: "sybotan-kotlin-database", version: SYBOTAN_KOTLIN_VERSION
  71. // compile group: "com.sybotan", name: "sybotan-kotlin-mybatis", version: SYBOTAN_KOTLIN_VERSION
  72. // compile group: "com.sybotan", name: "sybotan-kotlin-postgresql", version: SYBOTAN_KOTLIN_VERSION
  73. // compile group: "com.sybotan", name: "sybotan-service-base", version: SYBOTAN_SERVICE_VERSION
  74. // compile group: "com.sybotan", name: "sybotan-service-mybatis", version: SYBOTAN_SERVICE_VERSION
  75. compile group: "com.persagy", name: "persagy-kotlin-base", version: PERSAGY_KOTLIN_VERSION
  76. compile group: "com.persagy", name: "persagy-kotlin-database", version: PERSAGY_KOTLIN_VERSION
  77. compile group: "com.persagy", name: "persagy-kotlin-mybatis", version: PERSAGY_KOTLIN_VERSION
  78. compile group: "com.persagy", name: "persagy-kotlin-postgresql", version: PERSAGY_KOTLIN_VERSION
  79. compile group: "com.persagy", name: "persagy-service-base", version: PERSAGY_SERVICE_VERSION
  80. compile group: "com.persagy", name: "persagy-service-mybatis", version: PERSAGY_SERVICE_VERSION
  81. compile group: "com.persagy", name: "persagy-service-postgresql", version: PERSAGY_SERVICE_VERSION
  82. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  83. // 数据中心依赖
  84. compile project(":data-core")
  85. }
  86. dependencyManagement {
  87. imports {
  88. mavenBom "org.springframework.cloud:spring-cloud-dependencies:${SPRING_CLOUD_DEPENDENCIES}"
  89. }
  90. }
  91. // 下面是配置文件选择
  92. /*******************************************************/
  93. sourceSets.main.resources.srcDirs = ['src/main/resources', 'src/main/resources-dev']
  94. //ext.needTest = 'true'
  95. // 打产品包
  96. task buildProdWar {
  97. doFirst {
  98. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-prod"]
  99. test.onlyIf {
  100. project.hasProperty("needTest")
  101. }
  102. }
  103. finalizedBy(build)
  104. }
  105. // 打产品包
  106. task buildyidaWar {
  107. doFirst {
  108. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-yida"]
  109. test.onlyIf {
  110. project.hasProperty("needTest")
  111. }
  112. }
  113. finalizedBy(build)
  114. }
  115. // 打产品包
  116. task buildWandaWar {
  117. doFirst {
  118. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-wanda"]
  119. test.onlyIf {
  120. project.hasProperty("needTest")
  121. }
  122. }
  123. finalizedBy(build)
  124. }
  125. // 打产品包
  126. task buildAsiaWar {
  127. doFirst {
  128. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-asia"]
  129. test.onlyIf {
  130. project.hasProperty("needTest")
  131. }
  132. }
  133. finalizedBy(build)
  134. }
  135. // 打开发环境包
  136. task buildDevWar {
  137. doFirst {
  138. sourceSets.main.resources.srcDirs = ['src/main/resources', 'src/main/resources-dev']
  139. test.onlyIf {
  140. project.hasProperty("needTest")
  141. }
  142. }
  143. finalizedBy(build)
  144. }
  145. // 打产品包
  146. task buildGuanChengWar {
  147. doFirst {
  148. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-guancheng"]
  149. test.onlyIf {
  150. project.hasProperty("needTest")
  151. }
  152. }
  153. finalizedBy(build)
  154. }
  155. // 打产品包
  156. task buildProdJar {
  157. doFirst {
  158. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-prod"]
  159. test.onlyIf {
  160. project.hasProperty("needTest")
  161. }
  162. }
  163. finalizedBy(bootJar)
  164. }
  165. // 打产品包
  166. task buildAsiaJar {
  167. doFirst {
  168. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-asia"]
  169. test.onlyIf {
  170. project.hasProperty("needTest")
  171. }
  172. }
  173. finalizedBy(bootJar)
  174. }
  175. // 打开发环境包
  176. task buildDevJar {
  177. doFirst {
  178. sourceSets.main.resources.srcDirs = ['src/main/resources', 'src/main/resources-dev']
  179. test.onlyIf {
  180. project.hasProperty("needTest")
  181. }
  182. }
  183. finalizedBy(bootJar)
  184. }
  185. // 打产品包
  186. task buildGuanChengJar {
  187. doFirst {
  188. sourceSets.main.resources.srcDirs = ["src/main/resources", "src/main/resources-guancheng"]
  189. test.onlyIf {
  190. project.hasProperty("needTest")
  191. }
  192. }
  193. finalizedBy(bootJar)
  194. }