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 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // DMDirc plugins build script
  2. import org.mdonoughe.JGitDescribeTask
  3. subprojects {
  4. apply plugin: 'java'
  5. apply plugin: 'findbugs'
  6. apply plugin: 'pmd'
  7. configurations {
  8. bundle
  9. compile {
  10. extendsFrom bundle
  11. }
  12. }
  13. sourceSets {
  14. main {
  15. java {
  16. srcDir 'src'
  17. }
  18. resources {
  19. srcDir 'res'
  20. }
  21. }
  22. test {
  23. java {
  24. srcDir 'test'
  25. }
  26. resources {
  27. srcDir 'test-res'
  28. }
  29. }
  30. }
  31. sourceCompatibility = 1.7
  32. targetCompatibility = 1.7
  33. repositories {
  34. mavenCentral()
  35. maven {
  36. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  37. }
  38. maven {
  39. url 'http://nexus.dmdirc.com/nexus/content/repositories/snapshots/'
  40. }
  41. maven {
  42. url 'http://nexus.dmdirc.com/nexus/content/repositories/releases/'
  43. }
  44. }
  45. dependencies {
  46. compile group: 'com.dmdirc', name: 'client', version: '+', changing: true
  47. compile group: 'com.google.code.findbugs', name: 'jsr305', version: '2.+'
  48. compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.1'
  49. testCompile group: 'junit', name: 'junit', version: '4.+'
  50. testCompile group: 'org.mockito', name: 'mockito-all', version: '1.+'
  51. }
  52. task copyPluginConfig(type: Copy) {
  53. from 'plugin.config'
  54. into "$buildDir"
  55. }
  56. task updatePluginConfig(dependsOn: copyPluginConfig) << {
  57. def jgit = new org.mdonoughe.JGitDescribeTask()
  58. jgit.setDir(new File("$rootDir", '.git'))
  59. jgit.setSubDir("$projectDir")
  60. ext.version = jgit.getDescription()
  61. def targetFile = new File("$buildDir", 'plugin.config')
  62. targetFile << "\n\nversion:\n number=${version}\n"
  63. }
  64. pmd {
  65. ruleSets = []
  66. ruleSetFiles = files("$rootDir/etc/pmd/full.xml")
  67. }
  68. tasks.withType(FindBugs) {
  69. reports {
  70. html.enabled = true
  71. xml.enabled = false
  72. }
  73. }
  74. findbugs {
  75. reportLevel = 'low'
  76. effort = 'max'
  77. ignoreFailures = true
  78. }
  79. jar {
  80. from("$buildDir/plugin.config") {
  81. into 'META-INF'
  82. }
  83. from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
  84. exclude 'META-INF/**'
  85. }
  86. }
  87. jar.dependsOn updatePluginConfig
  88. }
  89. buildscript {
  90. repositories {
  91. mavenCentral()
  92. maven {
  93. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  94. }
  95. }
  96. dependencies {
  97. classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
  98. classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
  99. }
  100. }
  101. task wrapper(type: Wrapper) {
  102. gradleVersion = '2.1'
  103. }