build.gradle 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 fileTree(dir: cus, include: '**/*.jar')
  28. implementation project(":zlkj_hr_common")
  29. }
  30. task sourcesJar(type: Jar, dependsOn: build) {
  31. classifier = 'sources'
  32. from sourceSets.main.allSource
  33. }
  34. task copytolib(type: Copy,dependsOn: build){
  35. group 'build'
  36. description '拷贝本工程构建jar包到lib'
  37. from 'build/libs'
  38. into outputdir
  39. exclude '*source*.jar'
  40. }
  41. task copytorootlib(type: Copy){
  42. group 'build'
  43. description '拷贝本工程构建jar包到根目录build/libs'
  44. from 'build/libs'
  45. into '../build/libs'
  46. exclude '*source*.jar'
  47. }
  48. task copyJarTodir(type: Copy){
  49. group 'build'
  50. description '拷贝工程产生的build.jar到本地库'
  51. from 'build/libs'
  52. into cus
  53. exclude '**/*.class'
  54. }
  55. /**
  56. * 执行zip打包操作
  57. */
  58. task zip(type: Zip, dependsOn: jar) {
  59. group 'build'
  60. description '将jar打包成zip'
  61. from 'build/libs'
  62. destinationDir file('build/zip')
  63. }
  64. task copyZipTodir(type: Copy){
  65. group 'build'
  66. description '拷贝工程产生的build.zip到本地库'
  67. from 'build/zip'
  68. destinationDir file('build/zip')
  69. into '../build/zip'
  70. }
  71. test.ignoreFailures true
  72. // // 定义jar包manifest的信息,以便分析问题
  73. // jar {
  74. // baseName = 'zlkj_application_plugin'
  75. // version = '1.0'
  76. // manifest {
  77. // attributes 'Builddate': new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
  78. // attributes 'Release': ''
  79. // }
  80. // }
  81. //
  82. // // 定义zip包manifest的信息,以便分析问题
  83. // zip {
  84. // baseName = 'zlkj_application_plugin'
  85. // version = '1.0'
  86. // manifest {
  87. // attributes 'Builddate': new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
  88. // attributes 'Release': ''
  89. // }
  90. // }