build.gradle 2.1 KB

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