build.gradle 3.2 KB

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