build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * This build file was auto generated by running the Gradle 'init' task
  3. * by 'jessey' at '04.07.16 13:33' with Gradle 2.2.1
  4. *
  5. * This generated file contains a commented-out sample Java project to get you started.
  6. * For more details take a look at the Java Quickstart chapter in the Gradle
  7. * user guide available at http://gradle.org/docs/2.2.1/userguide/tutorial_java_projects.html
  8. */
  9. buildscript {
  10. repositories {
  11. jcenter()
  12. }
  13. }
  14. plugins {
  15. id "edu.sc.seis.launch4j" version "2.4.9"
  16. }
  17. // Apply the java plugin to add support for Java
  18. apply plugin: 'java'
  19. apply plugin: 'eclipse'
  20. apply plugin: 'application'
  21. apply plugin: 'edu.sc.seis.launch4j'
  22. version = '2.1'
  23. mainClassName = 'ui.view.Main'
  24. def projectName = 'holeg'
  25. def mainClass = 'ui.view.Main'
  26. // the fatJar includes all dependencies (all used libraries)
  27. task fatJar(type: Jar) {
  28. manifest {
  29. attributes 'Implmenetation-Title': projectName,
  30. 'Implementation-Version': version,
  31. 'Main-Class': mainClass
  32. }
  33. baseName = projectName + '-all'
  34. from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
  35. with jar
  36. }
  37. jar {
  38. manifest {
  39. attributes 'Main-Class': mainClass
  40. }
  41. baseName = projectName
  42. }
  43. sourceSets {
  44. //test {
  45. // java {
  46. // srcDir 'tests'
  47. // }
  48. // resources {
  49. // srcDir 'res'
  50. // }
  51. //}
  52. main {
  53. java {
  54. srcDir 'src'
  55. }
  56. resources {
  57. srcDir 'res'
  58. }
  59. }
  60. }
  61. repositories {
  62. mavenCentral()
  63. jcenter()
  64. }
  65. dependencies {
  66. // download jars on the fly
  67. // https://mvnrepository.com/artifact/org.apache.commons/commons-compress
  68. compile group: 'org.apache.commons', name: 'commons-compress', version: '1.13'
  69. // https://mvnrepository.com/artifact/org.apache.commons/commons-email
  70. compile group: 'org.apache.commons', name: 'commons-email', version: '1.5'
  71. // https://mvnrepository.com/artifact/com.google.code.gson/gson
  72. compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
  73. // https://mvnrepository.com/artifact/junit/junit
  74. testCompile group: 'junit', name: 'junit', version: '4.12'
  75. compile group: 'junit', name: 'junit', version: '4.12'
  76. // use /jar Folder (old system)
  77. compile fileTree(dir: 'jars/commons-compress-1.13', include: ['*.jar'])
  78. compile fileTree(dir: 'jars', include: ['*.jar'])
  79. testCompile group: 'junit', name: 'junit', version: '4.+'
  80. }
  81. // execute by command-line with 'gradlew clean jar createAllExecutables -Pl4j-debug --stacktrace'
  82. // then add jre8-distribution to folder 'jre8' in same directory
  83. //
  84. // the directory-structure afterwards should look like
  85. // |- [projectName].exe
  86. // |> lib
  87. // |- commons-compress-1.13.jar
  88. // ...
  89. // |> jre8
  90. // |> bin
  91. // |> lib
  92. // ...
  93. launch4j {
  94. mainClassName='ui.view.Main'
  95. // relative path at which the bundled JRE lies
  96. bundledJrePath = 'jre8'
  97. // for 64b: comment in, for 32b: comment out
  98. bundledJre64Bit = true
  99. // names of output file
  100. productName = projectName
  101. outfile = projectName + '.exe'
  102. }
  103. /*
  104. // In this section you declare where to find the dependencies of your project
  105. repositories {
  106. // Use 'jcenter' for resolving your dependencies.
  107. // You can declare any Maven/Ivy/file repository here.
  108. jcenter()
  109. }
  110. // In this section you declare the dependencies for your production and test code
  111. dependencies {
  112. // The production code uses the SLF4J logging API at compile time
  113. compile 'org.slf4j:slf4j-api:1.7.7'
  114. // Declare the dependency for your favourite test framework you want to use in your tests.
  115. // TestNG is also supported by the Gradle Test task. Just change the
  116. // testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
  117. // 'test.useTestNG()' to your build script.
  118. testCompile "junit:junit:4.11"
  119. }
  120. */