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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. }
  27. }
  28. sourceCompatibility = 1.7
  29. targetCompatibility = 1.7
  30. repositories {
  31. mavenCentral()
  32. maven {
  33. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  34. }
  35. maven {
  36. url 'http://nexus.dmdirc.com/nexus/content/repositories/snapshots/'
  37. }
  38. maven {
  39. url 'http://nexus.dmdirc.com/nexus/content/repositories/releases/'
  40. }
  41. }
  42. dependencies {
  43. compile group: 'com.dmdirc', name: 'client', version: '+', changing: true
  44. compile group: 'com.google.code.findbugs', name: 'jsr305', version: '2.+'
  45. compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.1'
  46. testCompile group: 'junit', name: 'junit', version: '4.+'
  47. testCompile group: 'org.mockito', name: 'mockito-all', version: '1.+'
  48. }
  49. task copyPluginConfig(type: Copy) {
  50. from 'plugin.config'
  51. into "$buildDir"
  52. }
  53. task updatePluginConfig(dependsOn: copyPluginConfig) << {
  54. def jgit = new org.mdonoughe.JGitDescribeTask()
  55. jgit.setDir(new File("$rootDir", '.git'))
  56. jgit.setSubDir("$projectDir")
  57. ext.version = jgit.getDescription()
  58. def targetFile = new File("$buildDir", 'plugin.config')
  59. targetFile << "\n\nversion:\n number=${version}\n"
  60. }
  61. jar {
  62. from("$buildDir/plugin.config") {
  63. into 'META-INF'
  64. }
  65. from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
  66. exclude 'META-INF/**'
  67. }
  68. }
  69. jar.dependsOn updatePluginConfig
  70. }
  71. buildscript {
  72. repositories {
  73. mavenCentral()
  74. maven {
  75. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  76. }
  77. }
  78. dependencies {
  79. classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
  80. classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
  81. }
  82. }
  83. task wrapper(type: Wrapper) {
  84. gradleVersion = '2.1'
  85. }