build.gradle 3.9 KB

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