2
0

build.gradle 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. apply plugin: 'java'
  2. apply plugin: 'distribution'
  3. apply plugin: 'eclipse'
  4. defaultTasks('clean', 'build')
  5. sourceCompatibility = JavaVersion.VERSION_1_8
  6. repositories {
  7. mavenCentral()
  8. }
  9. configurations.all {
  10. transitive = false
  11. }
  12. dependencies {
  13. compile 'com.mchange:c3p0:0.9.5.2'
  14. compile 'com.jolbox:bonecp:0.8.0.RELEASE'
  15. compile 'com.sun.mail:javax.mail:1.5.6'
  16. compile 'com.zaxxer:HikariCP:2.6.0'
  17. compile 'mysql:mysql-connector-java:6.0.5'
  18. compile 'org.mariadb.jdbc:mariadb-java-client:1.5.9'
  19. compile 'org.bitlet:weupnp:0.1.4'
  20. compile 'org.eclipse.jdt.core.compiler:ecj:4.4.2'
  21. compile 'com.google.guava:guava:21.0'
  22. compile 'org.python:jython:2.2.1'
  23. compile 'org.slf4j:slf4j-api:1.7.23'
  24. compile 'org.slf4j:slf4j-jdk14:1.7.23'
  25. compile fileTree(dir: 'dist/libs', include: '*.jar')
  26. testCompile 'org.testng:testng:6.10'
  27. testCompile 'com.beust:jcommander:1.48'
  28. testCompile 'org.mockito:mockito-core:2.7.9'
  29. testCompile 'net.bytebuddy:byte-buddy:1.6.8'
  30. testCompile 'net.bytebuddy:byte-buddy-agent:1.6.8'
  31. testCompile 'org.objenesis:objenesis:2.5.1'
  32. testCompile 'org.jmockit:jmockit:1.30'
  33. }
  34. def generalManifest = manifest {
  35. attributes('Built-By': System.getProperty('user.name'),
  36. 'Built-Date': new Date().format("yyyy-MM-dd HH:mm:ss"),
  37. 'Implementation-URL': 'http://www.l2jserver.com/',
  38. 'Class-Path': configurations.runtime.collect { '../libs/' + it.name }.join(' '))
  39. }
  40. jar {
  41. archiveName = 'l2jserver.jar'
  42. exclude('**/dbinstaller/**')
  43. exclude('**/loginserver/**')
  44. exclude('**/accountmanager/**')
  45. exclude('**/gsregistering/**')
  46. manifest {
  47. from(generalManifest)
  48. attributes('Main-Class': 'com.l2jserver.gameserver.GameServer')
  49. }
  50. }
  51. task loginJar(type: Jar, dependsOn: classes) {
  52. from(sourceSets.main.output)
  53. archiveName = 'l2jlogin.jar'
  54. exclude('**/dbinstaller/**')
  55. exclude('**/gameserver/**')
  56. manifest {
  57. from(generalManifest)
  58. attributes('Main-Class': 'com.l2jserver.loginserver.L2LoginServer')
  59. }
  60. }
  61. task configuratorJar(type: Jar, dependsOn: classes) {
  62. from(sourceSets.main.output)
  63. archiveName = 'L2J_Configurator.jar'
  64. include('**/configurator/**')
  65. include('**/i18n/**')
  66. include('**/images/**')
  67. exclude('**/accountmanager/**')
  68. exclude('**/dbinstaller/**')
  69. exclude('**/gameserver/**')
  70. exclude('**/gsregistering/**')
  71. exclude('**/log/**')
  72. exclude('**/loginserver/**')
  73. exclude('**/status/**')
  74. exclude('**/util/**')
  75. exclude('**/Config/**')
  76. exclude('**/ConnectionFactory/**')
  77. exclude('**/Server/**')
  78. manifest {
  79. from(generalManifest)
  80. attributes('Main-Class': 'com.l2jserver.tools.configurator.ConfigUserInterface')
  81. }
  82. }
  83. task dbInstLsJar(type: Jar, dependsOn: classes) {
  84. from(sourceSets.main.output)
  85. archiveName = 'dbinst_ls.jar'
  86. include '**/dbinstaller/**'
  87. include '**/images/**'
  88. include '**/util/**'
  89. include '**/SQLFilter**'
  90. exclude '**/LauncherGS*'
  91. manifest {
  92. from(generalManifest)
  93. attributes('Main-Class': 'com.l2jserver.tools.dbinstaller.LauncherLS')
  94. }
  95. }
  96. task dbInstGsJar(type: Jar, dependsOn: classes) {
  97. from(sourceSets.main.output)
  98. archiveName = 'dbinst_gs.jar'
  99. include('**/dbinstaller/**')
  100. include('**/images/**')
  101. include('**/util/**')
  102. include('**/SQLFilter**')
  103. exclude('**/LauncherLS*')
  104. manifest {
  105. from(generalManifest)
  106. attributes 'Main-Class': 'com.l2jserver.tools.dbinstaller.LauncherGS'
  107. }
  108. }
  109. artifacts {
  110. archives loginJar, configuratorJar, dbInstLsJar, dbInstGsJar
  111. }
  112. task zip(type: Zip, dependsOn: build) {
  113. from('dist') {
  114. exclude('libs')
  115. }
  116. into('libs') {
  117. from(configurations.runtime)
  118. }
  119. into('game') {
  120. from(jar)
  121. from(configuratorJar)
  122. }
  123. into('login') {
  124. from(loginJar)
  125. }
  126. into('tools') {
  127. from(dbInstLsJar)
  128. from(dbInstGsJar)
  129. }
  130. baseName = 'L2J_Server_' + new Date().format("yyyy-MM-dd")
  131. println 'Build in build/distributions/' + baseName + '.zip'
  132. }
  133. build.finalizedBy(zip)
  134. task wrapper(type: Wrapper) {
  135. gradleVersion = '3.5'
  136. }
  137. eclipse {
  138. project {
  139. name = 'L2J_Server'
  140. comment 'L2J Server Project'
  141. natures 'org.eclipse.buildship.core.gradleprojectbuilde'
  142. }
  143. jdt {
  144. file {
  145. whenMerged {jdt ->
  146. def propertiesField = org.gradle.plugins.ide.internal.generator.PropertiesPersistableConfigurationObject.getDeclaredField('properties')
  147. propertiesField.accessible = true
  148. Properties properties = propertiesField.get(jdt)
  149. properties.setProperty 'org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch', 'ignore'
  150. }
  151. }
  152. }
  153. }