build.gradle 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. apply plugin: 'java'
  2. apply plugin: 'distribution'
  3. defaultTasks('build')
  4. sourceCompatibility = '1.8'
  5. sourceSets {
  6. main {
  7. java {
  8. srcDir('java')
  9. }
  10. }
  11. }
  12. dependencies {
  13. compile(fileTree(dir: 'dist/libs', include: '*.jar'))
  14. }
  15. def generalManifest = manifest {
  16. attributes('Built-By': System.getProperty('user.name'),
  17. 'Built-Date': new Date(),
  18. 'Implementation-URL': 'http://www.l2jserver.com/',
  19. 'Class-Path': configurations.runtime.collect({ '../libs/' + it.getName() }).join(' '))
  20. }
  21. jar {
  22. archiveName = 'l2jserver.jar'
  23. exclude('**/dbinstaller/**')
  24. exclude('**/loginserver/**')
  25. exclude('**/accountmanager/**')
  26. exclude('**/gsregistering/**')
  27. manifest {
  28. from(generalManifest)
  29. attributes 'Class-Path': configurations.compile.collect { it.getName() }.join(','),
  30. 'Main-Class': 'com.l2jserver.gameserver.GameServer'
  31. }
  32. }
  33. task loginJar(type: Jar, dependsOn: classes) {
  34. from(sourceSets.main.output)
  35. archiveName = 'l2jlogin.jar'
  36. exclude('**/dbinstaller/**')
  37. exclude('**/gameserver/**')
  38. manifest {
  39. from(generalManifest)
  40. attributes(//'Class-Path': '../libs/c3p0-0.9.5-pre10.jar ../libs/javolution-5.5.1.jar ../libs/mail-1.5.2.jar ../libs/mmocore.jar ../libs/mysql-connector-java-5.1.31-bin.jar ../libs/weupnp-0.1.3.jar',
  41. 'Main-Class': 'com.l2jserver.loginserver.L2LoginServer')
  42. }
  43. }
  44. task configuratorJar(type: Jar, dependsOn: classes) {
  45. from(sourceSets.main.output)
  46. archiveName = 'L2J_Configurator.jar'
  47. include('**/configurator/**')
  48. include('**/i18n/**')
  49. include('**/images/**')
  50. exclude('**/accountmanager/**')
  51. exclude('**/dbinstaller/**')
  52. exclude('**/gameserver/**')
  53. exclude('**/gsregistering/**')
  54. exclude('**/log/**')
  55. exclude('**/loginserver/**')
  56. exclude('**/status/**')
  57. exclude('**/util/**')
  58. exclude('**/Config/**')
  59. exclude('**/L2DatabaseFactory/**')
  60. exclude('**/Server/**')
  61. manifest {
  62. from(generalManifest)
  63. attributes('Main-Class': 'com.l2jserver.tools.configurator.ConfigUserInterface')
  64. }
  65. }
  66. task dbInstLsJar(type: Jar, dependsOn: classes) {
  67. from(sourceSets.main.output)
  68. archiveName = 'dbinst_ls.jar'
  69. include '**/dbinstaller/**'
  70. include '**/images/**'
  71. include '**/util/**'
  72. include '**/SQLFilter**'
  73. exclude '**/LauncherGS*'
  74. manifest {
  75. from(generalManifest)
  76. attributes('Main-Class': 'com.l2jserver.tools.dbinstaller.LauncherLS')
  77. }
  78. }
  79. task dbInstGsJar(type: Jar, dependsOn: classes) {
  80. from(sourceSets.main.output)
  81. archiveName = 'dbinst_gs.jar'
  82. include('**/dbinstaller/**')
  83. include('**/images/**')
  84. include('**/util/**')
  85. include('**/SQLFilter**')
  86. exclude('**/LauncherLS*')
  87. manifest {
  88. from(generalManifest)
  89. attributes 'Main-Class': 'com.l2jserver.tools.dbinstaller.LauncherGS'
  90. }
  91. }
  92. artifacts {
  93. archives loginJar, configuratorJar, dbInstLsJar, dbInstGsJar
  94. }
  95. task zip(type: Zip, dependsOn: build) {
  96. from('dist') {
  97. exclude('libs')
  98. }
  99. into('libs') {
  100. from(configurations.runtime)
  101. }
  102. into('game') {
  103. from(jar)
  104. from(configuratorJar)
  105. }
  106. into('login') {
  107. from(loginJar)
  108. }
  109. into('tools') {
  110. from(dbInstLsJar)
  111. from(dbInstGsJar)
  112. }
  113. }
  114. build.finalizedBy(zip)
  115. task wrapper(type: Wrapper) {
  116. gradleVersion = '2.2.1'
  117. }