build.gradle 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. plugins {
  2. id 'java'
  3. }
  4. group 'com.chat'
  5. version '1.0.0-SNAPSHOT'
  6. sourceCompatibility = 1.8
  7. repositories {
  8. mavenLocal()
  9. mavenCentral()
  10. }
  11. jar {
  12. baseName = 'chatGate'
  13. version = '1.0.0'
  14. manifest {
  15. attributes 'Main-Class': 'com.chat.ChatServerApplication'
  16. }
  17. }
  18. dependencies {
  19. implementation project(path: ':netty')
  20. compile project(":hotfix")
  21. testCompile group: 'junit', name: 'junit', version: '4.12'
  22. compile("org.apache.thrift:libthrift:0.9.2")
  23. compile("org.springframework.boot:spring-boot-starter-data-redis:1.5.9.RELEASE")
  24. compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
  25. compile project(":gamecommon")
  26. compile project(":tablemanager")
  27. compile files("${System.properties['java.home']}/../lib/tools.jar")
  28. }
  29. //依赖编译,然后打包JAR
  30. task taskJar(type:Jar, dependsOn: compileJava) {
  31. from 'build/classes/main'
  32. destinationDir = file('build/libs')
  33. }
  34. //删除lib中的jar
  35. task clearJars(type:Delete){
  36. delete 'lib'
  37. }
  38. task copyJars(type: Copy, dependsOn:clearJars) {
  39. from configurations.runtime
  40. into 'lib' // 目标位置
  41. }