You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. configurations {
  2. bundle
  3. plugin
  4. compile {
  5. extendsFrom bundle
  6. }
  7. }
  8. dependencies {
  9. compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0'
  10. compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.1'
  11. bundle group: 'com.squareup.dagger', name: 'dagger', version: '1.2.1'
  12. bundle group: 'com.esotericsoftware.yamlbeans', name: 'yamlbeans', version: '1.08'
  13. bundle group: 'com.brsanthu', name: 'migbase64', version: '2.2'
  14. bundle group: 'net.kencochrane.raven', name: 'raven', version: '5.0.1'
  15. bundle group: 'com.google.guava', name:'guava', version: '18.0'
  16. bundle group: 'net.engio', name: 'mbassador', version: '1.2.0'
  17. bundle group: 'com.dmdirc', name: 'util', version: '+', changing: true
  18. bundle group: 'com.dmdirc.parser', name: 'common', version: '+', changing: true
  19. plugin group: 'com.dmdirc', name: 'ui_swing', version: '+', changing: true
  20. plugin group: 'com.dmdirc', name: 'parser_irc', version: '+', changing: true
  21. plugin group: 'com.dmdirc', name: 'tabcompleter_bash', version: '+', changing: true
  22. plugin group: 'com.dmdirc', name: 'tabcompleter_mirc', version: '+', changing: true
  23. }
  24. allprojects {
  25. apply plugin: 'java'
  26. apply plugin: 'findbugs'
  27. apply plugin: 'pmd'
  28. sourceSets {
  29. main {
  30. java {
  31. srcDir 'src'
  32. }
  33. resources {
  34. srcDir 'res'
  35. }
  36. }
  37. test {
  38. java {
  39. srcDir 'test'
  40. }
  41. resources {
  42. srcDir 'test-res'
  43. }
  44. }
  45. }
  46. sourceCompatibility = 1.7
  47. targetCompatibility = 1.7
  48. repositories {
  49. mavenCentral()
  50. maven {
  51. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  52. }
  53. maven {
  54. url 'http://nexus.dmdirc.com/nexus/content/repositories/snapshots/'
  55. }
  56. }
  57. dependencies {
  58. testCompile group: 'junit', name: 'junit', version: '4.11'
  59. testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.5'
  60. testCompile group: 'com.google.jimfs', name: 'jimfs', version: '1.0'
  61. }
  62. pmd {
  63. ruleSets = []
  64. ruleSetFiles = files("$rootDir/etc/pmd/full.xml")
  65. }
  66. tasks.withType(FindBugs) {
  67. reports {
  68. html.enabled = true
  69. xml.enabled = false
  70. }
  71. }
  72. findbugs {
  73. reportLevel = 'low'
  74. effort = 'max'
  75. ignoreFailures = true
  76. }
  77. }
  78. task createVersionConfig << {
  79. def gitDir = new File(projectDir, '.git')
  80. def jgit = new org.mdonoughe.JGitDescribeTask()
  81. jgit.dir = gitDir
  82. version = jgit.getDescription()
  83. def targetFile = new File(buildDir, 'version.config')
  84. targetFile.text = ''
  85. targetFile << "keysections:\n identity\n version\n updater\n bundledplugins_versions\n\n"
  86. targetFile << "identity:\n name=DMDirc version information\n globaldefault=true\n order=95000\n\n"
  87. targetFile << "version:\n version=${version}\n\n"
  88. targetFile << "updater:\n channel=${updaterChannel}\n\n"
  89. targetFile << "buildenv:\n"
  90. def compileConfiguration = project.configurations.getByName("compile")
  91. def resolvedConfiguration = compileConfiguration.resolvedConfiguration
  92. def resolvedArtifacts = resolvedConfiguration.resolvedArtifacts
  93. resolvedArtifacts.each { dp ->
  94. def version = dp.moduleVersion.id
  95. targetFile << " " + version.group + " " + version.name + " " + version.version + "\n"
  96. }
  97. // Copy to the build directory so it's accessible during tests
  98. java.nio.file.Files.copy(targetFile.toPath(),
  99. sourceSets.main.output.classesDir.toPath().resolve('com').resolve('dmdirc').resolve('version.config'),
  100. java.nio.file.StandardCopyOption.REPLACE_EXISTING);
  101. }
  102. jar.dependsOn createVersionConfig
  103. test.dependsOn createVersionConfig
  104. jar {
  105. from("$buildDir/version.config") {
  106. into 'com/dmdirc/'
  107. }
  108. from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
  109. exclude 'META-INF/**'
  110. }
  111. manifest {
  112. attributes 'Main-Class': 'com.dmdirc.Main'
  113. }
  114. }
  115. buildscript {
  116. repositories {
  117. mavenCentral()
  118. maven {
  119. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  120. }
  121. }
  122. dependencies {
  123. classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
  124. classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
  125. }
  126. }
  127. task wrapper(type: Wrapper) {
  128. gradleVersion = '2.1'
  129. }