2
0

build.gradle 4.2 KB

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