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.6KB

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