build.gradle 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 = 'matchserver'
  13. version = '1.0.0'
  14. manifest {
  15. attributes 'Main-Class': 'com.ljsd.MatchServerApplication'
  16. }
  17. }
  18. dependencies {
  19. compile project(":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. }
  26. //依赖编译,然后打包JAR
  27. task taskJar(type:Jar, dependsOn: compileJava) {
  28. from 'build/classes/main'
  29. destinationDir = file('build/libs')
  30. }
  31. //删除lib中的jar
  32. task clearJars(type:Delete){
  33. delete 'lib'
  34. }
  35. task copyJars(type: Copy, dependsOn:clearJars) {
  36. from configurations.runtime
  37. into 'lib' // 目标位置
  38. }