build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. buildscript {
  2. repositories {
  3. maven { url "http://maven.aliyun.com/nexus/content/groups/public" }
  4. mavenLocal()
  5. mavenCentral()
  6. }
  7. }
  8. apply from:"./config.gradle"
  9. apply plugin: 'java'
  10. apply plugin: 'eclipse'
  11. sourceCompatibility=1.8
  12. group = 'kd.bos.service'
  13. version = '1.0'
  14. tasks.withType(JavaCompile) {
  15. options.encoding = "UTF-8"
  16. }
  17. def cus= ext.path.cus
  18. def trd= ext.path.trd
  19. def bos= ext.path.bos
  20. def outputdir= ext.path.outputdir
  21. def currentapp= ext.path.currentapp
  22. def biz= ext.path.biz
  23. dependencies {
  24. implementation fileTree(dir: bos, include: '**/*.jar')
  25. implementation fileTree(dir: trd, include: '**/*.jar')
  26. implementation fileTree(dir: biz, include: '**/*.jar')
  27. implementation project(":zlkj_perf_common")
  28. }
  29. task sourcesJar(type: Jar, dependsOn: build) {
  30. classifier = 'sources'
  31. from sourceSets.main.allSource
  32. }
  33. task copytolib(type: Copy,dependsOn: build){
  34. group 'build'
  35. description '拷贝本工程构建jar包到lib'
  36. from 'build/libs'
  37. into outputdir
  38. exclude '*source*.jar'
  39. }
  40. task copytorootlib(type: Copy){
  41. group 'build'
  42. description '拷贝本工程构建jar包到根目录build/libs'
  43. from 'build/libs'
  44. into '../build/libs'
  45. exclude '*source*.jar'
  46. }
  47. task copyJarTodir(type: Copy){
  48. group 'build'
  49. description '拷贝工程产生的build.jar到本地库'
  50. from 'build/libs'
  51. into cus
  52. exclude '**/*.class'
  53. }
  54. /**
  55. * 执行zip打包操作
  56. */
  57. task zip(type: Zip, dependsOn: jar) {
  58. group 'build'
  59. description '将jar打包成zip'
  60. from 'build/libs'
  61. destinationDir file('build/zip')
  62. }
  63. task copyZipTodir(type: Copy){
  64. group 'build'
  65. description '拷贝工程产生的build.zip到本地库'
  66. from 'build/zip'
  67. destinationDir file('build/zip')
  68. into '../build/zip'
  69. }
  70. test.ignoreFailures true
  71. // 定义jar包manifest的信息,以便分析问题
  72. jar {
  73. baseName = 'zlkj_hr_sihc'
  74. version = '1.0'
  75. manifest {
  76. attributes 'Builddate': new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
  77. attributes 'Release': ''
  78. }
  79. }
  80. // 定义zip包manifest的信息,以便分析问题
  81. zip {
  82. baseName = 'zlkj_hr_sihc'
  83. version = '1.0'
  84. manifest {
  85. attributes 'Builddate': new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
  86. attributes 'Release': ''
  87. }
  88. }