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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // DMDirc plugins build script
  2. //
  3. // Run with -PdmdircOutput=/path/to/DMDirc/classes/
  4. import org.mdonoughe.JGitDescribeTask
  5. subprojects {
  6. apply plugin: 'java'
  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. jar {
  65. from("$buildDir/plugin.config") {
  66. into 'META-INF'
  67. }
  68. from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
  69. exclude 'META-INF/**'
  70. }
  71. }
  72. jar.dependsOn updatePluginConfig
  73. }
  74. buildscript {
  75. repositories {
  76. mavenCentral()
  77. maven {
  78. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  79. }
  80. }
  81. dependencies {
  82. classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
  83. classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
  84. }
  85. }
  86. task wrapper(type: Wrapper) {
  87. gradleVersion = '2.1'
  88. }