build.gradle 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * This file was generated by the Gradle 'init' task.
  3. */
  4. plugins {
  5. id 'java-library'
  6. id 'java'
  7. }
  8. group = 'at.ac.tuwien.infosys.dslab'
  9. version = '2021'
  10. java {
  11. sourceCompatibility = JavaVersion.VERSION_11
  12. targetCompatibility = JavaVersion.VERSION_11
  13. }
  14. dependencies {
  15. implementation files('lib/commons-logging-1.2.jar')
  16. implementation files('lib/hamcrest-core-1.3.jar')
  17. implementation files('lib/junit-4.12.jar')
  18. implementation files('lib/orvell-core-0.2.0.jar')
  19. }
  20. // ======== run specifications
  21. tasks.withType(JavaCompile) {
  22. options.encoding = 'UTF-8'
  23. }
  24. def dslabRunTasks = [
  25. [name: 'run-monitoring', main: 'dslab.monitoring.MonitoringServer', args: 'monitoring', description: 'Run Monitoring Server'],
  26. [name: 'run-transfer-1', main: 'dslab.transfer.TransferServer', args: 'transfer-1', description: 'Run Transfer Server #1'],
  27. [name: 'run-transfer-2', main: 'dslab.transfer.TransferServer', args: 'transfer-2', description: 'Run Transfer Server #2'],
  28. [name: 'run-mailbox-earth-planet', main: 'dslab.mailbox.MailboxServer', args: 'mailbox-earth-planet', description: 'Run Mailbox Server for earth.planet'],
  29. [name: 'run-mailbox-univer-ze', main: 'dslab.mailbox.MailboxServer', args: 'mailbox-univer-ze', description: 'Run Mailbox Server for univer.ze'],
  30. // assignment 2
  31. [name: 'run-ns-root', main: 'dslab.nameserver.Nameserver', args: 'ns-root', description: 'Run root nameserver'],
  32. [name: 'run-ns-ze', main: 'dslab.nameserver.Nameserver', args: 'ns-ze', description: 'Run .ze nameserver'],
  33. [name: 'run-ns-planet', main: 'dslab.nameserver.Nameserver', args: 'ns-planet', description: 'Run .planet nameserver'],
  34. [name: 'run-ns-earth-planet', main: 'dslab.nameserver.Nameserver', args: 'ns-earth-planet', description: 'Run .earth.planet nameserver'],
  35. [name: 'run-client-trillian', main: 'dslab.client.MessageClient', args: 'client-trillian', description: 'Run client for trillian'],
  36. [name: 'run-client-arthur', main: 'dslab.client.MessageClient', args: 'client-arthur', description: 'Run client for arthur'],
  37. [name: 'run-client-zaphod', main: 'dslab.client.MessageClient', args: 'client-zaphod', description: 'Run client for zaphod'],
  38. ]
  39. // dynamically create run tasks of this structure:
  40. //
  41. // task 'run-transfer-1'(dependsOn: 'classes', type: JavaExec) {
  42. // main = 'dslab.transfer.TransferServer'
  43. // args 'transfer-2'
  44. // classpath = sourceSets.main.runtimeClasspath
  45. // standardInput = System.in
  46. // }
  47. for (t in dslabRunTasks) {
  48. def taskName = t['name']
  49. task "$taskName"(dependsOn: 'classes', type: JavaExec) {
  50. main = t['main']
  51. args t['args']
  52. description = t['description']
  53. classpath = sourceSets.main.runtimeClasspath
  54. // https://discuss.gradle.org/t/why-doesnt-system-in-read-block-when-im-using-gradle/3308
  55. standardInput = System.in
  56. }
  57. }