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

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