build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * MIT License
  3. *
  4. * Copyright (c) 2018 Axis Communications AB
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in all
  14. * copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  22. * SOFTWARE.
  23. */
  24. apply plugin: 'java'
  25. version = '0.1'
  26. repositories {
  27. jcenter()
  28. }
  29. jar {
  30. manifest {
  31. attributes 'Main-Class': 'Main'
  32. }
  33. }
  34. sourceSets {
  35. main {
  36. java {
  37. srcDirs 'src'
  38. }
  39. }
  40. }
  41. dependencies {
  42. compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
  43. compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
  44. compile group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '4.10.0.201712302008-r'
  45. compile group: 'commons-io', name: 'commons-io', version: '2.6'
  46. compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
  47. compile group: 'info.debatty', name: 'java-string-similarity', version: '1.0.1'
  48. compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1'
  49. compile group: 'org.incava', name: 'diffj', version: '1.6.4'
  50. compile group: 'net.sourceforge.pmd', name: 'pmd', version: '5.8.1'
  51. compile group: 'net.sourceforge.pmd', name: 'pmd-core', version: '5.8.1'
  52. compile group: 'net.sourceforge.pmd', name: 'pmd-cpp', version: '5.8.1'
  53. }
  54. task runJar(type: JavaExec) {
  55. def issues_var = ""
  56. if (project.hasProperty("issues")) {
  57. issues_var = issues
  58. }
  59. def repository_var = ""
  60. if (project.hasProperty("repo")) {
  61. repository_var = repo
  62. }
  63. args issues_var, repository_var
  64. jvmArgs = ['-Xms1028m', '-Xmx2056m']
  65. classpath = files('build/libs/read.jar')
  66. classpath += sourceSets.main.runtimeClasspath
  67. main = 'Main'
  68. }
  69. task fatJar(type: Jar) {
  70. manifest {
  71. attributes 'Implementation-Title': 'SZZ Algorithm: Bug Introducing Commits Finder',
  72. 'Implementation-Version': version,
  73. 'Main-Class': 'Main'
  74. }
  75. baseName = 'szz_find_bug_introducers'
  76. from { configurations.compile.collect {it.isDirectory() ? it : zipTree(it) } } {
  77. exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
  78. }
  79. with jar
  80. }