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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. }
  36. dependencies {
  37. compile files("$dmdircOutput")
  38. compile fileTree(dir: '../../../lib/bundled/', include: '*.jar')
  39. compile group: 'com.google.code.findbugs', name: 'jsr305', version: '2.+'
  40. compile group: 'com.squareup.dagger', name: 'dagger-compiler', version: '1.2.1'
  41. }
  42. task copyPluginConfig(type: Copy) {
  43. from 'plugin.config'
  44. into "$buildDir"
  45. }
  46. task updatePluginConfig(dependsOn: copyPluginConfig) << {
  47. def jgit = new org.mdonoughe.JGitDescribeTask()
  48. jgit.setDir(new File("$rootDir", '.git'))
  49. jgit.setSubDir("$projectDir")
  50. ext.version = jgit.getDescription()
  51. def targetFile = new File("$buildDir", 'plugin.config')
  52. targetFile << "\n\nversion:\n number=${version}\n"
  53. }
  54. jar {
  55. from("$buildDir/plugin.config") {
  56. into 'META-INF'
  57. }
  58. from { configurations.bundle.collect { it.isDirectory() ? it : zipTree(it) } } {
  59. exclude 'META-INF/**'
  60. }
  61. }
  62. jar.dependsOn updatePluginConfig
  63. }
  64. buildscript {
  65. repositories {
  66. mavenCentral()
  67. maven {
  68. url 'http://nexus.dmdirc.com/nexus/content/repositories/thirdparty/'
  69. }
  70. }
  71. dependencies {
  72. classpath group: 'com.github.shanemcc', name: 'jgit-describe', version: '0.5'
  73. classpath group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '2.3.1.+'
  74. }
  75. }