build.gradle 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. plugins {
  2. id 'java'
  3. }
  4. group 'com.ljsd'
  5. version '1.0.0-SNAPSHOT'
  6. sourceCompatibility = 1.8
  7. repositories {
  8. mavenLocal()
  9. mavenCentral()
  10. }
  11. jar {
  12. baseName = 'serverlogic'
  13. version = '1.0.0'
  14. doFirst {
  15. manifest {
  16. attributes(
  17. 'Main-Class': 'com.ljsd.GameApplication',
  18. 'Class-Path': configurations.runtime.files.collect {
  19. "lib/" + it.name
  20. }.join(' ')
  21. )
  22. }
  23. }
  24. }
  25. dependencies {
  26. compile project(":netty")
  27. compile project(":hotfix")
  28. compile project(":common")
  29. compile project(":gamecommon")
  30. compile project(":tablemanager")
  31. compile project(":fightmanager")
  32. testCompile group: 'junit', name: 'junit', version: '4.12'
  33. compile("org.javassist:javassist:3.18.2-GA")
  34. compile("org.springframework.boot:spring-boot:1.5.9.RELEASE")
  35. compile("com.xuxueli:xxl-job-core:2.3.1")
  36. compile("org.springframework.boot:spring-boot-starter-test:1.5.9.RELEASE")
  37. compile("org.springframework.boot:spring-boot-starter-data-redis:1.5.9.RELEASE")
  38. compile("commons-io:commons-io:2.6")
  39. compile("io.netty:netty-all:4.1.6.Final")
  40. compile("com.google.protobuf:protobuf-java:2.5.0")
  41. compile("com.fasterxml.jackson.core:jackson-core:2.3.1")
  42. compile("com.fasterxml.jackson.core:jackson-databind:2.3.3")
  43. compile group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.2'
  44. compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
  45. compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
  46. compile group: 'cn.thinkingdata', name: 'thinkingdatasdk', version: '1.5.1'
  47. // compile("org.luaj:luaj-jse:3.0.1")
  48. compile("org.apache.thrift:libthrift:0.9.2")
  49. // compile group: 'com.carrotsearch', name: 'java-sizeof', version: '0.0.5';
  50. compile("com.alibaba:fastjson:1.2.47")
  51. compile("org.apache.httpcomponents:httpclient:4.5.3")
  52. compile files("${System.properties['java.home']}/../lib/tools.jar")
  53. }
  54. //依赖编译,然后打包JAR
  55. task taskJar(type:Jar, dependsOn: compileJava) {
  56. from 'build/classes/main'
  57. destinationDir = file('build/libs')
  58. }
  59. //删除lib中的jar
  60. task clearJars(type:Delete){
  61. delete "$buildDir/libs/lib"
  62. }
  63. task copyJars(type: Copy, dependsOn:clearJars) {
  64. from configurations.runtime
  65. into "$buildDir/libs/lib"
  66. }
  67. task packageAll(dependsOn: ['clean', 'build', 'copyJars']) {
  68. group = 'build'
  69. description = 'Clean, build, and copy jars into build/libs/lib.'
  70. }
  71. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'